DASH#
The DASH module enables DASH (Dynamic Adaptive Streaming over HTTP) playback in KWIKplayer using Shaka Player configurations.
Initialization#
To enable DASH support need to add in following options:
window.initPlayer('my-video', {
shakaConfig: {
abr: { enabled: false },
drm: {
servers: {
'com.widevine.alpha': 'https://license-server.example.com',
},
clearKeys: {
'key-id': 'key-value',
},
},
manifest: {
retryParameters: { maxAttempts: 3 },
},
streaming: {
bufferingGoal: 30,
rebufferingGoal: 15,
},
licenseServerAuth: async (a, b, c) => {
console.log('Custom license server logic');
},
},
})
Options#
Option | Type | Description |
---|
abr | AbrConfiguration | Configures adaptive bitrate streaming. |
drm | DrmConfiguration | Configures DRM options, including servers and keys. |
manifest | ManifestConfiguration | Configures manifest retry parameters. |
streaming | StreamingConfiguration | Configures streaming buffer and rebuffering goals. |
licenceServerAuth | RequestFilter | Function to handle license server requests. |
AbrConfiguration#
Option | Type | Description |
---|
enabled | boolean | Enables or disables ABR (Adaptive Bitrate Streaming). |
DrmConfiguration#
Option | Type | Description |
---|
advanced | Record<string, shaka.extern.AdvancedDrmConfiguration> | null | Advanced DRM configuration for specific key systems. |
clearKeys | Record<string, string> | A map of clear key IDs to their corresponding keys. |
servers | `Record<string, string> | A map of license servers for various key systems. |
AdvancedDrmConfiguration#
Option | Type | Description |
---|
audioRobustness | string | Specifies robustness for audio streams. |
headers | Record<string, string> | Sets custom headers for license requests. |
sessionType | string | Configures the session type. |
videoRobustness | string | Specifies robustness for video streams. |
ManifestConfiguration#
Option | Type | Description |
---|
retryParameters | RetryParameters | Retry parameters for manifest fetching. |
RetryParameters#
Option | Type | Description |
---|
maxAttempts | number | Retry parameters for manifest fetching. |
StreamingConfiguration#
Option | Type | Description |
---|
bufferBehind | number | Time (in seconds) of content to keep in buffer behind the playhead. |
bufferingGoal | number | Target buffer length (in seconds). |
rebufferingGoal | number | Buffer length (in seconds) required before resuming playback after buffering. |
RequestFilter#
A function that processes a request before it is sent, allowing customization or filtering.
Parameter | Type | Description |
---|
a | number | The first argument, typically used for request type or identifier. |
b | Record<string, any> | The second argument, representing request parameters or headers. |
c | Record<string, any> | An optional third argument, often used for additional request context or data. |
Returns | Promise<any> | void | A promise resolving with a result or void for no asynchronous operations. |