HTTP GET范围(部分内容)

时间:2014-04-01 13:42:38

标签: http google-chrome range

我的服务器可以发送所有文件和部分文件。

问题文件的示例。

<pre>
http://scir.bz/z/GOOD%20TO%20GREAT.mp3
</pre>

所以,mozilla可以播放这些音频文件,当我们在时间轴上移动时,mozilla会从中间播放它。 但谷歌Chrome无法做到这一点。我无法理解,为什么?

示例http对话

mozilla - 服务器

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1

HTTP/1.1 200 OK
Content-Type: audio/mp3
Content-Length: 489986541
Last-Modified: Thu, 06 Mar 2014 18:02:55 GMT
Etag: "55a3ee720b5551b7fbb0b28318576ae9c9deb1cc1394128975"
Accept-Ranges: bytes

- 跳中间

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1
Range: bytes=195002368-


HTTP/1.1 206 Partial Content
Content-Range: bytes 195002368-489986540/489986541

- 我可以继续收听文件

铬 - 服务器

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1

HTTP/1.1 200 OK
Content-Type: audio/mp3
Content-Length: 489986541
Last-Modified: Thu, 06 Mar 2014 18:02:55 GMT
Etag: "55a3ee720b5551b7fbb0b28318576ae9c9deb1cc1394128975"
Accept-Ranges: bytes

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1
Range: bytes=0-


HTTP/1.1 206 Partial Content
Content-Range: bytes 0-489986540/489986541

- 跳到中间的

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1
Range:bytes=333119449-489986540

HTTP/1.1 206 Partial Content
Content-Range: bytes 333119449-489986540/489986541

chrome取消了它并尝试

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1
Range:bytes=333119448-489986540

HTTP/1.1 206 Partial Content
Content-Range: bytes 333119448-489986540/489986541

然而

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1
Range:bytes=333119447-489986540

HTTP/1.1 206 Partial Content
Content-Range: bytes 333119447-489986540/489986541

然而

GET /z/GOOD%20TO%20GREAT.mp3 HTTP/1.1
Range:bytes=333119446-489986540

HTTP/1.1 206 Partial Content
Content-Range: bytes 333119446-489986540/489986541

PS fiddler在http

中没有显示错误

1 个答案:

答案 0 :(得分:0)

也许这会有所帮助:Chrome won't play mp3 files?

提出的解决方案是:

  

找到了一个解决方案:我将apache降级到2.2.17 - 突然间事情开始起作用了。不知道为什么,但是新版apache中的某些内容可能会在chrome上出现mp3播放错误。