jPlayer可以在IE中工作

时间:2016-10-20 15:14:12

标签: javascript http internet-explorer jplayer http-content-range

我有一个问题。经过一些调查后我确定这是因为TimeRangers对象在IE的情况下为空,并且在Chrome/FF/etc中已满。

首先,我发现IE不会发送Range请求,而FF / Chrome则会发送Content-Disposition请求。

其次,我发现IE不接受没有Accept-Range标题的文件。

我修复了两个问题(我添加了内容处理,并且始终包括$('#jquery_jplayer') .jPlayer({ cssSelectorAncestor: "#jp_container", supplied: 'mp3', solution: 'html', useStateClassSkin: true, autoBlur: false, smoothPlayBar: true, keyEnabled: true, remainingDuration: true, toggleDuration: true, wmode: "window" }); 标题,客户端是IE),但音频仍无效。

这是JS:

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

Chrome请求/回复:

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

IE:

 SELECT [ID], [First name], [Middle Name], [Surname], NULL as [NI]
 FROM Table1
 UNION ALL
 SELECT [ID], [First name], NULL as [Middle Name], [Surname], [NI]
 FROM Table2

两种情况下的响应都相同,但它适用于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

1 个答案:

答案 0 :(得分:0)

答案是该文件已损坏。其他浏览器正在修改它,但IE只是一个放弃而根本不播放文件的人。因此,如果您遇到相同的问题,请先检查该文件是否有效。