How to use the react-player/lib/players/YouTube.canPlay 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 xouabita / friends-radio / src / client / components / Player.js View on Github external
get youtubeProps() {
    if (YoutubePlayer.canPlay(this.url)) {
      return this.activeProps
    } else {
      return {
        url: "https://youtu.be/RxljKS5rc7w",
        volume: 0,
        playing: true,
      }
    }
  }
github xouabita / friends-radio / src / client / components / Player.js View on Github external
get activePlayer() {
    if (YoutubePlayer.canPlay(this.url)) {
      return this.youtubePlayer
    } else if (SoundcloudPlayer.canPlay(this.url)) {
      return this.soundcloudPlayer
    }
  }
  onSeekChange = value => this.setState({played: value})

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