Skip to main content

Player Embed code

Use the following iframe code to load your video in a website. There are two variables in the src that needs to be specified to make it work.


Understanding the above code:

OTP and playbackInfoThese are obtained from either API or from the dashboard. They are meant to identify the video and provide access to view the video. It is generated by your backend application after verifying access. Learn more about how and why to generate OTP here.
allow="encrypted-media"This is required to play encrypted video in Chrome based browsers. It is not required on Firefox. The allow attribute is a relatively new addition to the web specifications and sometimes an old HTML editor might remove it mistakenly.
allowfullscreenrequired for the full screen button to work.
style=This part is a suggested style for the video player. The height and width mentioned here are assuming a 16:9 aspect ratio. Feel free to modify these values to match your video and your websites aesthetics and layout. Also read the responsive section below.

Further more parameters can be passed in the url along with otp and playbackInfo see the Configuration options

Making it responsive

Responsive design means different things for different websites. That is why we give this control to you. Here is how the most common responsive embed will look like.

<div style="padding-top:52.73%;position:relative;">

Here the padding-top is a workaround for setting known aspect ratio to the player. If you are targeting modern browsers only, you can use CSS's aspect-ratio property which works better. 56.25% is obtained by percentage of 9/16 if the aspect-ratio is 16:9.

The max-width property makes the player takes up as much of the width as is available. If you have a vertical video, it will look better to change the style to accommodate for that.

About player versions

As part of the iframe src, you will notice a v2 after the hostname. This is the version of the player which will be loaded. Check our changelog to see the list of versions that we have released so far.

Recommended &#9989

The player is available also as v2.x and v2.x.x for each version release. As we release new versions, v2 and v2.x player scripts will get updated to reflect the latest in their series.

We will follow the semantic versioning patterns. v2.5.3 means the 2, 5 and 3 are major, minor and patch segments of the version number. Major version is updated when there is a breaking change. Minor version is updated when there are new APIs added. Patch version is updated when the change is all internal and does no outside change.

Setting the player version to v2 means that you will get all the updates in the v2.x.x series. So, the player script will update automatically to reflect the latest version. If you set the player version to v2.3 like below, you will receive updates of v2.3.x series. As long as the minor version is not updated, you will continue to receive changes.

NOT Recommended &#10062

It is recommended to not specify exact version so that you can receive updates automatically.

We try our best to ensure that breaking changes do not happen. But using the API means that there are always unique combinations of situations in which these methods and events can be used. We strongly suggest staying with v2 directly if you are using separate iframe embeds for each page because it is difficult to update each page. Even for API embeds, it is safe and better to stay with v2.

The option to specify exact versions is available in case you want greater stability at the cost of the slow updates. If you go with this option, you will have to manually update the version number wih each update. There is a changelog that you can access to know the changes that are coming in each version update.

In case of security issues or critical browser incompatibility which results in video not being able to play, we can publish update directly to existing player versions.

Learn more about the OTP and playbackInfo