Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Video
    • Overview
    • Control
      • Overview
        • Getting started
        • Player initialization parameters
        • Player methods
        • Player events
      • iOS
    • Troubleshooting
    • Browser autoplay policy
  • Access management
  • Pricing policy
  • Audit Trails events
  • Release notes

In this article:

  • Adding a player to your page
  • Initializing the SDK
  • Configuring player options
  • Player controls
  • Player events
  1. Video Player
  2. SDK
  3. IFrame
  4. Getting started

Getting started with the video player SDK for IFrame

Written by
Yandex Cloud
Updated at January 13, 2026
  • Adding a player to your page
  • Initializing the SDK
  • Configuring player options
  • Player controls
  • Player events

You can embed a video player with content from Cloud Video into your project using the Cloud Video Player SDK for IFrame. The SDK enables you to manage the player via the JavaScript API, using postMessage to communicate with the iframe.

Adding a player to your pageAdding a player to your page

To add a player to a page, add the iframe embed code:

<iframe
    id="video-player"
    frameborder="0"
    scrolling="no"
    allowfullscreen
    allow="autoplay; fullscreen; encrypted-media; accelerometer; gyroscope; picture-in-picture; clipboard-write; web-share; screen-wake-lock"
    src="https://runtime.video.cloud.yandex.net/player/..."
></iframe>

Where:

  • https://runtime.video.cloud.yandex.net/player/...: Link to playable content, e.g., https://runtime.video.cloud.yandex.net/player/video/vplvmyqsxi7dlwndvb4y. For more information, see these sections:
    • Getting an embed code or link to a video
    • Getting an embed code or link to a broadcast
    • Getting an embed code or link to a playlist

Initializing the SDKInitializing the SDK

To manage a player via JavaScript, get a reference to the iframe and use the postMessage method to send commands:

// Getting a reference to the iframe
var iframe = document.getElementById('video-player');
var player = iframe.contentWindow;

// Function for sending commands to the player
function sendCommand(method, params) {
    player.postMessage({
        method: method,
        ...params
    }, '*');
}

// Function for subscribing to player events
window.addEventListener('message', function(event) {
    if (event.data && event.data.event) {
        console.log('Player event:', event.data.event, event.data);
    }
});

Configuring player optionsConfiguring player options

You can configure the player options when creating the iframe by adding them to the URL as query parameters:

<iframe
    id="video-player"
    src="https://runtime.video.cloud.yandex.net/player/...?autoplay=1&mute=1"
></iframe>

For more information about player initialization parameters, see the following sections:

  • Player initialization parameters

Player controlsPlayer controls

For more info on how to manage the player, see Player methods.

Example of using methods:

// Start playback
sendCommand('play', {});

// Pause playback
sendCommand('pause', {});

// Seek to 30 seconds
sendCommand('seek', { time: 30 });

// Set the volume to 50%
sendCommand('setVolume', { volume: 0.5 });

Player eventsPlayer events

For details, see Player events.

Example of a subscription to events:

window.addEventListener('message', function(event) {
    if (!event.data || !event.data.event) return;
    
    switch(event.data.event) {
        case 'inited':
            console.log('Player initialized, vsid:', event.data.vsid);
            break;
        case 'started':
            console.log('Playback started');
            break;
        case 'paused':
            console.log('Playback paused');
            break;
        case 'timeupdate':
            console.log('Current time:', event.data.time);
            break;
    }
});

See alsoSee also

  • Player initialization parameters
  • Player methods
  • Player events

Was the article helpful?

Previous
Overview
Next
Player initialization parameters
© 2026 Direct Cursus Technology L.L.C.