Quickstart - embed Player Layer

Get Player Layer setup on your player in 5 minutes!

The Player Layer SDK for JavaScript provides a rich set of functionality that enables you to use the power of the Monterosa / Interaction Cloud to make your video player interactive and shoppable. To learn more about Player Layer read Core Concepts.

This guide will show you how to inject the Player Layer SDK into your webpage and connect it with your video player.

The Player Layer SDK is currently in pre-release and is constantly evolving without notice. It is currently supported within most modern web browsers. Native support is coming soon.

Before you begin, you will need a login to the Interaction Cloud, and your relationship manager will need to associate your account with a staging project. They will also provide you with a Client Key

Basic Setup

The Player Layer SDK contains the core functionality and is included alongside a player adapter script, specific to your player. The adapter connects Player Layer to your video player to ensure a tight coupling and understanding.

For most video players, this will be one of a standard set of adapters made available and bundled with Player Layer.

Currently in pre-release, please talk to your relationship manager for the availability of adapters. See Supported Platforms for current availability.

To embed Player Layer onto your webpage you only need 2 lines of code! The first injects the core Player Layer library and the second includes all of its CSS styles.

<script src="//apps.monterosa.cloud/pl/1.24.3/web/main.js"></script>
<link rel="stylesheet" href="//apps.monterosa.cloud/pl/1.24.3/web/styles.css">

Once added, create an instance of Player Layer and specify the following parameters:

const pl = new PlayerLayer({
  clientKey: <String>,
  playerAdapter: <PlayerLayerAdapter> or <defaultAdapterString>,
  playerContainer: <HTMLElement>,
  playerInstance: <Object>,
  contentId: <String> // optional
  eventId: <String> // optional
  authData: <Object> // optional 
});

//initialise Player Layer
pl.init();

clientKey: Provided to you by your relationship manager. If you don't have a key from us you can contact us here.

This is what authorises your Player Layer instance and manages the connection to our Interaction Cloud.

playerAdapter: Either the name of one of the adaptors we provide or a custom adaptor that is tailored specifically for your player.

We provide a few adapters out of the box for you to use (details here) but if we have not provided an adapter you can use this parameter to pass in your own. Details on how to create one are here.

playerContainer: The HTML element with the dimensions and position of the player, to which Player Layer will be attached as a child.

This controls where exactly on your site that Player Layer will be positioned and sized.

playerInstance: The object name of your video player instance. Used for communicating with your player through the adapters.

contentId (the videoId string related to your video for your player) or eventId (the id of real event on the studio)

To connect Player Layer to a specific event within your Studio project you can either pass the specific ID of that event using the eventId parameter or for a more seamless setup process pass in your contentId for each video. This ID can be your unique video reference that you may already have set up. This ID can then be added into the 'event settings' tab within Studio to link events to videos.

authData can include next properties :

  • authorization - (Boolean) toggled on/off authorization using Monterosa ID.

  • strategy - (String) auth strategy can be email, phone

  • provider - (String) auth provider can be google, facebook, apple, aws, lwa

  • accessToken - (String) token

This is an optional parameter that will authenticate users using our ID solution, if you would link to discuss using our authentication system please reach out to your relationship manager or contact us here.

Once you have an instance of Player Layer ready run pl.init();

Thats it! Player Layer will now add interactivity onto your videos. Player Layer will connect to the Interaction Cloud, recognise events and allow you to place and control Layers in real time.

Adapters & Advertising

To enable a tight synergy between your player and Player Layer and other advanced features such as advertising, see the Adapter Setup guide.

Next steps

Last updated