我有一个主题问题。经过一番调查,我确定这是因为TimeRangers
对象在 IE 案例中为空,而在Chrome/FF/etc
.
首先,我发现 IE 不发送Range
请求,而 FF/Chrome 可以。
其次,我发现 IE 不接受没有Content-Disposition
标题的文件。
我修复了这两个问题(我添加了内容处置并始终包括Accept-Range
标题是客户端是 IE),但音频仍然无法正常工作。
这是JS:
$('#jquery_jplayer')
.jPlayer({
cssSelectorAncestor: "#jp_container",
supplied: 'mp3',
solution: 'html',
useStateClassSkin: true,
autoBlur: false,
smoothPlayBar: true,
keyEnabled: true,
remainingDuration: true,
toggleDuration: true,
wmode: "window"
});
Chrome 请求/响应:
Host: localhost:8080
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36
Accept: */*
Referer: http://localhost:8080/Object?objectId=299a1dee-8d2a-4225-8c19-0d8ff73920e2
Accept-Language: ru,en-US;q=0.8,en;q=0.6
Range: bytes=0-
HTTP/1.1 206 Partial Content
Date: Thu, 20 Oct 2016 15:09:02 GMT
Content-Length: 322450
Content-Type: application/octet-stream
Content-Range: bytes 0-322449/322450
Server: Kestrel
Content-Disposition: attachment; filename=file.mp3; filename*=UTF-8''file.mp3
IE:
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US, en; q=0.7, ru; q=0.3
Cache-Control: no-cache
Connection: Keep-Alive
GetContentFeatures.DLNA.ORG: 1
Host: localhost:8080
Referer: http://localhost:8080/Object?objectId=299a1dee-8d2a-4225-8c19-0d8ff73920e2
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
Content-Disposition: attachment; filename="file.mp3"; filename*=UTF-8''file.mp3
Content-Length: 322450
Content-Range: bytes 0-322449/322450
Content-Type: application/octet-stream
Date: Thu, 20 Oct 2016 14:56:08 GMT
Server: Kestrel
两种情况下的响应是相同的,但它适用于 Chrome/FF 而不适用于 IE。
我错过了什么吗?我配置了 jPlayer、服务器、标头、所有内容……但仍然无法在 IE 中播放音频。
在 Windows 10 IE11、Chrome 54 下测试
经过测试 - 使用以下 MP3:http: //jplayer.org/audio/mp3/Miaow-07-Bubble.mp3
但不关注 MP3:http ://www.filedropper.com/file_259