[英]Mpeg-dash support in nginx
我搜索了足够多,但无法弄清楚如何使用 nginx_vod_module 在 nginx 中配置 mpeg-dash vod。
用于启用破折号的 http 服务器块内的配置是
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 。 我只将 Input.mp4 放在破折号位置。 我怎样才能流式传输破折号内容。还有什么东西像在 nginx 中为 mpeg 破折号流式传输预先创建的清单和块?
我在服务器上具有相同的配置,并使用以下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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.