HTML5音频标签是否支持从另一个域提供mp3? [英] Does HTML5 audio tag support serving mp3s from another domain?

查看:85
本文介绍了HTML5音频标签是否支持从另一个域提供mp3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个web应用程序domianwww.example.com,需要提供来自www.example2.com的音频,但由于某种原因,这不工作(音频只是不流) / p>

< audio src =http://www.example2.com/song.mp3控制预加载>< / audio& code>



考虑到如果我把声源url直接放入浏览器音频将可用



有人试过这个吗?感谢



Wa'el

解决方案

显然我不能投票Cyber​​K's反应(没有声誉还没有这样做),但我同意他。您不能做跨域的< audio> < video> 我已经尝试这个确切的事情在Chrome和Firefox。有关于这个的两个以上的文章。今天为自己找到这个;不满意限制。



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


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 does not stream)

<audio src="http://www.example2.com/song.mp3" controls preload></audio>

Given that if I put the sound source url directly into the browser the audio will be available

Anyone tried this? thanks

Wa'el

解决方案

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

这篇关于HTML5音频标签是否支持从另一个域提供mp3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆