bitmovin-player-react-native
Version:
Official React Native bindings for Bitmovin's mobile Player SDKs.
197 lines • 9.31 kB
TypeScript
/**
* 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 declare 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`.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks 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"
*
* @remarks 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.
*
* @remarks Platform: Android
*/
localDynamicDashWindowUpdateInterval?: number;
/**
* 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.
*
* @remarks 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.
*
* @remarks 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.
*
* @remarks Platform: Android
*/
useFiletypeExtractorFallbackForHls?: 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}
* @remarks 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
*
* @remarks Platform: Android
*/
forceReuseVideoCodecReasons?: ForceReuseVideoCodecReason[];
}
//# sourceMappingURL=tweaksConfig.d.ts.map