Skip to content

Instantly share code, notes, and snippets.

@fforres
Created May 9, 2017 21:15
Show Gist options
  • Select an option

  • Save fforres/2cae707be1025132e4082bd7ad7f56b9 to your computer and use it in GitHub Desktop.

Select an option

Save fforres/2cae707be1025132e4082bd7ad7f56b9 to your computer and use it in GitHub Desktop.
class Video extends React.Component {
static defaultProps = {
autoPlay: false,
maxLoops: 10,
}
static propTypes = {
autoPlay: React.PropTypes.bool.isRequired,
maxLoops: React.PropTypes.number.isRequired,
posterFrameSrc: React.PropTypes.string.isRequired,
videoSrc: React.PropTypes.string.isRequired,
}
state = {
loopsRemaining: this.props.maxLoops,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment