How to use the react-player.defaultProps function in react-player

To help you get started, we’ve selected a few react-player examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shopgate / pwa / libraries / engage / components / VideoPlayer / index.jsx View on Github external
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);
  }

  /**
   * @inheritDoc

react-player

A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion

MIT
Latest version published 9 months ago

Package Health Score

88 / 100
Full package analysis