Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { PureComponent } from 'react';
import ReactPlayer from 'react-player';
import { UIEvents } from '@shopgate/pwa-core';
import { UI_VISIBILITY_CHANGE } from '@shopgate/pwa-common/constants/ui';
/**
* Video player component
* @param {Object} props props
* @returns {JSX}
*/
class VideoPlayer extends PureComponent {
static propTypes = ReactPlayer.propTypes
static defaultProps = ReactPlayer.defaultProps
state = {
ready: false,
playing: this.props.playing,
userPaused: false,
}
/**
* @inheritDoc
*/
componentDidMount() {
UIEvents.addListener(UI_VISIBILITY_CHANGE, this.handleVisibilityChange);
}