javascript - 未捕获( promise )DOMException : The element has no supported sources

标签 javascript angularjs audio d3.js

关闭。这个问题需要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/

相关文章:

angularjs - Cucumber.js 测试不依赖任何网络浏览器( headless 或真正的网络浏览器)

javascript - Angular IE9 文件上传不工作

javascript - 响应语音 : Showing a Div After Detecting End of Audio to be Played

javascript - RxJS - 对 maxWait 和 maxElements 窗口使用 windowWhen()

javascript - 在 Javascript 中停止嵌套超时

javascript - 尝试使用 jQuery 从文本框中删除非数字字符

javascript - 使用 html、css 和 javascript 的动态菜单

python - 带有 Angular 的 flask : POST form is empty

iphone - 如何在Objective C中为iPhone应用程序设置值?

audio - ffmpeg:生成空的音频和视频(为视频工作)