Getting Started with the video player SDK for JavaScript
Written by
Updated at February 12, 2026
You can integrate a video player with content from Cloud Video into your JavaScript
Adding a player to your page
To connect a player to a page, add the following code to it:
<script src="https://runtime.video.cloud.yandex.net/player/js/player-sdk.js"></script>
Initializing a player
To initialize a player, add the following code to the page:
var player = Ya.playerSdk.init({
/** @type {(string|HTMLElement)} to create the player in */
element: 'video-player',
/** @type {string} link to playable content */
source: 'https://runtime.video.cloud.yandex.net/player/...',
/** @type {boolean} autoplay when loading content */
autoplay: false
});
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:
For more information on initializing a player, see:
- Player initialization parameters
- Interface: PlayerSdkInitConfig in the API reference
- Interface: PlayerSdkSourceParams in the API reference
Player controls
For information on player control methods, see:
- Player methods
- Interface: PlayerSdkApi in the API reference
Player state
For information about the object containing player state parameters, see:
- Player state
- Interface: PlayerSdkState in the API reference
Player events
For information about player events, see:
- Player events
- Interface: PlayerSdkEventHandlers in the API reference