的HLS链接不会在Android铬直接工作,你需要一个HLS JavaScript库得到它的工作,看看这个代码
<video id="my-video" style="width:640px height:480px;" controls>
<source src="{put your source link here}">
</video>
</div>
<script src="http://hlsbook.net/wp-content/examples/hls.min.js"></script>
<script>
if (Hls.isSupported()) {
var video = document.getElementById('my-video');
var hls = new Hls();
hls.loadSource('{put your source link here}');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
video.play();
});
}
</script>
,并记住源链接不会在Android平台上工作,它仅适用于ios-safari平台,因为ios-safari平台不需要hls javascript,因为Safari移动不支持媒体源扩展,因此不适用于hls.js. 因此,对于android,您需要在hls.loadSource中的脚本标记中添加视频链接,它将在android chrome上工作。
此:https://shaka-player-demo.appspot.com/demo/#asset=//storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd;lang=en-美国似乎现在运作良好,也许5.0+? – rogerdpack