Define the configuration parameters of Dash.js MediaPlayer.
- Source
- See
PlayerSettings
for further information about the supported configuration properties.
Type Definitions
AbandonRequestsRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
parameters | object | <optional> | {abandonDurationMultiplier=1.8, minSegmentDownloadTimeThresholdInMs=500, minThroughputSamplesThreshold=6} | Configures the rule specific parameters.
|
- Source
AbrRules
- Object
Name | Type | Attributes | Description |
---|---|---|---|
throughputRule | module:Settings~ThroughputRule | <optional> | Configuration of the Throughput rule |
bolaRule | module:Settings~BolaRule | <optional> | Configuration of the BOLA rule |
insufficientBufferRule | module:Settings~InsufficientBufferRule | <optional> | Configuration of the Insufficient Buffer rule |
switchHistoryRule | module:Settings~SwitchHistoryRule | <optional> | Configuration of the Switch History rule |
droppedFramesRule | module:Settings~DroppedFramesRule | <optional> | Configuration of the Dropped Frames rule |
abandonRequestsRule | module:Settings~AbandonRequestsRule | <optional> | Configuration of the Abandon Requests rule |
l2ARule | module:Settings~L2ARule | <optional> | Configuration of the L2A rule |
loLPRule | module:Settings~LoLPRule | <optional> | Configuration of the LoLP rule |
- Source
AbrSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
limitBitrateByPortal | boolean | <optional> | false | If true, the size of the video portal will limit the max chosen video resolution. |
usePixelRatioInLimitBitrateByPortal | boolean | <optional> | false | Sets whether to take into account the device's pixel ratio when defining the portal dimensions. Useful on, for example, retina displays. |
rules | module:Settings~AbrRules | <optional> | Enable/Disable individual ABR rules. Note that if the throughputRule and the bolaRule are activated at the same time we switch to a dynamic mode. l2ARule and loLPRule are ABR rules that are designed for low latency streams. They are tested as standalone rules meaning the other rules should be deactivated when choosing these rules. | |
throughput | module:Settings~ThroughputSettings | <optional> | Settings related to throughput calculation | |
maxBitrate | module:Settings~AudioVideoSettings | <optional> | {audio: -1, video: -1} | The maximum bitrate that the ABR algorithms will choose. This value is specified in kbps. Use -1 for no limit. |
minBitrate | module:Settings~AudioVideoSettings | <optional> | {audio: -1, video: -1} | The minimum bitrate that the ABR algorithms will choose. This value is specified in kbps. Use -1 for no limit. |
initialBitrate | module:Settings~AudioVideoSettings | <optional> | {audio: -1, video: -1} | Explicitly set the starting bitrate for audio or video. This value is specified in kbps. Use -1 to let the player decide. |
autoSwitchBitrate | module:Settings~AudioVideoSettings | <optional> | {audio: true, video: true} | Indicates whether the player should enable ABR algorithms to switch the bitrate. |
- Source
AudioVideoSettings
- Object
Name | Type | Attributes | Description |
---|---|---|---|
audio | number | | <optional> | Configuration for audio media type of tracks. |
video | number | | <optional> | Configuration for video media type of tracks. |
- Source
BolaRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
- Source
Buffer
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enableSeekDecorrelationFix | boolean | <optional> | false | Enables a workaround for playback start on some devices, e.g. WebOS 4.9. If you experience unexpected seeking triggered by BufferController, you can try setting this value to false. |
fastSwitchEnabled | boolean | <optional> | true | When enabled, after an ABR up-switch in quality, instead of requesting and appending the next fragment at the end of the current buffer range it is requested and appended closer to the current time. When enabled, The maximum time to render a higher quality is current time + (1.5 * fragment duration). Note, When ABR down-switch is detected, we appended the lower quality at the end of the buffer range to preserve the If enabled, it should be noted there are a few cases when the client will not replace inside buffer range but rather just append at the end.
Known issues:
|
flushBufferAtTrackSwitch | boolean | <optional> | false | When enabled, after a track switch and in case buffer is being replaced, the video element is flushed (seek at current playback time) once a segment of the new track is appended in buffer in order to force video decoder to play new track. This can be required on some devices like GoogleCast devices to make track switching functional. Otherwise, track switching will be effective only once after previous buffered track is fully consumed. |
reuseExistingSourceBuffers | boolean | <optional> | true | Enable reuse of existing MediaSource Sourcebuffers during period transition. |
bufferPruningInterval | number | <optional> | 10 | The interval of pruning buffer in seconds. |
bufferToKeep | number | <optional> | 20 | This value influences the buffer pruning logic. Allows you to modify the buffer that is kept in source buffer in seconds. |
bufferTimeDefault | number | <optional> | 18 | The time that the internal buffer target will be set to when not playing at the top quality. |
bufferTimeAtTopQuality | number | <optional> | 30 | The time that the internal buffer target will be set to once playing the top quality. If there are multiple bitrates in your adaptation, and the media is playing at the highest bitrate, then we try to build a larger buffer at the top quality to increase stability and to maintain media quality. |
bufferTimeAtTopQualityLongForm | number | <optional> | 60 | The time that the internal buffer target will be set to once playing the top quality for long form content. |
longFormContentDurationThreshold | number | <optional> | 600 | The threshold which defines if the media is considered long form content. This will directly affect the buffer targets when playing back at the top quality. |
initialBufferLevel | number | <optional> | NaN | Initial buffer level before playback starts |
stallThreshold | number | <optional> | 0.3 | Stall threshold used in BufferController.js to determine whether a track should still be changed and which buffer range to prune. |
useAppendWindow | boolean | <optional> | true | Specifies if the appendWindow attributes of the MSE SourceBuffers should be set according to content duration from manifest. |
setStallState | boolean | <optional> | true | Specifies if we fire manual waiting events once the stall threshold is reached. |
syntheticStallEvents | module:Settings~SyntheticStallSettings | <optional> | Specifies if manual stall events are to be fired once the stall threshold is reached. | |
avoidCurrentTimeRangePruning | boolean | <optional> | false | Avoids pruning of the buffered range that contains the current playback time. That buffered range is likely to have been enqueued for playback. Pruning it causes a flush and reenqueue in WPE and WebKitGTK based browsers. This stresses the video decoder and can cause stuttering on embedded platforms. |
useChangeType | boolean | <optional> | true | If this flag is set to true then dash.js will use the MSE v.2 API call "changeType()" before switching to a different codec family. |
mediaSourceDurationInfinity | boolean | <optional> | true | If this flag is set to true then dash.js will allow |
resetSourceBuffersForTrackSwitch | boolean | <optional> | false | When switching to a track that is not compatible with the currently active MSE SourceBuffers, MSE will be reset. This happens when we switch codecs on a system |
- Source
CachingInfoSettings
- Object
Name | Type | Attributes | Description |
---|---|---|---|
enable | boolean | <optional> | Enable or disable the caching feature. |
ttl | number | <optional> | Time to live. A value defined in milliseconds representing how log to cache the settings for. |
- Source
Capabilities
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
filterUnsupportedEssentialProperties | boolean | <optional> | true | Enable to filter all the AdaptationSets and Representations which contain an unsupported <EssentialProperty> element. |
supportedEssentialProperties | Array.<string> | <optional> | List of supported <EssentialProperty> elements | |
useMediaCapabilitiesApi | boolean | <optional> | true | Enable to use the MediaCapabilities API to check whether codecs are supported. If disabled MSE.isTypeSupported will be used instead. |
filterVideoColorimetryEssentialProperties | boolean | <optional> | false | Enable dash.js to query MediaCapabilities API for signalled Colorimetry EssentialProperties (per schemeIdUris: 'urn:mpeg:mpegB:cicp:ColourPrimaries', 'urn:mpeg:mpegB:cicp:TransferCharacteristics'). |
filterHDRMetadataFormatEssentialProperties | boolean | <optional> | false | Enable dash.js to query MediaCapabilities API for signalled HDR-MetadataFormat EssentialProperty (per schemeIdUri:'urn:dvb:dash:hdr-dmi'). |
- Source
CmcdSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
applyParametersFromMpd | boolean | <optional> | true | Set to true if dash.js should use the CMCD parameters defined in the MPD. |
enable | boolean | <optional> | false | Enable or disable the CMCD reporting. |
sid | string | <optional> | GUID identifying the current playback session. Should be in UUID format. If not specified a UUID will be automatically generated. | |
cid | string | <optional> | A unique string to identify the current content. If not specified it will be a hash of the MPD url. | |
rtp | number | <optional> | The requested maximum throughput that the client considers sufficient for delivery of the asset. If not specified this value will be dynamically calculated in the CMCDModel based on the current buffer level. | |
rtpSafetyFactor | number | <optional> | 5 | This value is used as a factor for the rtp value calculation: rtp = minBandwidth * rtpSafetyFactor If not specified this value defaults to 5. Note that this value is only used when no static rtp value is defined. |
mode | number | <optional> | "query" | The method to use to attach cmcd metrics to the requests. 'query' to use query parameters, 'header' to use http headers. If not specified this value defaults to 'query'. |
enabledKeys | Array.<string> | <optional> | This value is used to specify the desired CMCD parameters. Parameters not included in this list are not reported. | |
includeInRequests | Array.<string> | <optional> | Specifies which HTTP GET requests shall carry parameters. If not specified this value defaults to ['segment', 'mpd]. | |
version | number | <optional> | 1 | The version of the CMCD to use. If not specified this value defaults to 1. |
- Source
CmsdAbrSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
applyMb | boolean | <optional> | false | Set to true if dash.js should apply CMSD maximum suggested bitrate in ABR logic. |
etpWeightRatio | number | <optional> | 0 | Sets the weight ratio (between 0 and 1) that shall be applied on CMSD estimated throuhgput compared to measured throughput when calculating throughput. |
- Source
CmsdSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enabled | boolean | <optional> | false | Enable or disable the CMSD response headers parsing. |
abr | module:Settings~CmsdAbrSettings | <optional> | Sets additional ABR rules based on CMSD response headers. |
- Source
DebugSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
logLevel | number | <optional> | dashjs.Debug.LOG_LEVEL_WARNING | Sets up the log level. The levels are cumulative. For example, if you set the log level to dashjs.Debug.LOG_LEVEL_WARNING all warnings, errors and fatals will be logged. Possible values.
|
dispatchEvent | boolean | <optional> | false | Enable to trigger a Events.LOG event whenever log output is generated. Note this will be dispatched regardless of log level. |
- Source
DroppedFramesRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
parameters | object | <optional> | {minimumSampleSize=375, droppedFramesPercentageThreshold=0.15} | Configures the rule specific parameters.
|
- Source
ErrorSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
recoverAttempts | object | <optional> | {mediaErrorDecode: 5} | Defines the maximum number of recover attempts for specific media errors. For mediaErrorDecode the player will reset the MSE and skip the blacklisted segment that caused the decode error. The resulting gap will be handled by the GapController. |
- Source
EventSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
eventControllerRefreshDelay | number | <optional> | 100 | Interval timer used by the EventController to check if events need to be triggered or removed. |
deleteEventMessageDataAfterEventStarted | boolean | <optional> | true | If this flag is enabled the EventController will delete the message data of events after they have been started. This is to save memory in case events have a long duration and need to be persisted in the EventController. |
- Source
Gaps
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
jumpGaps | boolean | <optional> | true | Sets whether player should jump small gaps (discontinuities) in the buffer. |
jumpLargeGaps | boolean | <optional> | true | Sets whether player should jump large gaps (discontinuities) in the buffer. |
smallGapLimit | number | <optional> | 1.5 | Time in seconds for a gap to be considered small. |
threshold | number | <optional> | 0.3 | Threshold at which the gap handling is executed. If currentRangeEnd - currentTime < threshold the gap jump will be triggered. |
enableSeekFix | boolean | <optional> | true | Enables the adjustment of the seek target once no valid segment request could be generated for a specific seek time. This can happen if the user seeks to a position for which there is a gap in the timeline. |
enableStallFix | boolean | <optional> | false | If playback stalled in a buffered range this fix will perform a seek by the value defined in stallSeek to trigger playback again. |
stallSeek | number | <optional> | 0.1 | Value to be used in case enableStallFix is set to true |
- Source
InsufficientBufferRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
parameters | object | <optional> | {throughputSafetyFactor=0.7, segmentIgnoreCount=2} | Configures the rule specific parameters.
|
- Source
L2ARule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
- Source
LiveCatchupSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
maxDrift | number | <optional> | NaN | Use this method to set the maximum latency deviation allowed before dash.js to do a seeking to live position. In low latency mode, when the difference between the measured latency and the target one, as an absolute number, is higher than the one sets with this method, then dash.js does a seek to live edge position minus the target live delay. LowLatencyMaxDriftBeforeSeeking should be provided in seconds. If 0, then seeking operations won't be used for fixing latency deviations. Note: Catch-up mechanism is only applied when playing low latency live streams. |
playbackRate | number | <optional> | {min: NaN, max: NaN} | Use this parameter to set the minimum and maximum catch up rates, as percentages, for low latency live streams. In low latency mode, when measured latency is higher/lower than the target one, dash.js increases/decreases playback rate respectively up to (+/-) the percentage defined with this method until target is reached. Valid values for min catch up rate are in the range -0.5 to 0 (-50% to 0% playback rate decrease) Valid values for max catch up rate are in the range 0 to 1 (0% to 100% playback rate increase). Set min and max to NaN to turn off live catch up feature. These playback rate limits take precedence over any PlaybackRate values in ServiceDescription elements in an MPD. If only one of the min/max properties is given a value, the property without a value will not fall back to a ServiceDescription value. Its default value of NaN will be used. Note: Catch-up mechanism is only applied when playing low latency live streams. |
playbackBufferMin | number | <optional> | 0.5 | Use this parameter to specify the minimum buffer which is used for LoL+ based playback rate reduction. |
enabled | boolean | <optional> | null | Use this parameter to enable the catchup mode for non low-latency streams. |
mode | string | <optional> | "liveCatchupModeDefault" | Use this parameter to switch between different catchup modes. Options: "liveCatchupModeDefault" or "liveCatchupModeLOLP". Note: Catch-up mechanism is automatically applied when playing low latency live streams. |
- Source
LiveDelay
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
liveDelayFragmentCount | number | <optional> | NaN | Changing this value will lower or increase live stream latency. The detected segment duration will be multiplied by this value to define a time in seconds to delay a live stream from the live edge. Lowering this value will lower latency but may decrease the player's ability to build a stable buffer. |
liveDelay | number | <optional> | NaN | Equivalent in seconds of setLiveDelayFragmentCount. Lowering this value will lower latency but may decrease the player's ability to build a stable buffer. This value should be less than the manifest duration by a couple of segment durations to avoid playback issues. If set, this parameter will take precedence over setLiveDelayFragmentCount and manifest info. |
useSuggestedPresentationDelay | boolean | <optional> | true | Set to true if you would like to overwrite the default live delay and honor the SuggestedPresentationDelay attribute in by the manifest. |
- Source
LoLPRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
- Source
Metrics
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
metricsMaxListDepth | number | <optional> | 100 | Maximum number of metrics that are persisted per type. |
- Source
PlayerSettings
- Object
Name | Type | Attributes | Description |
---|---|---|---|
debug | module:Settings~DebugSettings | <optional> | Debug related settings. |
errors | module:Settings~ErrorSettings | <optional> | Error related settings |
streaming | module:Settings~StreamingSettings | <optional> | Streaming related settings. |
- Source
// Full settings object
settings = {
debug: {
logLevel: Debug.LOG_LEVEL_WARNING,
dispatchEvent: false
},
streaming: {
abandonLoadTimeout: 10000,
wallclockTimeUpdateInterval: 100,
manifestUpdateRetryInterval: 100,
liveUpdateTimeThresholdInMilliseconds: 0,
cacheInitSegments: false,
applyServiceDescription: true,
applyProducerReferenceTime: true,
applyContentSteering: true,
enableManifestDurationMismatchFix: true,
parseInbandPrft: false,
enableManifestTimescaleMismatchFix: false,
capabilities: {
filterUnsupportedEssentialProperties: true,
supportedEssentialProperties: [
{ schemeIdUri: Constants.FONT_DOWNLOAD_DVB_SCHEME },
{ schemeIdUri: Constants.COLOUR_PRIMARIES_SCHEME_ID_URI, value: /1|5|6|7/ },
{ schemeIdUri: Constants.URL_QUERY_INFO_SCHEME },
{ schemeIdUri: Constants.EXT_URL_QUERY_INFO_SCHEME },
{ schemeIdUri: Constants.MATRIX_COEFFICIENTS_SCHEME_ID_URI, value: /0|1|5|6/ },
{ schemeIdUri: Constants.TRANSFER_CHARACTERISTICS_SCHEME_ID_URI, value: /1|6|13|14|15/ },
...Constants.THUMBNAILS_SCHEME_ID_URIS.map(ep => { return { 'schemeIdUri': ep }; })
],
useMediaCapabilitiesApi: true,
filterVideoColorimetryEssentialProperties: false,
filterHDRMetadataFormatEssentialProperties: false
},
events: {
eventControllerRefreshDelay: 100,
deleteEventMessageDataAfterEventStarted: true
}
timeShiftBuffer: {
calcFromSegmentTimeline: false,
fallbackToSegmentTimeline: true
},
metrics: {
maxListDepth: 100
},
delay: {
liveDelayFragmentCount: NaN,
liveDelay: NaN,
useSuggestedPresentationDelay: true
},
protection: {
keepProtectionMediaKeys: false,
ignoreEmeEncryptedEvent: false,
detectPlayreadyMessageFormat: true,
ignoreKeyStatuses: false
},
buffer: {
enableSeekDecorrelationFix: false,
fastSwitchEnabled: true,
flushBufferAtTrackSwitch: false,
reuseExistingSourceBuffers: true,
bufferPruningInterval: 10,
bufferToKeep: 20,
bufferTimeAtTopQuality: 30,
bufferTimeAtTopQualityLongForm: 60,
initialBufferLevel: NaN,
bufferTimeDefault: 18,
longFormContentDurationThreshold: 600,
stallThreshold: 0.3,
useAppendWindow: true,
setStallState: true,
avoidCurrentTimeRangePruning: false,
useChangeType: true,
mediaSourceDurationInfinity: true,
resetSourceBuffersForTrackSwitch: false,
syntheticStallEvents: {
enabled: false,
ignoreReadyState: false
}
},
gaps: {
jumpGaps: true,
jumpLargeGaps: true,
smallGapLimit: 1.5,
threshold: 0.3,
enableSeekFix: true,
enableStallFix: false,
stallSeek: 0.1
},
utcSynchronization: {
enabled: true,
useManifestDateHeaderTimeSource: true,
backgroundAttempts: 2,
timeBetweenSyncAttempts: 30,
maximumTimeBetweenSyncAttempts: 600,
minimumTimeBetweenSyncAttempts: 2,
timeBetweenSyncAttemptsAdjustmentFactor: 2,
maximumAllowedDrift: 100,
enableBackgroundSyncAfterSegmentDownloadError: true,
defaultTimingSource: {
scheme: 'urn:mpeg:dash:utc:http-xsdate:2014',
value: 'http://time.akamai.com/?iso&ms'
}
},
scheduling: {
defaultTimeout: 500,
lowLatencyTimeout: 0,
scheduleWhilePaused: true
},
text: {
defaultEnabled: true,
dispatchForManualRendering: false,
extendSegmentedCues: true,
imsc: {
displayForcedOnlyMode: false,
enableRollUp: true
},
webvtt: {
customRenderingEnabled: false
}
},
liveCatchup: {
maxDrift: NaN,
playbackRate: {min: NaN, max: NaN},
playbackBufferMin: 0.5,
enabled: null,
mode: Constants.LIVE_CATCHUP_MODE_DEFAULT
},
lastBitrateCachingInfo: { enabled: true, ttl: 360000 },
lastMediaSettingsCachingInfo: { enabled: true, ttl: 360000 },
saveLastMediaSettingsForCurrentStreamingSession: true,
cacheLoadThresholds: { video: 10, audio: 5 },
trackSwitchMode: {
audio: Constants.TRACK_SWITCH_MODE_ALWAYS_REPLACE,
video: Constants.TRACK_SWITCH_MODE_NEVER_REPLACE
},
selectionModeForInitialTrack: Constants.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY,
fragmentRequestTimeout: 20000,
fragmentRequestProgressTimeout: -1,
manifestRequestTimeout: 10000,
retryIntervals: {
[HTTPRequest.MPD_TYPE]: 500,
[HTTPRequest.XLINK_EXPANSION_TYPE]: 500,
[HTTPRequest.MEDIA_SEGMENT_TYPE]: 1000,
[HTTPRequest.INIT_SEGMENT_TYPE]: 1000,
[HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]: 1000,
[HTTPRequest.INDEX_SEGMENT_TYPE]: 1000,
[HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]: 1000,
[HTTPRequest.LICENSE]: 1000,
[HTTPRequest.OTHER_TYPE]: 1000,
lowLatencyReductionFactor: 10
},
retryAttempts: {
[HTTPRequest.MPD_TYPE]: 3,
[HTTPRequest.XLINK_EXPANSION_TYPE]: 1,
[HTTPRequest.MEDIA_SEGMENT_TYPE]: 3,
[HTTPRequest.INIT_SEGMENT_TYPE]: 3,
[HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE]: 3,
[HTTPRequest.INDEX_SEGMENT_TYPE]: 3,
[HTTPRequest.MSS_FRAGMENT_INFO_SEGMENT_TYPE]: 3,
[HTTPRequest.LICENSE]: 3,
[HTTPRequest.OTHER_TYPE]: 3,
lowLatencyMultiplyFactor: 5
},
abr: {
limitBitrateByPortal: false,
usePixelRatioInLimitBitrateByPortal: false,
rules: {
throughputRule: {
active: true
},
bolaRule: {
active: true
},
insufficientBufferRule: {
active: true,
parameters: {
throughputSafetyFactor: 0.7,
segmentIgnoreCount: 2
}
},
switchHistoryRule: {
active: true,
parameters: {
sampleSize: 8,
switchPercentageThreshold: 0.075
}
},
droppedFramesRule: {
active: true,
parameters: {
minimumSampleSize: 375,
droppedFramesPercentageThreshold: 0.15
}
},
abandonRequestsRule: {
active: true,
parameters: {
abandonDurationMultiplier: 1.8,
minSegmentDownloadTimeThresholdInMs: 500,
minThroughputSamplesThreshold: 6
}
},
l2ARule: {
active: false
},
loLPRule: {
active: false
}
},
throughput: {
averageCalculationMode: Constants.THROUGHPUT_CALCULATION_MODES.EWMA,
lowLatencyDownloadTimeCalculationMode: Constants.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING,
useResourceTimingApi: true,
useNetworkInformationApi: {
xhr: false,
fetch: false
},
useDeadTimeLatency: true,
bandwidthSafetyFactor: 0.9,
sampleSettings: {
live: 3,
vod: 4,
enableSampleSizeAdjustment: true,
decreaseScale: 0.7,
increaseScale: 1.3,
maxMeasurementsToKeep: 20,
averageLatencySampleAmount: 4,
},
ewma: {
throughputSlowHalfLifeSeconds: 8,
throughputFastHalfLifeSeconds: 3,
latencySlowHalfLifeCount: 2,
latencyFastHalfLifeCount: 1,
weightDownloadTimeMultiplicationFactor: 0.0015
}
},
maxBitrate: {
audio: -1,
video: -1
},
minBitrate: {
audio: -1,
video: -1
},
initialBitrate: {
audio: -1,
video: -1
},
autoSwitchBitrate: {
audio: true,
video: true
}
},
cmcd: {
enabled: false,
sid: null,
cid: null,
rtp: null,
rtpSafetyFactor: 5,
mode: Constants.CMCD_MODE_QUERY,
enabledKeys: ['br', 'd', 'ot', 'tb' , 'bl', 'dl', 'mtp', 'nor', 'nrr', 'su' , 'bs', 'rtp' , 'cid', 'pr', 'sf', 'sid', 'st', 'v']
includeInRequests: ['segment', 'mpd'],
version: 1
},
cmsd: {
enabled: false,
abr: {
applyMb: false,
etpWeightRatio: 0
}
},
defaultSchemeIdUri: {
viewpoint: '',
audioChannelConfiguration: 'urn:mpeg:mpegB:cicp:ChannelConfiguration',
role: 'urn:mpeg:dash:role:2011',
accessibility: 'urn:mpeg:dash:role:2011'
}
},
errors: {
recoverAttempts: {
mediaErrorDecode: 5
}
}
}
Protection
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
keepProtectionMediaKeys | boolean | <optional> | false | Set the value for the ProtectionController and MediaKeys life cycle. If true, the ProtectionController and then created MediaKeys and MediaKeySessions will be preserved during the MediaPlayer lifetime. |
ignoreEmeEncryptedEvent | boolean | <optional> | false | If set to true the player will ignore "encrypted" and "needkey" events thrown by the EME. |
detectPlayreadyMessageFormat | boolean | <optional> | true | If set to true the player will use the raw unwrapped message from the Playready CDM |
ignoreKeyStatusest | boolean | <optional> | false | If set to true the player will ignore the status of a key and try to play the corresponding track regardless whether the key is usable or not. |
- Source
RequestTypeSettings
- Object
Name | Type | Attributes | Description |
---|---|---|---|
MPD | number | <optional> | Manifest type of requests. |
XLinkExpansion | number | <optional> | XLink expansion type of requests. |
InitializationSegment | number | <optional> | Request to retrieve an initialization segment. |
IndexSegment | number | <optional> | Request to retrieve an index segment (SegmentBase). |
MediaSegment | number | <optional> | Request to retrieve a media segment (video/audio/image/text chunk). |
BitstreamSwitchingSegment | number | <optional> | Bitrate stream switching type of request. |
FragmentInfoSegment | number | <optional> | Request to retrieve a FragmentInfo segment (specific to Smooth Streaming live streams). |
other | number | <optional> | Other type of request. |
lowLatencyReductionFactor | number | <optional> | For low latency mode, values of type of request are divided by lowLatencyReductionFactor. Note: It's not type of request. |
lowLatencyMultiplyFactor | number | <optional> | For low latency mode, values of type of request are multiplied by lowLatencyMultiplyFactor. Note: It's not type of request. |
- Source
Scheduling
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
defaultTimeout | number | <optional> | 500 | Default timeout between two consecutive segment scheduling attempts |
lowLatencyTimeout | number | <optional> | 0 | Default timeout between two consecutive low-latency segment scheduling attempts |
scheduleWhilePaused | boolean | <optional> | true | Set to true if you would like dash.js to keep downloading fragments in the background when the video element is paused. |
- Source
StreamingSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
abandonLoadTimeout | number | <optional> | 10000 | A timeout value in seconds, which during the ABRController will block switch-up events. This will only take effect after an abandoned fragment event occurs. |
wallclockTimeUpdateInterval | number | <optional> | 100 | How frequently the wallclockTimeUpdated internal event is triggered (in milliseconds). |
manifestUpdateRetryInterval | number | <optional> | 100 | For live streams, set the interval-frequency in milliseconds at which dash.js will check if the current manifest is still processed before downloading the next manifest once the minimumUpdatePeriod time has. |
liveUpdateTimeThresholdInMilliseconds | number | <optional> | 0 | For live streams, postpone syncing time updates until the threshold is passed. Increase if problems occurs during live streams on low end devices. |
cacheInitSegments | boolean | <optional> | false | Enables the caching of init segments to avoid requesting the init segments before each representation switch. |
applyServiceDescription | boolean | <optional> | true | Set to true if dash.js should use the parameters defined in ServiceDescription elements |
applyProducerReferenceTime | boolean | <optional> | true | Set to true if dash.js should use the parameters defined in ProducerReferenceTime elements in combination with ServiceDescription elements. |
applyContentSteering | boolean | <optional> | true | Set to true if dash.js should apply content steering during playback. |
enableManifestDurationMismatchFix | boolean | <optional> | true | Overwrite the manifest segments base information timescale attributes with the timescale set in initialization segments |
enableManifestTimescaleMismatchFix | boolean | <optional> | false | Defines the delay in milliseconds between two consecutive checks for events to be fired. |
parseInbandPrft | boolean | <optional> | false | Set to true if dash.js should parse inband prft boxes (ProducerReferenceTime) and trigger events. |
metrics | module:Settings~Metrics | Metric settings | ||
delay | module:Settings~LiveDelay | Live Delay settings | ||
events | module:Settings~EventSettings | Event settings | ||
timeShiftBuffer | module:Settings~TimeShiftBuffer | TimeShiftBuffer settings | ||
protection | module:Settings~Protection | DRM related settings | ||
capabilities | module:Settings~Capabilities | Capability related settings | ||
buffer | module:Settings~Buffer | Buffer related settings | ||
gaps | module:Settings~Gaps | Gap related settings | ||
utcSynchronization | module:Settings~UtcSynchronizationSettings | Settings related to UTC clock synchronization | ||
scheduling | module:Settings~Scheduling | Settings related to segment scheduling | ||
text | module:Settings~Text | Settings related to Subtitles and captions | ||
liveCatchup | module:Settings~LiveCatchupSettings | Settings related to live catchup. | ||
lastBitrateCachingInfo | module:Settings~CachingInfoSettings | <optional> | {enabled: true, ttl: 360000} | Set to false if you would like to disable the last known bit rate from being stored during playback and used to set the initial bit rate for subsequent playback within the expiration window. The default expiration is one hour, defined in milliseconds. If expired, the default initial bit rate (closest to 1000 kbps) will be used for that session and a new bit rate will be stored during that session. |
lastMediaSettingsCachingInfo | module:Settings~CachingInfoSettings | <optional> | {enabled: true, ttl: 360000} | Set to false if you would like to disable the last media settings from being stored to localStorage during playback and used to set the initial track for subsequent playback within the expiration window. The default expiration is one hour, defined in milliseconds. |
saveLastMediaSettingsForCurrentStreamingSession | boolean | <optional> | true | Set to true if dash.js should save media settings from last selected track for incoming track selection during current streaming session. |
cacheLoadThresholds | module:Settings~AudioVideoSettings | <optional> | {video: 10, audio: 5} | For a given media type, the threshold which defines if the response to a fragment request is coming from browser cache or not. |
trackSwitchMode | module:Settings~AudioVideoSettings | <optional> | {video: "neverReplace", audio: "alwaysReplace"} | For a given media type defines if existing segments in the buffer should be overwritten once the track is switched. For instance if the user switches the audio language the existing segments in the audio buffer will be replaced when setting this value to "alwaysReplace". Possible values
|
selectionModeForInitialTrack | string | <optional> | "highestSelectionPriority" | Sets the selection mode for the initial track. This mode defines how the initial track will be selected if no initial media settings are set. If initial media settings are set this parameter will be ignored. Available options are: Possible values
|
fragmentRequestTimeout | number | <optional> | 20000 | Time in milliseconds before timing out on loading a media fragment. |
fragmentRequestProgressTimeout | number | <optional> | -1 | Time in milliseconds before timing out on loading progress of a media fragment. |
manifestRequestTimeout | number | <optional> | 10000 | Time in milliseconds before timing out on loading a manifest. Fragments that timeout are retried as if they failed. |
retryIntervals | module:Settings~RequestTypeSettings | <optional> | Time in milliseconds of which to reload a failed file load attempt. For low latency mode these values are divided by lowLatencyReductionFactor. | |
retryAttempts | module:Settings~RequestTypeSettings | <optional> | Total number of retry attempts that will occur on a file load before it fails. For low latency mode these values are multiplied by lowLatencyMultiplyFactor. | |
abr | module:Settings~AbrSettings | Adaptive Bitrate algorithm related settings. | ||
cmcd | module:Settings~CmcdSettings | Settings related to Common Media Client Data reporting. | ||
cmsd | module:Settings~CmsdSettings | Settings related to Common Media Server Data parsing. | ||
defaultSchemeIdUri | module:Settings~defaultSchemeIdUri | Default schemeIdUri for descriptor type elements |
- Source
SwitchHistoryRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
parameters | object | <optional> | {sampleSize=8, switchPercentageThreshold=0.075} | Configures the rule specific parameters.
|
- Source
SyntheticStallSettings
- Object
Name | Type | Attributes | Description |
---|---|---|---|
enabled | boolean | <optional> | Enables manual stall events and sets the playback rate to 0 once the stall threshold is reached. |
ignoreReadyState | boolean | <optional> | Ignore the media element's ready state when entering or exiting a stall.
|
- Source
Text
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
defaultEnabled | boolean | <optional> | true | Enable/disable subtitle rendering by default. |
dispatchForManualRendering | boolean | <optional> | false | Enable/disable firing of CueEnter/CueExt events. This will disable the display of subtitles and should be used when you want to have full control about rendering them. |
extendSegmentedCues | boolean | <optional> | true | Enable/disable patching of segmented cues in order to merge as a single cue by extending cue end time. |
imsc.displayForcedOnlyMode | boolean | <optional> | false | Enable/disable forced only mode in IMSC captions. |
imsc.enableRollUp | boolean | <optional> | true | Enable/disable rollUp style display of IMSC captions. |
webvtt.customRenderingEnabled | object | <optional> | false | Enables the custom rendering for WebVTT captions. For details refer to the "Subtitles and Captions" sample section of dash.js. |
- Source
ThroughputRule
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active | boolean | <optional> | true | Enable or disable the rule |
- Source
ThroughputSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
averageCalculationMode | string | <optional> | Constants.THROUGHPUT_CALCULATION_MODES.EWMA | Defines the default mode for calculating the throughput based on the samples collected during playback. For arithmetic and harmonic mean calculations we use a sliding window with the values defined in "sampleSettings" For exponential weighted moving average calculation the default values can be changed in "ewma" |
lowLatencyDownloadTimeCalculationMode | string | <optional> | Constants.LOW_LATENCY_DOWNLOAD_TIME_CALCULATION_MODE.MOOF_PARSING | Defines the effective download time estimation method we use for low latency streams that utilize the Fetch API and chunked transfer coding |
useResourceTimingApi | boolean | <optional> | true | If set to true the ResourceTimingApi is used to derive the download time and the number of downloaded bytes. |
useNetworkInformationApi | object | <optional> | { xhr=false, fetch=false} | If set to true the NetworkInformationApi is used to derive the current throughput. Browser support is limited, only available in Chrome and Edge. |
useDeadTimeLatency | boolean | <optional> | true | If true, only the download portion will be considered part of the download bitrate and latency will be regarded as static. If false, the reciprocal of the whole transfer time will be used. |
bandwidthSafetyFactor | number | <optional> | 0.9 | Standard ABR throughput rules multiply the throughput by this value. It should be between 0 and 1, with lower values giving less rebuffering (but also lower quality) |
sampleSettings | object | <optional> | {live=3,vod=4,enableSampleSizeAdjustment=true,decreaseScale=0.7,increaseScale=1.3,maxMeasurementsToKeep=20,averageLatencySampleAmount=4} | When deriving the throughput based on the arithmetic or harmonic mean these settings define:
|
ewma | object | <optional> | {throughputSlowHalfLifeSeconds=8,throughputFastHalfLifeSeconds=3,latencySlowHalfLifeCount=2,latencyFastHalfLifeCount=1, weightDownloadTimeMultiplicationFactor=0.0015} | When deriving the throughput based on the exponential weighted moving average these settings define:
|
- Source
TimeShiftBuffer
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
calcFromSegmentTimeline | boolean | <optional> | false | Enable calculation of the DVR window for SegmentTimeline manifests based on the entries in <SegmentTimeline>.
|
- Source
UtcSynchronizationSettings
- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enabled | boolean | <optional> | true | Enables or disables the UTC clock synchronization |
useManifestDateHeaderTimeSource | boolean | <optional> | true | Allows you to enable the use of the Date Header, if exposed with CORS, as a timing source for live edge detection. The use of the date header will happen only after the other timing source that take precedence fail or are omitted as described. |
backgroundAttempts | number | <optional> | 2 | Number of synchronization attempts to perform in the background after an initial synchronization request has been done. This is used to verify that the derived client-server offset is correct. The background requests are async and done in parallel to the start of the playback. This value is also used to perform a resync after 404 errors on segments. |
timeBetweenSyncAttempts | number | <optional> | 30 | The time in seconds between two consecutive sync attempts. Note: This value is used as an initial starting value. The internal value of the TimeSyncController is adjusted during playback based on the drift between two consecutive synchronization attempts. Note: A sync is only performed after an MPD update. In case the @minimumUpdatePeriod is larger than this value the sync will be delayed until the next MPD update. |
maximumTimeBetweenSyncAttempts | number | <optional> | 600 | The maximum time in seconds between two consecutive sync attempts. |
minimumTimeBetweenSyncAttempts | number | <optional> | 2 | The minimum time in seconds between two consecutive sync attempts. |
timeBetweenSyncAttemptsAdjustmentFactor | number | <optional> | 2 | The factor used to multiply or divide the timeBetweenSyncAttempts parameter after a sync. The maximumAllowedDrift defines whether this value is used as a factor or a dividend. |
maximumAllowedDrift | number | <optional> | 100 | The maximum allowed drift specified in milliseconds between two consecutive synchronization attempts. |
enableBackgroundSyncAfterSegmentDownloadError | boolean | <optional> | true | Enables or disables the background sync after the player ran into a segment download error. |
defaultTimingSource | object | <optional> | {scheme:'urn:mpeg:dash:utc:http-xsdate:2014',value: 'http://time.akamai.com/?iso&ms'} | The default timing source to be used. The timing sources in the MPD take precedence over this one. |
- Source