Skip to main content

MP_SDK

The entrypoint for connecting to the SDK and creating an MpSdk interface.

Methods

Methods

connect

connect: method3 overloads
connect(target: ShowcaseBundleWindow, options?: Partial<ConnectOptions>): Promise<MpSdk>

Bundle

Connect to the Bundle SDK and create an MpSdk interface.

const bundleIframe = document.getElementById<HTMLIFrameElement>('showcase');
const showcaseWindow = bundleIframe.contentWindow as ShowcaseBundleWindow;
showcaseWindow.MP_SDK.connect(showcaseWindow);
ParameterType
targetShowcaseBundleWindow
The window that Showcase was opened within. Can be the contentWindow of an iframe
options?Partial<ConnectOptions>
Additional, optional options to include while connect like auth tokens

Returns: Promise<MpSdk>

connect(target: HTMLIFrameElement, options?: Partial<ConnectOptions>): Promise<MpSdk>

Embed

Connect to the Embed SDK and create an MpSdk interface.

const showcaseIframe = document.getElementById<HTMLIFrameElement>('showcase');
const embeddingWindow = window as ShowcaseEmbedWindow;
embeddingWindow.MP_SDK.connect(showcaseIframe);
ParameterType
targetHTMLIFrameElement
The iframe of the embedded Showcase
options?Partial<ConnectOptions>
Additional, optional options to include while connect like auth tokens

Returns: Promise<MpSdk>

connect(target: HTMLIFrameElement, applicationKey: string, unused: ''): Promise<MpSdk>

Embed

Connect to the Embed SDK and create an MpSdk interface.

const showcaseIframe = document.getElementById<HTMLIFrameElement>('showcase');
const embeddingWindow = window as ShowcaseEmbedWindow;
embeddingWindow.MP_SDK.connect(showcaseIframe, `${APPLICATION_KEY}, '');
ParameterType
targetHTMLIFrameElement
the iframe element containing the Showcase player
applicationKeystring
the application key for SDK authorization
unused''
unused, pass an empty string

Returns: Promise<MpSdk>