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)
|
* [progressUpdateInterval](#progressupdateinterval)
|
||||||
* [rate](#rate)
|
* [rate](#rate)
|
||||||
* [repeat](#repeat)
|
* [repeat](#repeat)
|
||||||
|
* [reportBandwidth](#reportbandwidth)
|
||||||
* [resizeMode](#resizemode)
|
* [resizeMode](#resizemode)
|
||||||
* [selectedAudioTrack](#selectedaudiotrack)
|
* [selectedAudioTrack](#selectedaudiotrack)
|
||||||
* [selectedTextTrack](#selectedtexttrack)
|
* [selectedTextTrack](#selectedtexttrack)
|
||||||
|
* [selectedVideoTrack](#selectedvideotrack)
|
||||||
* [source](#source)
|
* [source](#source)
|
||||||
* [stereoPan](#stereopan)
|
* [stereoPan](#stereopan)
|
||||||
* [textTracks](#texttracks)
|
* [textTracks](#texttracks)
|
||||||
@ -289,6 +291,7 @@ var styles = StyleSheet.create({
|
|||||||
|
|
||||||
### Event props
|
### Event props
|
||||||
* [onAudioBecomingNoisy](#onaudiobecomingnoisy)
|
* [onAudioBecomingNoisy](#onaudiobecomingnoisy)
|
||||||
|
* [onBandwidthUpdate](#onbandwidthupdate)
|
||||||
* [onEnd](#onend)
|
* [onEnd](#onend)
|
||||||
* [onExternalPlaybackChange](#onexternalplaybackchange)
|
* [onExternalPlaybackChange](#onexternalplaybackchange)
|
||||||
* [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent)
|
* [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent)
|
||||||
@ -542,6 +545,14 @@ Determine whether to repeat the video when the end is reached
|
|||||||
|
|
||||||
Platforms: all
|
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
|
#### resizeMode
|
||||||
Determines how to resize the video when the frame doesn't match the raw video dimensions.
|
Determines how to resize the video when the frame doesn't match the raw video dimensions.
|
||||||
* **"none" (default)** - Don't apply resize
|
* **"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
|
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
|
#### source
|
||||||
Sets the media source. You can pass an asset loaded via require or an object with a uri.
|
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
|
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
|
#### onEnd
|
||||||
Callback function that is called when the player reaches the end of the media.
|
Callback function that is called when the player reaches the end of the media.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user