HTML5 tag in React
I want to use a simple HTML5 tag in my react app. 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 he just won't play. I also have no errors. I put the mp3 file in every separate folder in my application and tried different paths etc. but it doesn't seem to recognize it. Maybe I missed something trivial?
+3
source to share