MEDIA_ERR_SRC_NOT_SUPPORTED html5 audio woes

前端 未结 2 885
渐次进展
渐次进展 2021-01-11 12:56

I am working on an html5 audio player and everything is working fine when I server the .ogg file from the same host as the html page. When I put the ogg file in my cdn it fa

相关标签:
2条回答
  • 2021-01-11 13:30

    The Content-Type=octet/stream header is the problem, although if I'm reading the spec correctly, it shouldn't be. Here's a testcase: http://mozilla.doslash.org/stuff/video-test/video.html

    I filed a bug in Mozilla's bugzilla about this. [edit] the response:

    We don't do any content sniffing to work out what the content is - we rely on the correct mime type being provided. This is why application/octet-stream does not play and way we return "" for canPlayType.

    0 讨论(0)
  • 2021-01-11 13:31

    The problem is the mime type you are serving the audio file with. It needs to be 'audio/ogg', 'application/ogg' or 'video/ogg' for Firefox to play it. Firefox doesn't do any form of 'content sniffing' to work out what format the file is in - it relies entirely on the mime type.

    0 讨论(0)
提交回复
热议问题