I want to use a simple HTML5 audio tag in my react application. My component looks like this:
import React from 'react'
class AudioPlayer extends React.Component {
render() {
return (
<div>
<audio ref="audio_tag" src="./static/music/foo.mp3" controls autoPlay/>
</div>
);
}
}
export default AudioPlayer;
but it just won't play. I also don't get any errors. I have put the mp3 file in every single folder in my app now, and tried different paths etc. but it just does not seem to recognise it. Am I missing something trivial maybe?
Uncaught (in promise) DOMException: The element has no supported sources.
– George Welder