Document onBandwidthUpdate & video track selection
This commit is contained in:
parent
04f3f40278
commit
937eec0eae
60
README.md
60
README.md
@ -278,9 +278,11 @@ var styles = StyleSheet.create({
|
||||
* [progressUpdateInterval](#progressupdateinterval)
|
||||
* [rate](#rate)
|
||||
* [repeat](#repeat)
|
||||
* [reportBandwidth](#reportbandwidth)
|
||||
* [resizeMode](#resizemode)
|
||||
* [selectedAudioTrack](#selectedaudiotrack)
|
||||
* [selectedTextTrack](#selectedtexttrack)
|
||||
* [selectedVideoTrack](#selectedvideotrack)
|
||||
* [source](#source)
|
||||
* [stereoPan](#stereopan)
|
||||
* [textTracks](#texttracks)
|
||||
@ -289,6 +291,7 @@ var styles = StyleSheet.create({
|
||||
|
||||
### Event props
|
||||
* [onAudioBecomingNoisy](#onaudiobecomingnoisy)
|
||||
* [onBandwidthUpdate](#onbandwidthupdate)
|
||||
* [onEnd](#onend)
|
||||
* [onExternalPlaybackChange](#onexternalplaybackchange)
|
||||
* [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent)
|
||||
@ -542,6 +545,14 @@ Determine whether to repeat the video when the end is reached
|
||||
|
||||
Platforms: all
|
||||
|
||||
#### reportBandwidth
|
||||
Determine whether to generate onBandwidthUpdate events. This is needed due to the high frequency of these events on ExoPlayer.
|
||||
|
||||
* **false (default)** - Generate onBandwidthUpdate events
|
||||
* **true** - Don't generate onBandwidthUpdate events
|
||||
|
||||
Platforms: Android ExoPlayer
|
||||
|
||||
#### resizeMode
|
||||
Determines how to resize the video when the frame doesn't match the raw video dimensions.
|
||||
* **"none" (default)** - Don't apply resize
|
||||
@ -613,6 +624,35 @@ If a track matching the specified Type (and Value if appropriate) is unavailable
|
||||
|
||||
Platforms: Android ExoPlayer, iOS
|
||||
|
||||
#### selectedVideoTrack
|
||||
Configure which video track should be played. By default, the player uses Adaptive Bitrate Streaming to automatically select the stream it thinks will perform best based on available bandwidth.
|
||||
|
||||
```
|
||||
selectedVideoTrack={{
|
||||
type: Type,
|
||||
value: Value
|
||||
}}
|
||||
```
|
||||
|
||||
Example:
|
||||
```
|
||||
selectedVideoTrack={{
|
||||
type: "resolution",
|
||||
value: 480
|
||||
}}
|
||||
```
|
||||
|
||||
Type | Value | Description
|
||||
--- | --- | ---
|
||||
"auto" (default) | N/A | Let the player determine which track to play using ABR
|
||||
"disabled" | N/A | Turn off video
|
||||
"resolution" | number | Play the video track with the height specified, e.g. 480 for the 480p stream
|
||||
"index" | number | Play the video track with the index specified as the value, e.g. 0
|
||||
|
||||
If a track matching the specified Type (and Value if appropriate) is unavailable, ABR will be used.
|
||||
|
||||
Platforms: Android ExoPlayer
|
||||
|
||||
#### source
|
||||
Sets the media source. You can pass an asset loaded via require or an object with a uri.
|
||||
|
||||
@ -748,6 +788,26 @@ Payload: none
|
||||
|
||||
Platforms: Android ExoPlayer, iOS
|
||||
|
||||
#### onBandwidthUpdate
|
||||
Callback function that is called when the available bandwidth changes.
|
||||
|
||||
Payload:
|
||||
|
||||
Property | Type | Description
|
||||
--- | --- | ---
|
||||
bitrate | number | The estimated bitrate in bits/sec
|
||||
|
||||
Example:
|
||||
```
|
||||
{
|
||||
bitrate: 1000000
|
||||
}
|
||||
```
|
||||
|
||||
Note: On Android ExoPlayer, you must set the [reportBandwidth](#reportbandwidth) prop to enable this event. This is due to the high volume of events generated.
|
||||
|
||||
Platforms: Android ExoPlayer, iOS
|
||||
|
||||
#### onEnd
|
||||
Callback function that is called when the player reaches the end of the media.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user