【发布时间】:2010-02-14 06:24:23
【问题描述】:
我正在开发一个 html5 音频播放器,当我从与 html 页面相同的主机提供 .ogg 文件时,一切正常。当我将 ogg 文件放入我的 cdn 时,它失败并且错误代码是 MEDIA_ERR_SRC_NOT_SUPPORTED
例如,这很好用
<audio src="/song.ogg" id="player">
Your browser does not support the <code>audio</code> element.
</audio>
但是上面的错误代码失败了
<audio src="http://mycdn.com/song.ogg" id="player">
Your browser does not support the <code>audio</code> element.
</audio>
失败的音频文件的标题看起来像这样(这是来自表现相同行为的不同 ogg 文件)
HTTP/1.1 200 OK
Server: CacheFlyServe v26b
Date: Sat, 13 Feb 2010 21:10:48 GMT
Content-Type: application/octet-stream
Connection: close
ETag: "c6ee7d86e808cc44bbd74a8db94a5aae"
X-CF1: fA.syd1:cf:cacheD.syd1-01
Content-Length: 2398477
Last-Modified: Sat, 13 Feb 2010 20:50:56 GMT
Accept-Ranges: bytes
X-Cache: MISS from deliveryD-syd1
【问题讨论】:
-
我想不出一个解释这个的想法(你可以看到whatwg.org/specs/web-apps/current-work/multipage/video.html列举的可能原因)。如果您说明您使用的浏览器的版本,列出标题,或者更好的是,甚至为测试用例提供真实的 URL,这会更容易。