mp3发送OK,但mp4没有(Django& X-Sendfile)

时间:2012-04-28 20:29:08

标签: django mp3 mp4 x-sendfile

点击我的网页上的播放,从服务器发送一个mp3文件,在浏览器中只看到发送的3个请求。我添加到响应X-Sendfile头,响应没有它到达所以我理解mod_xsendfile配置好了。

奇怪的是,当我点击 mp4 上的播放时,浏览器会开始发送数百个的请求,电影会启动并卡住!这里的回复中没有“X-Sendfile”标题......

如果我将cideo元素中的来源更改为其他网站的某个mp4文件 - 一切正常(电影运行顺畅,只有少数请求)。

有什么问题?

一些代码......

HTML:

<video id="videoId" preload="none" controls="controls" width="300px" height="286px" src="url/of/file.mp4">
    Sorry, unable to play video.
</video>

htaccess的:

<filesMatch "\.(mp3|ogg|mp4)$">
    XSendFile on
</filesMatch>

响应标题:( mp4)

Accept-Ranges:bytes
Connection:Keep-Alive
Content-Disposition:filename=fileName.mp4
Content-Length:1392497
Content-Range:bytes 8382477-9774973/9774974
Content-Type:video/mp4
Date:Sat, 28 Apr 2012 20:27:07 GMT
Keep-Alive:timeout=5, max=100
Last-Modified:Sat, 14 Apr 2012 12:47:10 GMT
Server:Apache

1 个答案:

答案 0 :(得分:2)

问题是...... MP4文件的编码!