1. Home
  2. The Iframe Bridge

The Iframe Bridge


Contents

In order to overcome the drawbacks of iframe embedding (detailed here ), you can make use of our iframe bridge, either the stand-alone version, which can be included from https://cdn.bluebillywig.com/scripts/bbiframebridge/latest/bbiframebridge-standalone.js , or the NPM package: https://github.com/bluebillywig/bbiframebridge/

Using the stand-alone version allows for Subresource Integrity (SRI, https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity ). You would then use a pinned version of the script, together with its cryptographic digest (“hash”):

<script 
  src="https://cdn.bluebillywig.com/scripts/bbiframebridge/20241111.083828/bbiframebridge-standalone.js"
  integrity="sha384-EuayaG0TKrE+sPHHuSTk0N6JYtZDALYeBxtrFwwgny4zMk/3hVQZXC7R4yr9Dn5Y"
  crossorigin="anonymous"></script>

Usage

After bootstrapping the bridge already works for going fullscreen and for local storage.

If you look up the bridge instance for an iframe you want to control (e.g. window.bluebillywig.BBIframeBridges[0] ), you can issue callChild commands (e.g. ‘play’, ‘pause’), or callChildPromise commands when the return value matters (e.g. ‘getDuration’, ‘getPlayoutData’). See the player API.

const br = bluebillywig.BBIframeBridges[0];
const playoutData = await br.callChildPromise('getPlayoutData');

Was this article helpful?

Contact Support
Can't find the answer you're looking for?
Contact Support