我的页面中有一个音频标签,如下所示:
audioPlayerHolder.setHtml('<audio controls="controls" autoplay preload="auto"> Your browser does not support the <code>audio</code> element. <source src="' + key + '&t=ogg" type="audio/ogg"><source src="' + key + '&t=mp3" type="audio/mp3"></audio>');
它在firefox,opera,IE中运行良好 当文件持续时间少于1-2分钟时,它可以使用精细的铬或铬。 当持续时间超过1-2分钟时,它不能用于铬或铬。 Chrome播放文件几秒钟,然后滚动到结尾并停止。
当Chrome尝试使用部分内容请求时,我发现问题就出现了。
我设置了正确响应的php脚本,因为我认为部分内容请求,但问题仍然存在。
这是请求和回复:
1.1
GET /php/getsound.php?fn=5c&foo=uvoxm&t=ogg HTTP/1.1
Host: ******
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Accept: */*
Referer: https://******/
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: PHPSESSID=gbb1quhuio31v544urdar26fb1
X-Compress: null
Range: bytes=0-
1.2
HTTP/1.1 206 Partial Content
Server: nginx/1.10.2
Date: Tue, 18 Jul 2017 10:33:07 GMT
Content-Type: application/octet-stream
Content-Length: 599279
Connection: keep-alive
X-Powered-By: PHP/5.6.30
Cache-Control: public, must-revalidate, max-age=0
Pragma: no-cache
Accept-Ranges: bytes
Content-Range: bytes 0-599278/599279
Content-Disposition: inline; filename=sound.ogg
Content-Transfer-Encoding: binary
Expires: Thu, 19 Nov 2020 08:52:00 GMT
Strict-Transport-Security: max-age=31536000;
2.1
GET /php/getsound.php?fn=5c&foo=uvoxm&t=ogg HTTP/1.1
Host: ******
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Accept: */*
Referer: https://******/
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: PHPSESSID=gbb1quhuio31v544urdar26fb1
X-Compress: null
Range: bytes=524288-
2.2
HTTP/1.1 206 Partial Content
Server: nginx/1.10.2
Date: Tue, 18 Jul 2017 10:33:08 GMT
Content-Type: application/octet-stream
Content-Length: 74991
Connection: keep-alive
X-Powered-By: PHP/5.6.30
Cache-Control: public, must-revalidate, max-age=0
Pragma: no-cache
Accept-Ranges: bytes
Content-Range: bytes 524288-599278/599279
Content-Disposition: inline; filename=sound.ogg
Content-Transfer-Encoding: binary
Expires: Thu, 19 Nov 2020 08:52:00 GMT
Strict-Transport-Security: max-age=31536000;
3.1
GET /php/getsound.php?fn=5c&foo=uvoxm&t=ogg HTTP/1.1
Host: ******
Connection: keep-alive
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Accept: */*
Referer: https://******/
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: PHPSESSID=gbb1quhuio31v544urdar26fb1
X-Compress: null
Range: bytes=32768-
3.2
HTTP/1.1 206 Partial Content
Server: nginx/1.10.2
Date: Tue, 18 Jul 2017 10:33:11 GMT
Content-Type: application/octet-stream
Content-Length: 566511
Connection: keep-alive
X-Powered-By: PHP/5.6.30
Cache-Control: public, must-revalidate, max-age=0
Pragma: no-cache
Accept-Ranges: bytes
Content-Range: bytes 32768-599278/599279
Content-Disposition: inline; filename=sound.ogg
Content-Transfer-Encoding: binary
Expires: Thu, 19 Nov 2020 08:52:00 GMT
Strict-Transport-Security: max-age=31536000;
我认为,问题出在我的服务器端php脚本中,它会发送错误的标题,但无法找到错误的内容。