All Projects → ryanhefner → react-video-players

ryanhefner / react-video-players

Licence: MIT License
📺 Library of React video player components that offer a consistent interface and callback system for Vimeo, YouTube and the <video> tag. Along with a handy higher order component for building your own 😉

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-video-players

Android-VimeoPlayer
Unofficial Vimeo video player library for Android.
Stars: ✭ 46 (+253.85%)
Mutual labels:  vimeo, video-player, vimeo-player
Youtube player flutter
Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API. Supports both Android and iOS platforms.
Stars: ✭ 366 (+2715.38%)
Mutual labels:  video-player, youtube-player
angular-youtube-player
Simple youtube player created with angular and typescript. See demo.
Stars: ✭ 35 (+169.23%)
Mutual labels:  video-player, youtube-player
Ngx Youtube Player
YouTube player app built with Angular 7
Stars: ✭ 92 (+607.69%)
Mutual labels:  video-player, youtube-player
Video React
A web video player built for the HTML5 world using React library.
Stars: ✭ 2,227 (+17030.77%)
Mutual labels:  video-player, react-component
react-native-vimeo-iframe
No description or website provided.
Stars: ✭ 17 (+30.77%)
Mutual labels:  vimeo, video-player
Ng Youtube Embed
AngularJS module to embed Youtube videos with support for Youtube player parameters and JavaScript API for iframe embeds. Superlight (less than 5KB) and easy to use! Supports Youtube video URLs and IDs. No 3rd party JS dependencies.
Stars: ✭ 137 (+953.85%)
Mutual labels:  video-player, youtube-player
Unity Videoplayer Helper
Simple helper for the Video Player in Unity
Stars: ✭ 49 (+276.92%)
Mutual labels:  vimeo, video-player
dokuwiki-plugin-vshare
Plugin to easily embed videos from various video sharing sites into DokuWiki
Stars: ✭ 15 (+15.38%)
Mutual labels:  vimeo, video-player
advanced-responsive-video-embedder
Probably the the best WP plugin for embedding videos.
Stars: ✭ 32 (+146.15%)
Mutual labels:  vimeo
v-clappr
👏🏻Vue.js wrapper for Clappr media player
Stars: ✭ 18 (+38.46%)
Mutual labels:  video-player
markdown-navbar
Best markdown navigation bar for React.
Stars: ✭ 122 (+838.46%)
Mutual labels:  react-component
syncwatch
Browser extension to watch videos together
Stars: ✭ 48 (+269.23%)
Mutual labels:  video-player
vue-visual
Vue 2 image and video loader supporting lazy loading, background videos, fixed aspect ratios, low rez poster images, transitions, loaders, slotted content and more.
Stars: ✭ 56 (+330.77%)
Mutual labels:  video-player
react-native-nested-listview
A UI component for React Native for representing nested arrays of N levels
Stars: ✭ 163 (+1153.85%)
Mutual labels:  react-component
KTVideoMonitor
📹KTVideoMonitor视频监控Demo-基于ijkPlayer的网络播放器,支持HTTP、RTMP、HLS(m3u8)、本地视频等多种格式
Stars: ✭ 22 (+69.23%)
Mutual labels:  video-player
react-fake-component
Chuck Norris faking components
Stars: ✭ 24 (+84.62%)
Mutual labels:  react-component
react-instagram-authless-feed
React component to provide a token-less Instagram feed.
Stars: ✭ 50 (+284.62%)
Mutual labels:  react-component
react-nft-gallery
🖼️ React component to display your NFTs as a gallery
Stars: ✭ 50 (+284.62%)
Mutual labels:  react-component
shortcut-preview
A React component to preview iOS Shortcuts
Stars: ✭ 20 (+53.85%)
Mutual labels:  react-component

react-video-players

A library of React video player components that share a similar interface and makes it easy to work with various video platforms (Vimeo, YouTube, etc.) and players, consistently in your site or application.

Install

Via npm:

npm install --save react-video-players

Via Yarn:

yarn add react-video-players

Video Players

The goal of this library is to offer a variety of different player "types", while maintaining a similar/common interface across each component. Currently, there are three video player components available: VimeoPlayer, YouTubePlayer and VideoPlayer (standard <video> tag implemenation).

In addition to the three components, this library also include the High Order Component that the three players use, in the event you’d like to use that to build your own video player component.

Common Properties

  • aspectRatio:String - Used to calculate aspect ratio for the container so that video is displayed responsively.
  • config:Object - Optional config settings. See VimeoPlayer Props or YouTubePlayer Props
  • controls:Element - A React component that contains controls setup to control the video. See Player Controls
  • height:Number || String - Height of the player. Default 100%.
  • loop:Boolean - Whether or not the video should loop playback. Default false.
  • play:Boolean - Whether or not the video should play on load. Default false.
  • time:Number - Time to play when the player loads, or seek time if the player is already loaded. Default 0.
  • width:Number || String - Width of the player. Default 100%.

Callbacks

  • onEnded:Function - Callback when video playback has ended.
  • onError:Function - Callback when an error occurs within the player.
  • onPause:Function - Callback when video player is paused.
  • onPlay:Function - Callback when video player is played.
  • onReady:Function - Callback when video player is ready.
  • onTimeUpdate:Function - Callback when video player time updates.

Player Components

VimeoPlayer

The VimeoPlayer component is a simple React wrapper around the standard Vimeo Player embed. For more informatin on how to work with the Vimeo Player directly, check out this repo, @vimeo/player.js, for more info and examples.

The VimeoPlayer component offers limited control of the player via the props on the component: loop, play, time and volume. I’m open to adding more access to some of the other methods available on the player via props, but to keep it simple I’ve started with these four.

Props
  • config:Object - Options that are passed to the player on setup, Available embedOptions.
  • videoId:Number - ID of the Vimeo video you'd like to load in the player.
Example
import {VimeoPlayer} from 'react-video-players';

...

  render() {
    return (
      <div>
        <VimeoPlayer videoId="225408543" />
      </div>
    );
  }

...

YouTubePlayer

Similar to the VimeoPlayer component, the YouTubePlayer component is a simple React wrapper around the YouTube Player, allowing for basic control and configuration, allowing you to use it how you want within your React sites/applications.

Props
  • config:Object - The config object is mapped to the playerVars property used when creating the player. Available playerVars.
  • playlist:String - An optional value that can be set when you would like to load a playlist into the player. This property is also set to the videoId when the loop flag has been set on the player (which is required for the YouTube Player to loop the video).
  • videoId:String - String to the YouTube video ID you would like to load in the player.
Example
import {YouTubePlayer} from 'react-video-players';

...

  render() {
    return (
      <div>
        <YouTubePlayer videoId="8gXpZmQ7j70" />
      </div>
    );
  }

...

VideoPlayer

Just your plain ole’ <video> tag, wrapped in a similar interface to the other platform specific players. You could use this as is if you have direct access to video urls, or use it as a base for a more complex video player that you’re building in React.

Props
  • config:Object - An object containing the additional attributes that are available for the <video> tag, but are not exposed via other props. (Ex. controls, poster, preload, etc.)
  • src:String - URL to video content.
Example
import {VideoPlayer} from 'react-video-players';

...

  render() {
    return (
      <div>
        <VideoPlayer src="[...your video source url...]" />
      </div>
    );
  }

...

playerController (Higher Order Component)

Want to build your own embeddable player using a different providers player? No problem 😎

Included in this library is the a High Order Component that wraps all the players in this library, playerController. The playerController is responsible for wiring up the controls, along with handling some basic style and callback handling within video component instances so that we’re not repeating ourselves too much.

Feel free to use the playerController to write your own React video players that wrap embeddable players from other video providers. Also, if you end up writing a really awesome component for another provider, and you’d like to add it to this repo, just make a PR with your additions and I’ll check’em out and merge them in as soon as I can.

Example

import React, {Component} from 'react';
import {playerController} from 'react-video-players';

class YourRadVideoPlayer extends Component {

...

}
...

export default playerController(YourRadVideoPlayer);

Player Controls

The controls property on the video player components makes it easy to compose controls in context with the video player and provide a simple way to keep controls in sync with the video state, while also providing callbacks that can be used to control video playback.

Properties

  • loop:Boolean - Loop status of video
  • play:Boolean - Playing status of video
  • time:Number - Current time of video
  • volume:Number - Current volume of video

Callback

  • onPause:Function - Callback to pause video
  • onPlay:Function - Callback to play video
  • onSeek:Function - Callback to seek video
  • onVolumeChange:Function - Callback to change the volume of video

License

MIT © Ryan Hefner

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].