Utility API and PlayerConfigBuilder
ConfigBuilderLowLatencyOptions
Type
ConfigBuilderLowLatencyOptions =
object
Options for the low latency configuration builder.
Properties
targetLatency?
optionaltargetLatency?:number
The desired target latency in seconds.
Default: 5
OptimizeForPlatformInput
Type
OptimizeForPlatformInput =
object
Input type for supporting various different platform specifics
Properties
appId?
optionalappId?:string
Required if your application is loaded through the file protocol.
PlayerConfigBuilder
Class
Builder to simplify the configuration process of the player.
Constructors
Constructor
new PlayerConfigBuilder(
playerKeyOrConfig):PlayerConfigBuilder
Creates a new PlayerConfigBuilder instance.
Either a player key or an existing player configuration can be provided.
Any build steps that are executed later on may override the provided configuration.
Parameters
playerKeyOrConfig
string | PlayerConfig
The player key or an existing player configuration to start with.
Returns
PlayerConfigBuilder
Methods
build()
build():
PlayerConfig
Builds the finished configuration.
Returns
enableLowLatency()
enableLowLatency(
options?):this
Enables low latency live playback.
Low latency live playback is supported for DASH streams with chunked CMAF segments and LL-HLS streams.
Applies the following to the player configuration:
- A low latency configuration with sensible default values
- A client-clock synchronization configuration using
https://time.akamai.com - Additional parameters in player tweaks to facilitate low latency playback
Default LowLatencyConfig:
{
targetLatency: 5,
catchup: {
playbackRateThreshold: 0.075,
seekThreshold: 5,
playbackRate: 1.2,
},
fallback: {
playbackRateThreshold: 0.075,
seekThreshold: 5,
playbackRate: 0.95,
},
}Parameters
options?
ConfigBuilderLowLatencyOptions
Optional parameters to customize the low latency configuration.
Returns
this
mergeWith()
mergeWith(
config):this
Merges the given configuration into the current configuration.
The given configuration will overwrite any existing values in the current configuration.
This can be called at any point during the configuration building process, allowing you to control which part
of the configuration you want to override.
Parameters
config
Partial<PlayerConfig>
The configuration to merge into the current configuration.
Returns
this
optimizeForPlatform()
optimizeForPlatform(
input?):this
Optimizes for each platform based on best practices.
Supports config optimization for WebOs and Tizen.
Parameters
input?
Required for platform specifics like the input.appId
Returns
this
UtilApi
Interface
The util API is exposed on the global namespace under bitmovin.player.util
Properties
PlayerConfigBuilder
PlayerConfigBuilder: typeof
PlayerConfigBuilder