Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught (in promise) DOMException: The element has no supported sources [closed]

Using music-frequency-d3 for audio visualization in my AngularJs application, created a bower component for this using music-frequency-d3, but when I insert the web address of my audio as src attribute's value it shows the error below.

Uncaught (in promise) DOMException: The element has no supported sources

what is the problem here? how can I play the audio using the web address URL?

Thank You

like image 271
Sabreena Avatar asked Sep 26 '16 07:09

Sabreena


1 Answers

Its the cors access restriction issue

add

crossOrigin="anonymous"

inside your audio tag

<audio media-player="audioPlayer" autoplay controls="controls" preload="auto" id="audioElement"
                crossOrigin="anonymous" src="{{audio}}"></audio>
like image 64
Sabreena Avatar answered Oct 23 '22 03:10

Sabreena