Does HTML5 audio tag support serving mp3s from another domain?

前端 未结 4 1288
误落风尘
误落风尘 2020-12-18 23:54

So I am having a web application with domian \"www.example.com\" that needs to serve audio from \"www.example2.com\", but for some reason this is not working (the audio just

相关标签:
4条回答
  • 2020-12-19 00:17

    FF and Chrome do not support it, but the IE11 do.

    I think W3C should have an solution about cross domain, after all it is a completely reasonable request.

    0 讨论(0)
  • 2020-12-19 00:18

    I think HTML5 does not allow you to take a source from another hosting provider / server. Maybe it's limited to your domain but I'm not 100% sure... I do remind that there was a little limitation about this html5 element...

    0 讨论(0)
  • 2020-12-19 00:18

    You would need to do some tests but I reckon that it does work, but you may have difficulties with certain actions and queries

    Example, you may be able to start/pause/stop but not check the title or the length since that could be a form of XSS

    0 讨论(0)
  • 2020-12-19 00:22

    Apparently I cannot vote up CyberK's response (don't have the reputation yet to do so) but I agree with him. You cannot do <audio> or <video> cross-domain. I have tried this exact thing on both Chrome and Firefox. There are more than a couple of articles about this. Finding this out for myself today; not happy with the restriction.

    http://www.bluishcoder.co.nz/2008/11/video-audio-and-cross-domain-usage.html

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