@liveryvideo/interactive-bridge
v1.14.2
Published
Livery Video Interactive Bridge.
Downloads
1,703
Keywords
Readme
Livery Video Interactive Bridge
Bridge for communicating between a Livery Video Player and the interactive layer page shown within that.
Please refer to our docs page for further information.
You can also view the CHANGELOG and API documentation that are included in this NPM package from there.
Installation
npm install @liveryvideo/interactive-bridge
Usage
The main class to be used from this package is the InteractiveBridge:
import { InteractiveBridge } from '@liveryvideo/interactive-bridge';
// The playerBridge will be provided to you as interactive element as interactive webview or iframe
const bridge = new InteractiveBridge(playerBridge || '*');
// To prevent cross site security issues:
// https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#security_concerns
// replace the `'*'` origin above with the origin of the page that the Livery Player is on
bridge.getAppName().then(appName => window.alert(`appName: ${appName}`));