2012-12-26 17 views
0

有沒有人曾經使用jwplayer連續播放多個flv文件? 爲了進一步澄清,我想知道的是當jwplayer完成播放視頻時,我可以開始播放下一個視頻。有沒有人曾經使用jwplayer連續播放多個flv文件?使用vb.net

到目前爲止,我可以播放一部電影,但其他

代碼後,我打不了一個至今:

Imports System.IO 
Imports System.Net.Sockets 
Public Class Form1 
    Friend WithEvents AxShockwaveFlash1 As New AxShockwaveFlashObjects.AxShockwaveFlash 
    Dim PlayingFlash As Boolean = False 
    Dim PlaylistHidden As Boolean = False 
    Dim SettingUseJwPlayer3_16 As Boolean = True 
    Sub OpenFLV(ByVal strFile As String, ByVal AxShockWaveFlash As AxShockwaveFlashObjects.AxShockwaveFlash) 
     Dim strPath As String 
     Dim PlayerPath As String = My.Computer.FileSystem.SpecialDirectories.Temp & "\player.swf" 
     If File.Exists(PlayerPath) Then File.Delete(PlayerPath) 
     File.WriteAllBytes(PlayerPath, My.Resources.player) 
     strPath = "file:///" & PlayerPath & "?file=" 
     strPath = strPath & strFile 
     strPath = Replace(strPath, "\", "/") 
     With AxShockWaveFlash 
      .Stop() 
      .Visible = True 
      .Menu = False 
      .FlashVars = "&showstop=true&showdownload=false&height=" & AxShockWaveFlash.Height.ToString & "&width=" & AxShockWaveFlash.Width.ToString & "&showplay=true&autoscroll=false&autostart=true&overstretch=true&showicons=1&searchbar=false&controlbar=0" 
      .LoadMovie(0, strPath) 
      .Play() 
     End With 
     PlayingFlash = True 
    End Sub 
    Sub PlayJwPlayer3_16(ByVal Vid As String) 
     If Not AxShockwaveFlash1.IsDisposed Then AxShockwaveFlash1.Dispose() 
     AxShockwaveFlash1 = New AxShockwaveFlashObjects.AxShockwaveFlash 
     AxShockwaveFlash1.BeginInit() 
     AxShockwaveFlash1.Name = "AxShockwaveFlash1" 
     AxShockwaveFlash1.EndInit() 
     Me.Controls.Add(AxShockwaveFlash1) 
     AxShockwaveFlash1.Visible = True 
     AxShockwaveFlash1.Location = Panel1.Location 
     AxShockwaveFlash1.BringToFront() 
     PlayingFlash = True 
     Panel1.Visible = False 
     OpenFLV(Vid, AxShockwaveFlash1) 
    End Sub 
    Private Sub Play_Click(sender As Object, e As EventArgs) Handles Play.Click 
     PlayJwPlayer3_16("https://dp-geography.wikispaces.com/file/view/World+Cup+in+South+Africa+-+%28IB+Geography+Study+Sports%2C+Leisure+%26amp%3B+Tourism+%29.flv") 
    End Sub 
End Class 
+0

爲什麼不使用播放列表?你在這裏使用什麼版本的JW Player?如果您使用的是V5或V6,則可以使用播放列表,只需重複播放一個項目即可。 – emaxsaun

+0

v3.16如何在vb.net上使用播放列表?如果你能告訴我那會很棒。我的代碼到目前爲止是:-) 現在對我來說問題是我無法檢測到一個項目完成以便開始播放下一個 – Santa

+0

3.16已經很老了。我必須去archive.org;) http://web.archive.org/web/20080105051613/http://www.jeroenwijering.com/?item=Supported_Flashvars autostart(true,false):Set這可以讓玩家在頁面加載時自動開始播放,或者使用旋轉器將其設置爲false以防止自動旋轉。 repeat(true,false,list):將其設置爲true以自動重複播放文件或播放列表。將其設置爲列表可以播放播放列表中的所有項目一次。 播放列表 - http://web.archive.org/web/20080106114940/http://www.jeroenwijering.com/?item=Supported_Playlists – emaxsaun

回答

0

這會是這樣的一個重複播放列表。

相反的:

PlayJwPlayer3_16("https://dp-geography.wikispaces.com/file/view/World+Cup+in+South+Africa+-+%28IB+Geography+Study+Sports%2C+Leisure+%26amp%3B+Tourism+%29.flv") 

使用類似:

PlayJwPlayer3_16("https://dp-geography.wikispaces.com/file/playlist.xml") 

也是因爲這個部分:

FlashVars = "&showstop=true&showdownload=false&height=" & AxShockWaveFlash.Height.ToString & "&width=" & AxShockWaveFlash.Width.ToString & "&showplay=true&autoscroll=false&autostart=true&overstretch=true&showicons=1&searchbar=false&controlbar=0" 

會是什麼樣子:

&showstop=true&showdownload=false&height=" & AxShockWaveFlash.Height.ToString & "&width=" & AxShockWaveFlash.Width.ToString & "&showplay=true&autoscroll=false&autostart=true&overstretch=true&showicons=1&searchbar=false&controlbar=0&repeat=list" 

下面是一個簡單的播放列表會是什麼樣子:

<playlist version="1" xmlns="http://xspf.org/ns/0/"> 
    <title>Example XSPF playlist for the JW Player</title> 
    <info>http://www.longtailvideo.com</info> 
    <tracklist> 

     <track> 
      <title>Big Buck Bunny - FLV Video</title> 
      <creator>the Peach Open Movie Project</creator> 
      <info>http://www.bigbuckbunny.org/</info> 
      <annotation>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</annotation> 
      <location>http://www.longtailvideo.com/jw/upload/bunny.flv</location> 
     </track> 

     <track> 
      <title>Big Buck Bunny - MP3 Audio with thumb</title> 
      <creator>the Peach Open Movie Project</creator> 
      <info>http://www.bigbuckbunny.org/</info> 
      <annotation>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</annotation> 
      <location>http://www.longtailvideo.com/jw/upload/bunny.mp3</location> 
      <image>http://www.longtailvideo.com/jw/upload/bunny.jpg</image> 
     </track> 

     <track> 
      <title>Big Buck Bunny - PNG Image with start</title> 
      <creator>the Peach Open Movie Project</creator> 
      <info>http://www.bigbuckbunny.org/</info> 
      <annotation>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</annotation> 
      <location>http://www.longtailvideo.com/jw/upload/bunny.png</location> 
      <meta rel="duration">20</meta> 
      <meta rel="start">10</meta> 
     </track> 

     <track> 
      <title>Big Buck Bunny - PNG Image with start</title> 
      <creator>the Peach Open Movie Project</creator> 
      <info>http://www.bigbuckbunny.org/</info> 
      <annotation>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</annotation> 
      <location>http://www.longtailvideo.com/jw/upload/bunny.png</location> 
      <meta rel="duration">20</meta> 
      <meta rel="start">10</meta> 
     </track> 
    </tracklist> 
</playlist> 

希望這有助於!

+0

已回覆上面,基本上不會讓評論 – Santa

+0

適合連續播放多個剪輯,當我嘗試了你所說的沒有任何玩法時。這裏是我的項目文件的鏈接:http://sdrv.ms/VDXZDL – Santa

+0

嗯,我看看這些文件。但是,我沒有Visual Studio。我知道將播放器嵌入網頁內部是可行的(因爲這是播放器本身的預期用例),但我之前沒有使用過VS。 – emaxsaun

相關問題