MP_SDK
The entrypoint for connecting to the SDK and creating an MpSdk interface.
Methods
Methods
connect
connect: method — 3 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);
| Parameter | Type |
|---|---|
| target | ShowcaseBundleWindow 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>
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);
| Parameter | Type |
|---|---|
| target | HTMLIFrameElement 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>
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}, '');
| Parameter | Type |
|---|---|
| target | HTMLIFrameElement the iframe element containing the Showcase player |
| applicationKey | string the application key for SDK authorization |
| unused | '' unused, pass an empty string |
Returns: Promise<MpSdk>