-
Notifications
You must be signed in to change notification settings - Fork 979
/
better_player_buffering_configuration.dart
35 lines (30 loc) · 1.57 KB
/
better_player_buffering_configuration.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
///Configuration class used to setup better buffering experience or setup custom
///load settings. Currently used only in Android.
class BetterPlayerBufferingConfiguration {
///Constants values are from the offical exoplayer documentation
///https://exoplayer.dev/doc/reference/constant-values.html#com.google.android.exoplayer2.DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS
static const defaultMinBufferMs = 25000;
static const defaultMaxBufferMs = 6553600;
static const defaultBufferForPlaybackMs = 3000;
static const defaultBufferForPlaybackAfterRebufferMs = 6000;
/// The default minimum duration of media that the player will attempt to
/// ensure is buffered at all times, in milliseconds.
final int minBufferMs;
/// The default maximum duration of media that the player will attempt to
/// buffer, in milliseconds.
final int maxBufferMs;
/// 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.
final int bufferForPlaybackMs;
/// 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.
final int bufferForPlaybackAfterRebufferMs;
const BetterPlayerBufferingConfiguration({
this.minBufferMs = defaultMinBufferMs,
this.maxBufferMs = defaultMaxBufferMs,
this.bufferForPlaybackMs = defaultBufferForPlaybackMs,
this.bufferForPlaybackAfterRebufferMs =
defaultBufferForPlaybackAfterRebufferMs,
});
}