Hallo
Ich nmöchte ein Programm in vb.net schreiben, dass FLV Dateien abspielen kann.
Die Verweise:
Shockwave ActiveX Control
Shockwave Flash
In der Form ist ein Fenster (Shockwave Flash Objekt) und einen Knopf.
Das Problem: die Datei wird womöglich geöffnet, aber nicht abgespielt und das Shockwave Flash Objekt Fenster bleibt weiss.
Besten Dank für jeden Tip
Freundliche Grüsse
Sebastian
Der Code:
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports System.IO
Imports System.Xml
Imports AxShockwaveFlashObjects
Public Class FLVPlayer
Private statusbar As StatusBar
Private fileNameStatusBarPanel As StatusBarPanel
Private videoPlaceholder As System.Windows.Forms.Panel
Private openVideo As System.Windows.Forms.Button
Private openVideoDialog As System.Windows.Forms.OpenFileDialog
Private flashPlayer As AxShockwaveFlashObjects.AxShockwaveFlash
Public Sub New()
’
’ Required for Windows Form Designer support
’
InitializeComponent()
Try
AxShockwaveFlashPlayer.LoadMovie(0, Application.StartupPath + „\player.swf“)
'AddHandler AxShockwaveFlashPlayer.FlashCall, AddressOf AxShockwaveFlashPlayer.FlashCall '_FlashCall
Catch ex As Exception
'ExceptionUtilities.DisplayException(„Unable to load SWF video player, please verify you have Flash Player 8 installed and try again.“)
Me.Dispose()
End Try
End Sub 'New
Private Sub LoadVideo(ByVal videoPath As String)
'videoPath = „C:\Dokumente und Einstellungen\Spatzi\Desktop\Songs\Aretha_Franklin_-_Freeway_Of_Love_-_a_Music_video.flv“
'fileNameStatusBarPanel.Text = videoPath
'AxShockwaveFlashPlayer.CallFunction(("" + videoPath + „“))
'Set up the Flash container
'Me.AxShockwaveFlashPlayer.Top = Me.Top
'Me.AxShockwaveFlashPlayer.Left = Me.Left
'Me.AxShockwaveFlashPlayer.Width = Me.Width
'Make sure you over write the taskbar gap at the bottom
'Me.AxShockwaveFlashPlayer.Height = Me.Height + 28
'Me.AxShockwaveFlashPlayer.AllowFullScreen = True
Me.AxShockwaveFlashPlayer.LoadMovie(0, videoPath)
'AxShockwaveFlashPlayer.Movie = videoPath
'AxShockwaveFlashPlayer.Play()
End Sub 'LoadVideo
Private Sub openVideos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles openVideos.Click
'ToDo: Error processing original source shown below
’
’
'–^— Unexpected pre-processor directive
openVideoDialog = New OpenFileDialog()
openVideoDialog.Filter = „*.flv|*.flv“
openVideoDialog.Title = „Select a Flash Video file…“
openVideoDialog.Multiselect = False
openVideoDialog.RestoreDirectory = True
If openVideoDialog.ShowDialog() = DialogResult.OK Then
’ LoadVideo(openVideoDialog.FileName);
LoadVideo(openVideoDialog.FileName)
End If
End Sub
End Class