How to use the react-player/lib/players/SoundCloud.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 activePlayer() {
    if (YoutubePlayer.canPlay(this.url)) {
      return this.youtubePlayer
    } else if (SoundcloudPlayer.canPlay(this.url)) {
      return this.soundcloudPlayer
    }
  }
  onSeekChange = value => this.setState({played: value})
github xouabita / friends-radio / src / client / components / Player.js View on Github external
get soundcloudProps() {
    if (SoundcloudPlayer.canPlay(this.url)) {
      return this.activeProps
    } else {
      return {
        url: "https://soundcloud.com/miami-nights-1984/accelerated",
        playing: false,
      }
    }
  }

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 7 months ago

Package Health Score

89 / 100
Full package analysis