Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pause(): void {
this.state = YouTube.PlayerState.PAUSED;
this.pauseDispatcher.dispatch();
}
onStateChange(event) {
if (this.target !== event.target) {
this.target = event.target
this.target.setVolume(100)
this.target.setPlaybackQuality('small')
}
if (event.data === Youtube.PlayerState.PLAYING) {
this.props.onLoad()
}
}
play(): void {
this.state = YouTube.PlayerState.PLAYING;
this.playDispatcher.dispatch();
}
componentDidMount() {
this.setState({ mounted: true });
YouTube = require('react-youtube').default;
}