0

有没有人用过jwplayer连续播放多个flv文件?只是为了进一步澄清,我想知道的是 jwplayer 何时完成播放视频,以便我可以开始播放下一个视频。

到目前为止,我可以播放一部电影,但我不能一个接一个地播放

到目前为止的代码:

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
4

1 回答 1

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>

希望这可以帮助!

于 2012-12-27T21:48:18.633 回答