-
Notifications
You must be signed in to change notification settings - Fork 14
/
tweaksConfig.ts
212 lines (210 loc) · 9.07 KB
/
tweaksConfig.ts
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/**
* When switching the video quality, the video decoder's configuration might change
* as the player can't always know if the codec supports such configuration change, it destroys and recreates it.
* This behaviour can cause brief black screens when switching between video qualities as codec recreation can be slow.
*
* If a codec is know to support a given configuration change without issues,
* the configuration can be added to the `TweaksConfig.forceReuseVideoCodecReasons`
* to always reuse the video codec and avoid the black screen.
*/
export enum ForceReuseVideoCodecReason {
/**
* The new video quality color information is not compatible.
*/
ColorInfoMismatch = 'ColorInfoMismatch',
/**
* The new video quality exceed the decoder's configured maximum sample size.
*/
MaxInputSizeExceeded = 'MaxInputSizeExceeded',
/**
* The new video quality exceed the decoder's configured maximum resolution.
*/
MaxResolutionExceeded = 'MaxResolutionExceeded',
}
/**
* This configuration is used as an incubator for experimental features. Tweaks are not officially
* supported and are not guaranteed to be stable, i.e. their naming, functionality and API can
* change at any time within the tweaks or when being promoted to an official feature and moved
* into its final configuration namespace.
*/
export interface TweaksConfig {
/**
* The frequency in seconds `onTimeChanged` is called with `TimeChangedEvent`s.
*
* Default value in iOS is `1.0`.
* Default value in Android is `0.2`.
*
* @platform iOS, Android
*/
timeChangedInterval?: number;
/**
* If enabled, HLS playlists will be parsed and additional features and events are enabled. This includes:
*
* - MetadataEvents carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`
* - MetadataParsedEvents carrying segment-specific metadata for custom HLS tags, like `#EXT-X-SCTE35`
* - DrmDataParsedEvents when a `#EXT-X-KEY` is found
* - `Player.availableVideoQualities` includes additional information
* - Automatic retries when HLS playlist requests failed with non-2xx HTTP status code
*
* Default is false.
*
* @platform iOS
*/
isNativeHlsParsingEnabled?: boolean;
/**
* If enabled, playlists will be downloaded by the Bitmovin Player SDK instead of AVFoundation.
* This enables additional features and events, like:
*
* - DownloadFinishedEvents for playlist downloads.
* - SourceWarningEvents when no `#EXT-X-PLAYLIST-TYPE` is found If set to false, enabling
* nativeHlsParsingEnabled won’t have any effect.
*
* Default is true.
*
* @platform iOS
*/
isCustomHlsLoadingEnabled?: boolean;
/**
* The threshold which will be applied when seeking to the end in seconds. This value will be used
* to calculate the maximum seekable time when calling `player.seek(time:)` or `player.playlist.seek(source:time:)`,
* so the maximum value will be duration - seekToEndThreshold.
*
* This is useful if the duration of the segments does not match the duration specified in the
* manifest. In this case, if we try to seek to the end, AVPlayer could get stuck and might stall
* forever Therefore increasing this value could help.
*
* Default is 0.5.
*
* @platform iOS
*/
seekToEndThreshold?: number;
/**
* Specifies the player behaviour when `Player.play` is called. Default is 'relaxed'.
*
* - 'relaxed': Starts playback when enough media data is buffered and continuous playback without stalling can be ensured. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.
* - 'aggressive': When the buffer is not empty, this setting will cause the player to start playback of available media immediately. If insufficient media data is buffered for playback to start, the player will act as if the buffer became empty during playback.
*
* @platform iOS
*/
playbackStartBehaviour?: 'relaxed' | 'aggressive';
/**
* Specifies the player behaviour when stalling should be exited. Default is 'relaxed'.
*
* - 'relaxed': The player will wait until the buffer is filled that it can, most likely, ensure continuous playback without another stalling right after playback continued.
* - 'aggressive': The player will try to unstall as soon as some media data became available and will start playback of this media immediately.
*
* @platform iOS
*/
unstallingBehaviour?: 'relaxed' | 'aggressive';
/**
* Constantly aggregated and weighted bandwidth samples are summed up to this weight limit to calculate an bandwidth estimation. Remaining samples (i.e. that would lead to exceeding the limit) are dropped from memory as they are not relevant anymore.
* Default is 2000.
*
* @platform Android
*/
bandwidthEstimateWeightLimit?: number;
/**
* Some devices have an incorrect implementation of MediaCodec.setOutputSurface. This leads to failure when the surface changes. To prevent failure, the codec will be released and re-instantiated in those scenarios.
*
* @platform Android
*/
devicesThatRequireSurfaceWorkaround?: {
/**
* A device name as reported by Build.DEVICE.
*
* @see Build.DEVICE: https://developer.android.com/reference/kotlin/android/os/Build.html#DEVICE--
*/
deviceNames?: string[];
/**
* A model name as reported by Build.MODEL.
*
* @see Build.MODEL: https://developer.android.com/reference/kotlin/android/os/Build.html#MODEL--
*/
modelNames?: string[];
};
/**
* Specifies if the language property on DASH Representations, HLS Renditions and SmoothStreaming QualityLevels is normalized.
* If enabled, language properties are normalized to IETF BCP 47 language tags. Default is true.
*
* Examples:
* - "ENG" is normalized to "en"
* - "en_us" is normalized to "en-us"
* - "en-US-x-lvariant-POSIX" is normalized to "en-us-posix"
*
* @platform Android
*/
languagePropertyNormalization?: boolean;
/**
* The interval in which dynamic DASH windows are updated locally. I.e. The rate by which the
* playback window is moved forward on the timeline.
*
* @platform Android
*/
localDynamicDashWindowUpdateInterval?: number;
/**
* Specifies whether default positioning values should be assumed when parsing TTML regions in case of
* unsupported TTML features. Default is true
*
* @platform Android
*/
shouldApplyTtmlRegionWorkaround?: boolean;
/**
* Specifies whether a DRM session should be used for clear tracks of type video and audio. Using
* DRM sessions for clear content avoids the recreation of decoders when transitioning between clear
* and encrypted sections of content. Default is false.
*
* @platform Android
*/
useDrmSessionForClearPeriods?: boolean;
/**
* Specifies whether a DRM session should be used for clear tracks of type video and audio in a clear
* source that follows after a DRM protected source. In addition, a DRM session will be used for clear
* periods in a DRM protected source. Using DRM sessions for clear content avoids the recreation of
* decoders when transitioning between clear and encrypted sections of content. Default is false.
*
* @platform Android
*/
useDrmSessionForClearSources?: boolean;
/**
* Specifies if the player should always fall back to an extractor matching the file type, if no
* matching extractor was found. If the fallback is applied, this will ignore potential incompatibilities
* with streams and thus can result in unstable or failing playback.
*
* @platform Android
*/
useFiletypeExtractorFallbackForHls?: boolean;
/**
* Specifies whether the player should prefer software decoding over hardware decoding for ad playback.
* This only affects ads playback, the player will still prefer hardware decoding for the main content.
*
* @platform Android
*/
preferSoftwareDecodingForAds?: boolean;
/**
* Determines whether `AVKit` should update Now Playing information automatically when using System UI.
*
* - If set to `false`, the automatic updates of Now Playing Info sent by `AVKit` are disabled.
* This prevents interference with manual updates you may want to perform.
* - If set to `true`, the default behaviour is maintained, allowing `AVKit` to handle Now Playing updates.
*
* Default is `true`.
*
* @deprecated To enable the Now Playing information use {@link MediaControlConfig.isEnabled}
* @platform iOS
*/
updatesNowPlayingInfoCenter?: boolean;
/**
* When switching between video formats (eg: adapting between video qualities)
* the codec might be recreated due to several reasons.
* This behaviour can cause brief black screens when switching between video qualities as codec recreation can be
* slow.
*
* If a device is know to support video format changes and keep the current decoder without issues,
* this set can be filled with multiple `ForceReuseVideoCodecReason` and avoid the black screen.
*
* Default is `null` i.e not set
*
* @platform Android
*/
forceReuseVideoCodecReasons?: Array<ForceReuseVideoCodecReason>;
}