关闭。这个问题需要debugging details .它目前不接受答案。
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将帮助其他人回答问题。
4年前关闭。
Improve this question
在我的 AngularJs 应用程序中使用 music-frequency-d3 进行音频可视化,为此使用 music-frequency-d3 创建了一个凉亭组件,
但是当我将音频的网址作为 src 属性的值插入时,它会显示以下错误。
Uncaught (in promise) DOMException: The element has no supported sources
这里有什么问题?如何使用网址 URL 播放音频?
谢谢你
最佳答案
它的cors访问限制问题
添加
crossOrigin="anonymous"
在您的音频标签内
<audio media-player="audioPlayer" autoplay controls="controls" preload="auto" id="audioElement"
crossOrigin="anonymous" src="{{audio}}"></audio>
关于javascript - 未捕获( promise )DOMException : The element has no supported sources,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39696915/