Interface MKPlayerConfig

MKPlayer SDK configuration interface.

interface MKPlayerConfig {
    adaptation?: MKAdaptationPlatformConfig;
    advertising?: MKAdvertisingConfig;
    analytics?: false | MKAnalyticsConfig;
    appId?: string;
    buffer?: MKBufferConfig;
    cast?: MKCastConfig;
    enableAdTrackingBeacons?: boolean;
    enableGooglePal?: boolean;
    enableHlsImageMediaPlaylistSupport?: boolean;
    enableSecureUrl?: boolean;
    enableSubtitleOverlay?: boolean;
    enableWidevineEncryption?: boolean;
    events?: MKPlayerEventConfig;
    key: string;
    log?: MKLogConfig;
    playback?: MKPlaybackConfig;
    ssaiAdConfig?: MKSsaiAdConfig;
    style?: MKStyleConfig;
    tweaks?: MKTweaksConfig;
    ui?: boolean;
}

Properties

Adaptation configuration.

advertising?: MKAdvertisingConfig

Allows you to define which ads you want to display and when you want to display them. In order to play ads on your website, you need to specify an ad config.

Only applicable for Client-Side Ad Insertion (CSAI).

analytics?: false | MKAnalyticsConfig

Bundled Analytics Configuration used to specify metadata and other related info.

Can also be used to completely disable Analytics by setting this to false in case the Analytics module is loaded, but Analytics is not desired.

Disabled when not set.

For more information, please see documentation for MKAnalyticsConfig.

appId?: string

Application Identifier / Bundle Identifier for retail device native application.

This is required to set for retail devices native applications e.g. Tizen, LG WebOS, etc.

Buffer configuration.

Google Cast Configuration

enableAdTrackingBeacons?: boolean

Enable SSAI Ad Tracking beacons.

When false, SDK doesn't notify any tracking URLs (including pauseAd tracking URLs, MKPauseAd).

Default is true (enabled).

enableGooglePal?: boolean

Enable GooglePal.

Default is false.

Note: this is applicable only for registered sources.

enableHlsImageMediaPlaylistSupport?: boolean

Enable HLS image media playlist support.

Default is false (disabled)

enableSecureUrl?: boolean

Generates signatures to secure the playback HTTP requests.

Note: this is applicable only for registered sources.

enableSubtitleOverlay?: boolean

Enable captions and subtitle overlay.

To process subtitle cue events and render subtitles/captions yourself, you must set this setting to false to disable SDK's internal subtitle/captions overlay.

Default is true (enabled). However, when MKPlayerConfig.ui is enabled custom subtitle overlay is disabled. So to use subtitle overlay you must keep MKPlayerConfig.ui disabled.

enableWidevineEncryption?: boolean

Enable Widevine License Encryption.

Note:

  • This is applicable only for registered sources.
  • KSS URL is required for this support.

A mapping of MKPlayerEvent values to event handler callback functions.

Events can also be dynamically added and removed through MKPlayerAPI.on and MKPlayerAPI.off.

Example:

events: {
[MKPlayerEvent.SourceLoaded]: (data) => {
console.log("Source loaded: ", data);
},
[MKPlayerEvent.Playing]: (data) => {
console.log("Video is playing: ", data);
},
[MKPlayerEvent.Error]: (data) => {
console.log("An error occurred: ", data);
}
}
key: string

Player license key.

Log configuration.

playback?: MKPlaybackConfig

Playback configuration.

ssaiAdConfig?: MKSsaiAdConfig

Ssai Ad Configuration

UX/UI config settings.

Player Tweaks.

Note: Use these only if you know what you are doing.

ui?: boolean

Enable or disable default player UI.

When enabled, ensure that mkplayer-ui.css is added as part of your HTML document.

Default is false.