我找了很久,但还是搞不清楚如何使用nginx_vod_module在nginx中配置mpeg-dash视频点播。
http服务器块中用于启用dash的配置为
location /voddash {
vod dash;
vod_mode local;
root /usr/share/nginx/html;
gzip on;
gzip_types application/dash+xml mpd;
add_header Access-Control-Allow-Headers "origin,range,accept-encoding,referer";
add_header Access-Control-Expose-Headers "Server,range,Content-Length,Content-Range";
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
add_header Access-Control-Allow-Origin "*";
expires 100d;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
}请求url为http://localhost/voddash/Input.mp4/manifest.mpd。我只在dash位置放置了Input.mp4。如何流式传输dash内容.Also在nginx中是否存在类似于mpeg dash的预先创建的清单和块的流式传输?
发布于 2016-04-29 03:04:50
我在我的服务器上有相同的配置,并使用以下html + js代码播放动态生成的manifest.mpd文件:
<!doctype html>
<html>
<head>
<title>Dash.js Rocks</title>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video id="videoPlayer" controls></video>
</div>
<script src="http://dashif.org/reference/players/javascript/nightly/dash.js/dist/dash.all.min.js"></script>
<script>
(function(){
var url = "http://localhost/voddash/Input.mp4/manifest.mpd";
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);
})();
</script>
</body>
</html>https://stackoverflow.com/questions/33254236
复制相似问题