DOMException Failed to load because no supported source was found

DOMJavascriptWeb DevelopmentFront End Scripts

It can be a Cross-Origin Resource Sharing (CORS) issue.

video.crossOrigin = 'anonymous';

To enable cross-origin resource sharing, use the following. It allows the images to pass the HTTP header with an image response.

Access-Control-Allow-Origin: *

You can also use the HTML() method −

$('#audio').html('<audio autoplay><source src="demo.mp3"></audio>');
raja
Published on 06-Apr-2018 09:08:08
Advertisements