Merge pull request #1160 from bvanwijk/configure-default-load-control

Expose DefaultLoadControl parameters Android ExoPlayer
This commit is contained in:
Hampton Maxwell
2018-08-03 15:59:23 -07:00
committed by GitHub
4 changed files with 74 additions and 2 deletions

View File

@@ -210,6 +210,7 @@ var styles = StyleSheet.create({
### Configurable props
* [allowsExternalPlayback](#allowsexternalplayback)
* [audioOnly](#audioonly)
* [bufferConfig](#bufferconfig)
* [ignoreSilentSwitch](#ignoresilentswitch)
* [muted](#muted)
* [paused](#paused)
@@ -262,6 +263,30 @@ For this to work, the poster prop must be set.
Platforms: all
#### bufferConfig
Adjust the buffer settings. This prop takes an object with one or more of the properties listed below.
This prop can only be set when you are setting a new source, changing it after the media is loaded will cause it to restart.
Property | Type | Description
--- | --- | ---
minBufferMs | number | The default minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds.
maxBufferMs | number | The default maximum duration of media that the player will attempt to buffer, in milliseconds.
bufferForPlaybackMs | number | The default duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds.
playbackAfterRebufferMs | number | The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action.
Example with default values:
```
bufferConfig={{
minBufferMs: 15000,
maxBufferMs: 50000,
bufferForPlaybackMs: 2500,
bufferForPlaybackAfterRebufferMs: 5000
}}
```
Platforms: Android ExoPlayer
#### ignoreSilentSwitch
Controls the iOS silent switch behavior
* **"inherit" (default)** - Use the default AVPlayer behavior