From 9ff16ed550e9ad2572df3a50a068b98a70493bcc Mon Sep 17 00:00:00 2001 From: Hampton Maxwell Date: Fri, 3 Aug 2018 14:55:46 -0700 Subject: [PATCH] Tidy up bufferConfig docs --- README.md | 58 ++++++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 68d8c3a4..947f4f2a 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ var styles = StyleSheet.create({ ### Configurable props * [allowsExternalPlayback](#allowsexternalplayback) * [audioOnly](#audioonly) +* [bufferConfig](#bufferconfig) * [ignoreSilentSwitch](#ignoresilentswitch) * [muted](#muted) * [paused](#paused) @@ -229,7 +230,6 @@ var styles = StyleSheet.create({ * [textTracks](#texttracks) * [useTextureView](#usetextureview) * [volume](#volume) -* [bufferConfig](#bufferconfig) ### Event props * [onAudioBecomingNoisy](#onaudiobecomingnoisy) @@ -265,6 +265,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 @@ -480,38 +504,6 @@ Adjust the volume. Platforms: all -#### bufferConfig -Adjust the video load control parameters: minBufferMs, maxBufferMs, bufferForPlaybackMs and playbackAfterRebufferMs. -Note: these values can not be changed after the video component is loaded. - -Property | Description ---- | --- -minBufferMs | The default minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds. -maxBufferMs | The default maximum duration of media that the player will attempt to buffer, in milliseconds. -bufferForPlaybackMs | 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 | 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. - -``` -bufferConfig={{ - minBufferMs: number, - maxBufferMs: number, - bufferForPlaybackMs: number, - bufferForPlaybackAfterRebufferMs: number, -}} -``` - -Example with default values: -``` -bufferConfig={{ - minBufferMs: 15000, - maxBufferMs: 50000, - bufferForPlaybackMs: 2500, - bufferForPlaybackAfterRebufferMs: 5000, -}} -``` - -Platforms: AndroidExoplayer - ### Event props #### onAudioBecomingNoisy