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
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,15 +141,17 @@ When `preload` is set to `true` for players that support it, a short, silent vid
141
141
#### Static Methods
142
142
143
143
Method | Description
144
-
---- | -----------
144
+
------ | -----------
145
145
`ReactPlayer.canPlay(url)` | Determine if a URL can be played. This does *not* detect media that is unplayable due to privacy settings, streaming permissions, etc. In that case, the `onError` prop will be invoked after attemping to play. Any URL that does not match any patterns will fall back to a native HTML5 media player.
146
+
`ReactPlayer.addCustomPlayer(CustomPlayer)` | Add a custom player. See [Adding custom players](#adding-custom-players)
147
+
`ReactPlayer.removeCustomPlayers()` | Remove any players that have been added using `addCustomPlayer()`
146
148
147
149
#### Instance Methods
148
150
149
151
Use [`ref`](https://facebook.github.io/react/docs/refs-and-the-dom.html) to call instance methods on the player. See [the demo app](src/demo/App.js) for an example of this.
150
152
151
153
Method | Description
152
-
---- | -----------
154
+
------ | -----------
153
155
`seekTo(amount)` | Seek to the given number of seconds, or fraction if `amount` is between `0` and `1`
154
156
`getCurrentTime()` | Returns the number of seconds that has been played<br /> ◦ Returns `null` if duration is unavailable
155
157
`getDuration()` | Returns the duration (in seconds) of the currently playing media<br /> ◦ Returns `null` if duration is unavailable
@@ -230,16 +232,16 @@ If you aren’t using React, you can still render a player using the standalone
230
232
231
233
See [`jsFiddle` example](https://jsfiddle.net/krkcvx9s/)
232
234
233
-
#### Adding your own players
235
+
#### Adding custom players
234
236
235
-
If you have your own player, that is compatible with ReactPlayer's internal architecture, you can use it like this:
237
+
If you have your own player that is compatible with ReactPlayer’s internal architecture, you can add it using `addCustomPlayer`:
236
238
237
239
```javascript
238
240
importYourOwnPlayerfrom'./somewhere';
239
241
ReactPlayer.addCustomPlayer(YourOwnPlayer);
240
242
```
241
243
242
-
Or you can clear all additional players:
244
+
Use `removeCustomPlayers` to clear all custom players:
0 commit comments