All Projects → itsnubix → React Native Video Controls

itsnubix / React Native Video Controls

Licence: mit
A React Native video component with controls

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Video Controls

Mpv Easy Player
MPV-EASY Player - A movie player based on mpv
Stars: ✭ 324 (-32.36%)
Mutual labels:  video-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 (-23.59%)
Mutual labels:  video-player
Moonplayer
Video player that can play online videos from youtube, bilibili etc.
Stars: ✭ 399 (-16.7%)
Mutual labels:  video-player
Piptool
Add the Picture-in-Picture Functionality to YouTube, Netflix, Plex and other video broadcasting services in macOS Sierra
Stars: ✭ 337 (-29.65%)
Mutual labels:  video-player
Fluid Player
Fluid Player - an open source VAST compliant HTML5 video player
Stars: ✭ 359 (-25.05%)
Mutual labels:  video-player
Videojs Resolution Switcher
Resolution switcher adds the ability to select the video quality in video.js player.
Stars: ✭ 375 (-21.71%)
Mutual labels:  video-player
React Native Gl Model View
📺 Display and animate textured Wavefront .OBJ 3D models with 60fps - native bridge to GLView (iOS) and jPCT-AE (Android)
Stars: ✭ 313 (-34.66%)
Mutual labels:  react-native-component
React Native Tabbar Interaction
Tabbar Component For React-Native
Stars: ✭ 457 (-4.59%)
Mutual labels:  react-native-component
Qier Player
🎬 A lightweight and sophisticated React-based H5 video player / 简单易用的h5播放器
Stars: ✭ 360 (-24.84%)
Mutual labels:  video-player
React Native Drag Sort
🔥🔥🔥Drag and drop sort control for react-native
Stars: ✭ 397 (-17.12%)
Mutual labels:  react-native-component
Giraffeplayer2
out of the box android video player(support lazy load, ListView/RecyclerView and hight performance)
Stars: ✭ 344 (-28.18%)
Mutual labels:  video-player
Parsingplayer
A video player playing videos from youku.com and other video sites.
Stars: ✭ 359 (-25.05%)
Mutual labels:  video-player
Vgplayer
📺 A simple iOS video player by Vein.
Stars: ✭ 383 (-20.04%)
Mutual labels:  video-player
React Native Material Menu
Pure JavaScript material menu component for React Native
Stars: ✭ 327 (-31.73%)
Mutual labels:  react-native-component
Xgplayer
A HTML5 video player with a parser that saves traffic
Stars: ✭ 4,792 (+900.42%)
Mutual labels:  video-player
Dkvideoplayer
Android Video Player. 安卓视频播放器,封装MediaPlayer、ExoPlayer、IjkPlayer。模仿抖音并实现预加载,列表播放,悬浮播放,广告播放,弹幕
Stars: ✭ 3,796 (+692.48%)
Mutual labels:  video-player
Vue Video Player
🎞 @videojs component for @vuejs
Stars: ✭ 4,026 (+740.5%)
Mutual labels:  video-player
Artplayer
Kotlin实现的视频播放器,将MediaPlayer与VideoView解耦合,支持切换播放器内核(如ExoPlayer和ijkPlayer),支持自定义控制视图,提供MediaPlayerManager实现全屏模式,小屏幕模式等。
Stars: ✭ 471 (-1.67%)
Mutual labels:  video-player
React Native Video Player
A video player for React Native with controls
Stars: ✭ 415 (-13.36%)
Mutual labels:  video-player
Mxreality.js
普通全景视频,直播全景视频,hls和flv全景VR视频直播,全景图片、VR模型、多终端自适应
Stars: ✭ 386 (-19.42%)
Mutual labels:  video-player

react-native-video-controls

ci

Controls for the React Native <Video> component at react-native-video. For support with RN 0.45 or lower use version 1.3.1 or lower.

Features

This package contains a simple set of GUI controls that work with the react-native-video <Video> component. This includes a back button, volume bar, fullscreen toggle, play/pause toggle, seekbar, title, error handling and timer toggle that can switch between time remaining and current time when tapped.

How it looks

By default the <VideoPlayer> accepts a navigator property from React's built-in <Navigator> which pops the current scene off the stack when tapped. Alternatively you can provide your own onBack prop to the component to override this functionality. You should also provide your own onEnd prop to the component so it knows what to do when a video ends playback.

By default, tapping the screen anywhere will show the player controls. After 10s the controls disappear. Double tapping will toggle fullscreen.

Installation

Run npm install --save react-native-video react-native-video-controls

Then run react-native link react-native-video

If you're using RN < 39 run npm install --save [email protected]. Note this version includes react-native-video as a normal dependency instead of a peer-dependency.

Usage

The <VideoPlayer> component follows the API of the <Video> component at react-native-video. It also takes a number of additional props which are outlined in the API section.

For basic operation the <VideoPlayer> component requires a video source and a navigator property. The default back button functionality in the component relies on using the built-in <Navigator> functionality in React Native and pops the current scene off the stack. This can be overridden if desired, see the API for more details.

// At the top where our imports are...
import VideoPlayer from 'react-native-video-controls';

// in the component's render() function
<VideoPlayer
  source={{uri: 'https://vjs.zencdn.net/v/oceans.mp4'}}
  navigator={this.props.navigator}
/>;

To play a local file, use require syntax like so:

<VideoPlayer source={require('path/to/file')} />

API

The <VideoPlayer> component can take a number of inputs to customize it as needed. They are outlined below:

Props

You can pass any of the props that the <Video /> component at react-native-video takes. Simply add them onto the <VideoPlayer /> and it will pass them through to the <Video /> component.

In addition, the <VideoPlayer /> also takes these props:

Prop Type Default Description
toggleResizeModeOnFullscreen Boolean true If true, clicking the fullscreen button will toggle the <Video /> component between cover/contain, set to false if you want to customize fullscreen behaviour
controlAnimationTiming Integer 500 The amountof time (in milliseconds) to animate the controls in and out.
doubleTapTime Integer 130 Tapping twice within this amount of time in milliseconds is considered a double tap. Single taps will not be actioned until this time has expired.
controlTimeout Integer 15000 Hide controls after X amount of time in milliseconds
scrubbing Integer 0 If > 0, enable live scrubbing when moving the seek bar. The provided value is the minimum time step of the scrubbing in milliseconds.
showOnStart Boolean true Show or hide the controls on first render
videoStyle StyleSheet null React Native StyleSheet object that is appended to the <Video> component
navigator Navigator null When using the default React Native navigator and do not override the onBack function, you'll need to pass the navigator to the VideoPlayer for it to function
seekColor String(#HEX) '#FFF' Fill/handle colour of the seekbar
style StyleSheet null React Native StyleSheet object that is appended to the video's parent <View>
tapAnywhereToPause Boolean false If true, single tapping anywhere on the video (other than a control) toggles between playing and paused.

Events

These are various events that you can hook into and fire functions on in the component:

Callback Description
onEnterFullscreen Fired when the video enters fullscreen after the fullscreen button is pressed
onExitFullscreen Fired when the video exits fullscreen after the fullscreen button is pressed
onHideControls Fired when the controls disappear
onShowControls Fired when the controls appear
onError Fired when an error is encountered when loading the video
onPause Fired when the video is paused after the play/pause button is pressed
onPlay Fired when the video begins playing after the play/pause button is pressed
onBack Function fired when back button is pressed, override if using custom navigation
onEnd Fired when the video is complete

Controls

These are the various controls that you can turn on/off as needed. All of these props default to false, override them to disable any controls

Control Description
disableFullscreen Hide the fullscreen button
disablePlayPause Hide the play/pause toggle
disableSeekbar Hide the seekbar
disableVolume Hide the Volume control
disableTimer Hide the timer
disableBack Hide the back button
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].