All Projects → zzarcon → React Video Renderer

zzarcon / React Video Renderer

Licence: mit
Build custom video players effortless

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to React Video Renderer

Yuview
The Free and Open Source Cross Platform YUV Viewer with an advanced analytics toolset
Stars: ✭ 665 (+565%)
Mutual labels:  player, video-player
Dailymotion Swift Player Sdk Ios
Dailymotion Player SDK for iOS in Swift
Stars: ✭ 29 (-71%)
Mutual labels:  player, video-player
Zfplayer
Support customization of any player SDK and control layer(支持定制任何播放器SDK和控制层)
Stars: ✭ 6,694 (+6594%)
Mutual labels:  player, custom
Clappr
🎬 An extensible media player for the web.
Stars: ✭ 5,436 (+5336%)
Mutual labels:  player, video-player
Made With Love
🚀 An experimental project which demonstrates an Angular Package which contains Angular Elements and Schematics
Stars: ✭ 67 (-33%)
Mutual labels:  custom, component
Rx Player
DASH/Smooth HTML5 Video Player
Stars: ✭ 600 (+500%)
Mutual labels:  player, video-player
Fijkplayer
ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
Stars: ✭ 943 (+843%)
Mutual labels:  player, video-player
Playerdemo
一个视频播放器,开源版 potplayer ,用于总结播放器开发技术。
Stars: ✭ 491 (+391%)
Mutual labels:  player, video-player
Stf Vue Select
stf vue select - most flexible and customized select
Stars: ✭ 61 (-39%)
Mutual labels:  custom, component
Kjplayerdemo
视频播放壳子:动态切换内核,支持边下边播边缓存的播放器方案,视频支持格式:mp4、m3u8、wav、avi,音频支持格式:midi、mp3
Stars: ✭ 60 (-40%)
Mutual labels:  player, video-player
React Scrollbars Custom
The best React custom scrollbars component
Stars: ✭ 576 (+476%)
Mutual labels:  custom, component
Larkplayer
🚀 A lightweight & flexible web player :)
Stars: ✭ 82 (-18%)
Mutual labels:  player, video-player
Vue Dplayer
📹 A Vue 2.x video player component based on DPlayer
Stars: ✭ 565 (+465%)
Mutual labels:  player, component
Pbjvideoplayer
▶️ video player, simple way to play and stream media on iOS/tvOS
Stars: ✭ 620 (+520%)
Mutual labels:  player, video-player
Vue Plyr
A Vue component for the plyr (https://github.com/sampotts/plyr) video & audio player.
Stars: ✭ 531 (+431%)
Mutual labels:  video-player, component
Abplayerhtml5
Video Player for danmaku comments. ABPlayer in HTML5. ABPlayer核心构件以动态HTML编写的版本。向HTML5进发!HTML5弹幕播放器
Stars: ✭ 858 (+758%)
Mutual labels:  player, video-player
Moonplayer
Video player that can play online videos from youtube, bilibili etc.
Stars: ✭ 399 (+299%)
Mutual labels:  player, video-player
Xgplayer
A HTML5 video player with a parser that saves traffic
Stars: ✭ 4,792 (+4692%)
Mutual labels:  player, video-player
Videojscustomization
HTML5 视频播放器 自定制: React + video.js 详细讲解
Stars: ✭ 32 (-68%)
Mutual labels:  video-player, custom
Nexplayer unity plugin
Stream videos in HLS & DASH with Widevine DRM using NexPlayer Video Streaming Player SDK for Unity on Android & iOS devices
Stars: ✭ 73 (-27%)
Mutual labels:  player, video-player

react-video-renderer Build Status

Build custom video players effortless

  • Render props, get all video state passed down as props.
  • Bidirectional flow to render and update the video state in a declarative way.
  • No side effects out of the box, you just need to build the UI.
  • Actions handling: play, pause, mute, unmute, navigate, etc
  • Dependency free, <2KB size
  • Cross-browser support, no more browser hacks.

Demo 🎩

https://zzarcon.github.io/react-video-renderer

Installation 🚀

$ yarn add react-video-renderer

Usage ⛏

Render video state and communicate user interactions up when volume or time changes.

import Video from 'react-video-renderer';

<Video src="https://mysite.com/video.mp4">
  {(video, state, actions) => (
    <div>
      {video}
      <div>{state.currentTime} / {state.duration} / {state.buffered}</div>
      <progress value={state.currentTime} max={state.duration} onChange={actions.navigate} />
      <progress value={state.volume} max={1} onChange={actions.setVolume} />
      <button onClick={actions.play}>Play</button>
      <button onClick={actions.pause}>Pause</button>
      <button onClick={actions.requestFullScreen}>Fullscreen</button>
    </div>
  )}
</Video>
Logo

Api 💅

props

interface Props {
  src: string;
  children: RenderCallback;
  controls?: boolean;
  autoPlay?: boolean;
  preload?: string;
}

render method

type RenderCallback = (videoElement: ReactNode, state: VideoState, actions: VideoActions) => ReactNode;

state

interface VideoState {
  status: 'playing' | 'paused' | 'errored';
  currentTime: number;
  volume: number;
  duration: number;
  buffered: number;
  isMuted: boolean;
  isLoading: boolean;
  error?: MediaError | null;
}

actions

interface VideoActions {
  play: () => void;
  pause: () => void;
  navigate: (time: number) => void;
  setVolume: (volume: number) => void;
  requestFullscreen: () => void;
  mute: () => void;
  unmute: () => void;
  toggleMute: () => void;
}

Error handling 💥

this is all you need to detect video errors

<Video src="some-error-video.mov">
  {(video, state) => {
    if (state.status === 'errored') {
      return (
        <ErrorWrapper>
          Error
        </ErrorWrapper>
      );
    }

    return (
      <div>
        {video}
      </div>
    )
  }}
</Video>

Loading state ✨

you can still interact with the player regardless if the video is loading or not

<Video src="me-video.mp4">
  {(video, state, actions) => {
    const loadingComponent = state.isLoading ? 'loading...' : undefined;

    return (
      <div>
        {video}
        {loadingComponent}
        <button onClick={actions.play}>Play</button>
        <button onClick={actions.pause}>Pause</button>
      </div>
    )
  }}
</Video>

Author 🧔

@zzarcon

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].