【问题标题】:Has anyone ever used jwplayer to play multiple flv files consecutively? using vb.net有没有人用过jwplayer连续播放多个flv文件?使用 vb.net
【发布时间】:2012-12-28 05:48:18
【问题描述】:

有人用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

【问题讨论】:

  • 为什么不使用播放列表?您在这里使用的是什么版本的 JW Player?如果您使用的是 V5 或 V6,则可以使用播放列表,然后让一个项目一个接一个地重复。
  • v3.16 如何在 vb.net 中使用播放列表?如果你能告诉我,那就太棒了。到目前为止我的代码在上面:-) 现在我的问题是我无法检测到一个项目何时完成以便开始播放下一个
  • 3.16 已经很老了。我必须去archive.org ;) web.archive.org/web/20080105051613/http://… autostart (true,false):在播放器中将此设置为 true 以在页面加载时自动开始播放,或者使用旋转器将其设置为 false 以防止自动旋转。 repeat (true,false,list):将此设置为 true 以自动重复播放文件或播放列表。将此设置为 list 以播放播放列表中的所有项目一次。播放列表 - web.archive.org/web/20080106114940/http://…
  • 虽然你的帮助很好。你能帮我编码吗?这就是我一开始寻求帮助的原因
  • 我将把它作为答案留在下面。

标签: vb.net visual-studio-2010 flash video-streaming jwplayer


【解决方案1】:

对于重复播放列表来说,这将是这样的。

代替:

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>

希望这会有所帮助!

【讨论】:

  • 上面回复了,不适合cmets
  • 当我尝试了你建议的没有播放时,基本上而不是允许连续播放多个剪辑。这是我的项目文件的链接:sdrv.ms/VDXZDL
  • 嗯,我看了一下文件。但是,我没有 Visual Studio。我知道将播放器嵌入网页中会起作用(因为这是播放器本身的预期用例),但我以前没有使用过 VS。
  • 好烦人 :-) 感觉离我很近
  • 刚刚做了一点研究,认为播放列表不起作用的原因是因为我使用的是 v3.16。播放列表支持仅在 v5 中提供
猜你喜欢
  • 2022-01-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-29
相关资源
最近更新 更多