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#

OptionTypeDescription
abrAbrConfigurationConfigures adaptive bitrate streaming.
drmDrmConfigurationConfigures DRM options, including servers and keys.
manifestManifestConfigurationConfigures manifest retry parameters.
streamingStreamingConfigurationConfigures streaming buffer and rebuffering goals.
licenceServerAuthRequestFilterFunction to handle license server requests.

AbrConfiguration#

OptionTypeDescription
enabledbooleanEnables or disables ABR (Adaptive Bitrate Streaming).

DrmConfiguration#

OptionTypeDescription
advancedRecord<string, shaka.extern.AdvancedDrmConfiguration> | nullAdvanced DRM configuration for specific key systems.
clearKeysRecord<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#

OptionTypeDescription
audioRobustnessstringSpecifies robustness for audio streams.
headersRecord<string, string>Sets custom headers for license requests.
sessionTypestringConfigures the session type.
videoRobustnessstringSpecifies robustness for video streams.

ManifestConfiguration#

OptionTypeDescription
retryParametersRetryParametersRetry parameters for manifest fetching.

RetryParameters#

OptionTypeDescription
maxAttemptsnumberRetry parameters for manifest fetching.

StreamingConfiguration#

OptionTypeDescription
bufferBehindnumberTime (in seconds) of content to keep in buffer behind the playhead.
bufferingGoalnumberTarget buffer length (in seconds).
rebufferingGoalnumberBuffer length (in seconds) required before resuming playback after buffering.

RequestFilter#

A function that processes a request before it is sent, allowing customization or filtering.

ParameterTypeDescription
anumberThe first argument, typically used for request type or identifier.
bRecord<string, any>The second argument, representing request parameters or headers.
cRecord<string, any>An optional third argument, often used for additional request context or data.
ReturnsPromise<any> | voidA promise resolving with a result or void for no asynchronous operations.