videojs停止播放HLS / M3U8文件

时间:2016-02-21 09:19:39

标签: javascript html5 video-streaming html5-video video.js

我使用videojs在我的服务器上播放HLS / M3U8,视频文件加载正常,但播放几秒钟后它停止,我必须按暂停/播放以恢复流我有快速连接我不知道为什么会这样。

HTML

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta content="" name="description">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>HLS Test</title>
    <link href="http://vjs.zencdn.net/5.7.1/video-js.css" rel="stylesheet">
</head>
<body>
    <video class="video-js" controls="" data-setup="{}" height="264" id=
    "my-video" poster="MY_VIDEO_POSTER.jpg" preload="auto" width=
    "640"><source src=
    "http://184.72.239.149/vod/smil:BigBuckBunny.smil/playlist.m3u8" type=
    "application/x-mpegURL">
    <p class="vjs-no-js">To view this video please enable JavaScript, and
    consider upgrading to a web browser that <a href=
    "http://videojs.com/html5-video-support/" target="_blank">supports HTML5
    video</a></p></video> 

    <script src="http://vjs.zencdn.net/5.7.1/video.js"></script> 
    <script src="http://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
    <script src="/static/videojs-hls.min.js"></script> 
    <script>
            var player = videojs('my-video');
            player.play();
    </script>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

我刚用Apple的MediaStreamValidator检查了它,似乎是这样,流中存在一些不连续性。有些玩家可以解决这些问题,例如Bitmovin's player,但无论如何我会建议检查流设置。