VideoJS:DashJS和HLS不能一起工作

时间:2015-06-26 04:35:44

标签: javascript video.js hls dash.js

dash.js导致基于VideoJS闪存的HLS技术失败。它们都能很好地独立工作,并且注释掉dash.js引用可以使HLS工作。 控制台中未显示任何错误消息,但视频无法播放。我正在使用Chrome 43。

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Sample Video Player</title>
    </style>

    <link href="/stable/dist/video-js.css" rel="stylesheet">
    <script src="/stable/dist/video.js"></script>

    <script src="/stable/dist/videojs-media-sources.js"></script>
    <script src="/stable/dist/videojs.hls.js"></script>

    <script src="/stable/dist/dash.js"></script>
    <script src="/stable/dist/videojs-tech-dashjs.js"></script>
</head>

<body align="center">
    <div align="center" style="margin-top:20px;">
        <video id="vid1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264" data-setup='{"techOrder": ["hls", "dashjs", "html5"], "nativeControlsForTouch": false}'>
                <source src="http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd" type='application/dash+xml'>
                <source src="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8" type='application/x-mpegURL'>
                <source src="http://techslides.com/demos/sample-videos/small.mp4" type='video/mp4'>
                <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>
            // Initalize the video.js player
            var myPlayer = videojs('vid1');
        </script>
    </div>
</body>
</html>

0 个答案:

没有答案