【问题标题】:Detect if jwplayer is live, if not then vod fallback检测 jwplayer 是否在线,如果没有,则 vod 回退
【发布时间】:2015-04-09 12:40:56
【问题描述】:

如果直播不可用,我想使用我的 JWPLAYER 6 pro 播放直播并切换到 vod 下载备用。

这是我的简单代码:

<div id='playervideo' style="max-height:800px !important; max-width:1365 !important; min-height:392 !important; min-width:640 !important">
        <script type='text/javascript'>
            jwplayer('playervideo').setup({
                playlist: [{
                    image: "http://domain.com/directabouttostar.jpg",
                    sources: [{
                      file: "http://oxygenstream.fr/live2.f4m"
                    },{
                      file: "http://oxygenstream.fr/live2.m3u8"
                    },{
                      file: "http://oxygenstream.fr/vod.mp4"
                    }]
                  }],
                primary: "flash",
                androidhls: true,
                autostart:  true,
                fallback: true,
                width: '100%',
                aspectratio: "16:9",
                abouttext: '::::  OXYGENSTREAM.FR  ::::',
                aboutlink: 'http://oxygenstream.fr'
            });
        </script></div>

【问题讨论】:

    标签: jwplayer http-live-streaming fallback m3u8 video-on-demand


    【解决方案1】:

    如果流关闭,播放器要么出错,要么继续缓冲。

    您可以做的是检查缓冲,等待一段时间,然后加载一个新文件。

    或者,您可以检查播放器是否出错,然后加载新文件。

    例子:

    http://support.jwplayer.com/customer/portal/articles/1442607-example-a-custom-error-message

    【讨论】:

    • 这很好,但我不能让它像它应该工作的那样工作。使用onbuffer,如果我发送流,它会开始读取我的流,但由于即使在直播期间也有缓冲,它会切换回加载文件。
    猜你喜欢
    • 2015-03-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-03
    • 1970-01-01
    • 2021-03-26
    • 1970-01-01
    • 2020-12-30
    相关资源
    最近更新 更多