jwplayer width HLS - 找不到可播放的来源。我的错是什么?

时间:2016-11-08 03:19:34

标签: video-streaming html5-video jwplayer live-streaming hls

JW Player无法播放HLS。这是我的页面HTML代码:

 <!DOCTYPE> 
 <html>
    <head>
        <script src='https://content.jwplatform.com/libraries/7XBRYUMN.js'></script>
        <script>jwplayer.key="***";</script>
    </head>
    <body>
        <div id="my-video"></div>
        <script type="text/javascript">
            jwplayer("my-video").setup({
                file: "http://esioslive6-i.akamaihd.net/hls/live/202892/AL_P_ESP1_FR_FRA/playlist.m3u8",
                width: 400,
                height: 240,
                title: "video",
                hlshtml: true,
                type: "hls",
                androidhls: true
            });
        </script>
    </body>
</html>

播放器始终显示:加载播放器时出错:找不到可播放的来源。 HLS在线查看http://demo.jwplayer.com/stream-tester/ HLS正确再现。 我的错是什么?

1 个答案:

答案 0 :(得分:1)

我认为您在jwplayer上的帐户没有HLS Adaptive Streaming的权限,或者jwplayer.key与jwplayer js文件不匹配。我已经检查了演示网站的帐户,并且正确播放

 <!DOCTYPE> 
 <html>
    <head>
        <script src="//content.jwplatform.com/libraries/V6NfEzT7.js"></script>
        <script>jwplayer.key="AIzaSyCCd7R6tUAGAwFNlq0hV_C7GWNEZNhzxa4";</script>
    </head>
    <body>
        <div id="my-video"></div>
        <script type="text/javascript">
            jwplayer("my-video").setup({
                file: "http://esioslive6-i.akamaihd.net/hls/live/202892/AL_P_ESP1_FR_FRA/playlist.m3u8",
                width: 400,
                height: 240,
                title: "video",
                hlshtml: true,
                type: "hls",
                androidhls: true
            });
        </script>
    </body>
</html>