Skip to main content

Embed Player into Website

You can integrate BlendVision's video/audio on demand (VOD/AOD) and live streaming services into your website using the iframe player.

Below is a template to embed a video player on your site. The parameters for configuring the iframe are detailed below.

<iframe
src="https://showroom.one.blendvision.com/embed?token=resource_token&lang=en&t=0&shareUrl=example.com"
width="640"
height="360"
allow="autoplay; encrypted-media; clipboard-write"
frameborder="0"
allowfullscreen>
</iframe>

<script>
window.addEventListener('message', event => {
if (event.data.command === 'ping') {
Array.from(document.querySelectorAll('iframe')).forEach(iframe =>
iframe?.contentWindow?.postMessage({ command: 'pong' }, '*')
);
}
});
</script>

Iframe Attributes

AttributesDescription
srcThe URL of the video or audio to embed. Use a valid URL like https://showroom.one.blendvision.com/embed. The URL can have query parameters for customization. See Supported Parameters for details.
widthSpecifies the width of the embedded window. It can be defined in pixels or as a percentage (e.g., 50%).
heightSpecifies the height of the embedded window. It can be defined in pixels or as a percentage (e.g., 50%).

Supported Parameters

ParametersDescription
tokenFollow the instructions to acquire the resource_token.
langLanguage setting for the player interface. Supported values are zh for Chinese, ja for Japanese, and en for English.
tSpecifies the initial playback start time in seconds when the player is loaded.
shareUrlThe URL used for sharing on social media. If not specified, it defaults to https://showroom.one.blendvision.com?token=resource_token.
autoplayDetermines if the video should start playing automatically.
object_fitSpecifies how the video should adjust to fit its container:
contain: The video preserves its aspect ratio and fits within the container, potentially adding letterboxing if the aspect ratios differ.
cover: The video maintains its aspect ratio and fills the entire container, possibly clipping the video if the aspect ratios differ.
fill: The video stretches to completely fill the container, which may change its aspect ratio.

Obtain Resource Token

You can obtain the resource token in two ways:

If your content is set as public, you can directly obtain the iframe with resource_token for each content from:

  • VOD > Publishing Tools > iframe
  • Live > Publishing Tools > iframe