Actually, I was able to get Trevor's code working just fine in my project. I did have to add a closing tag to the source element, like so.
<video id="background-video" loop autoPlay>
<source src="http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4" />
<source src="http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/ogg" />
Your browser does not support the video tag.
</video>
Also, note that 'autoplay' should be changed to 'autoPlay' or React will throw a warning at you and not auto play the video. Outside of those two changes, copying and pasting the code should work just fine.
ES6/Babel example:
'use strict';
import React, {Component} from 'react';
class Example extends Component {
constructor (props) {
super(props);
this.state = {
videoURL: 'http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4'
}
}
render () {
return (
<video id="background-video" loop autoPlay>
<source src={this.state.videoURL} type="video/mp4" />
<source src={this.state.videoURL} type="video/ogg" />
Your browser does not support the video tag.
</video>
)
}
};
export default Example;