以下是我用C语言制作的Web服务器与Internet Explorer之间的通信。除了音频文件之外,一切都已提供。关于为什么只有音频永远不会被提供的任何见解?
GET /castle/media/witchwoode.m4a HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept: */*
Referer: http://127.0.0.1:6006/castle/index.html
GetContentFeatures.DLNA.ORG: 1
Pragma: getIfoFileURI.dlna.org
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Host: 127.0.0.1:6006
Connection: Keep-Alive
HTTP/1.1 200 OK
Server: web
Content-Length: 3017451
Connection: close
Content-Type: audio/mp4
最佳答案
如果我从 techslides 下载示例 m4a 文件我收到以下回复:
HTTP/1.1 200 OK
Server: nginx/1.4.1 (Ubuntu)
Date: Sat, 25 Jun 2016 02:35:31 GMT
Content-Type: audio/mpeg
Content-Length: 34535
Last-Modified: Sun, 16 Feb 2014 18:49:36 GMT
Connection: keep-alive
ETag: "53010840-86e7"
Accept-Ranges: bytes
如您所见:不同的内容类型和连接。
顺便说一句:Firefox 说文件已损坏,但具有上述地址的 Chrome 和具有下载文件的独立播放器 (mplayer) 都可以正常工作,因此在您处理代码之前,请尝试更改协议(protocol)。
关于c - Web 服务器未向每个浏览器提供音频文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38023779/