use*_*042 4 html javascript azure video-streaming mpeg-dash
我对 MPEG-DASH 自适应流媒体完全陌生。我正在尝试在浏览器中创建一个视频播放器dash.js。我参考了一些有用的MPEG-DASH Adaptive Streaming文档。这些链接是
通过上述文档,我创建了一个示例 HTML 文件。
<!DOCTYPE html>
<html>
<head>
<title>Adaptive Streaming in HTML5</title>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<h1>Adaptive Streaming with HTML5</h1>
<video id="videoplayer" controls></video>
<div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- DASH-AVC/265 reference implementation -->
<script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>
<script>
<!--setup the video element and attach it to the Dash player-->
(function(){
var url = "https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd";
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);
})();
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
但运行 和 后chrome (Version 63.0.3239.132 (Official Build) (64-bit)),mozilla (version 57.0 (64-bit))我看不到该播放器中播放任何视频。这是输出截图
我正在尝试在我的浏览器上本地运行。会产生什么问题吗?单击播放按钮后,我看不到任何视频。在Mozilla浏览器中我可以看到以下内容
[dash.js 2.6.4] MediaPlayer has been initialized
The character encoding of the HTML document was not declared.
The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range.
The character encoding of the page must be declared in the document or in the transfer protocol.
Run Code Online (Sandbox Code Playgroud)
但脚本https://cdn.dashjs.org/latest/dash.all.min.js也工作正常。另外,当我在https://reference.dashif.org/dash.js/1.4.0/samples/dash-if-reference-player/index.htmlhttps://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd视频播放器中添加 URL时,它工作正常。
实际上我在这里缺少什么?有什么建议或帮助吗?
HTML 文档中的属性值区分大小写。
因此,如果您将<video>元素更改为:
<video id="videoPlayer" controls></video>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6398 次 |
| 最近记录: |