You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Controls for the React Native `<Video>` component at [react-native-video](https://github.com/react-native-community/react-native-video). For support with RN 0.45 or lower use version 1.3.1 or lower.
3
6
4
7
## Features
8
+
5
9
This package contains a simple set of GUI controls that work with the [react-native-video](https://github.com/react-native-community/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.
6
10
7
11

@@ -11,13 +15,15 @@ By default the `<VideoPlayer>` accepts a navigator property from React's built-i
11
15
By default, tapping the screen anywhere will show the player controls. After 10s the controls disappear. Double tapping will toggle fullscreen.
12
16
13
17
## Installation
18
+
14
19
Run `npm install --save react-native-video react-native-video-controls`
15
20
16
21
Then run `react-native link react-native-video`
17
22
18
23
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.
19
24
20
25
## Usage
26
+
21
27
The `<VideoPlayer>` component follows the API of the `<Video>` component at [react-native-video](https://github.com/react-native-community/react-native-video). It also takes a number of additional props which are outlined in the [API](#api) section.
22
28
23
29
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](#api) for more details.
@@ -28,56 +34,75 @@ import VideoPlayer from 'react-native-video-controls';
The `<VideoPlayer>` component can take a number of inputs to customize it as needed. They are outlined below:
44
51
45
52
### Props
53
+
46
54
You can pass any of the props that the `<Video />` component at [react-native-video](https://github.com/react-native-community/react-native-video) takes. Simply add them onto the `<VideoPlayer />` and it will pass them through to the `<Video />` component.
47
55
48
56
In addition, the `<VideoPlayer />` also takes these props:
| 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 |
53
-
| controlTimeout | Integer | 15000 | Hide controls after X amount of time in milliseconds |
54
-
| showOnStart | Boolean | true | Show or hide the controls on first render |
55
-
| videoStyle | StyleSheet | null | React Native StyleSheet object that is appended to the `<Video>` component |
56
-
| 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 |
57
-
| seekColor | String(#HEX) | '#FFF' | Fill/handle colour of the seekbar |
58
-
| style | StyleSheet | null | React Native StyleSheet object that is appended to the video's parent `<View>`|
| 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 |
61
+
| controlAnimationTiming | Integer | 500 | The amountof time (in milliseconds) to animate the controls in and out. |
62
+
| 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. |
63
+
| controlTimeout | Integer | 15000 | Hide controls after X amount of time in milliseconds |
64
+
| 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. |
65
+
| showOnStart | Boolean | true | Show or hide the controls on first render |
66
+
| videoStyle | StyleSheet | null | React Native StyleSheet object that is appended to the `<Video>` component |
67
+
| 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 |
68
+
| seekColor | String(#HEX) | '#FFF' | Fill/handle colour of the seekbar |
69
+
| style | StyleSheet | null | React Native StyleSheet object that is appended to the video's parent `<View>`|
70
+
| tapAnywhereToPause | Boolean | false | If true, single tapping anywhere on the video (other than a control) toggles between playing and paused. |
71
+
72
+
| showTimeRemaining | Boolean | true | If true, show the time remaing, else show the current time in the Player.
73
+
`<View>`
74
+
75
+
| showHours | Boolean | false | If true, convert time to hours in the Player
76
+
`<View>`
59
77
60
78
### Events
79
+
61
80
These are various events that you can hook into and fire functions on in the component:
0 commit comments