Video player SDK for IFrame
You can embed a video player with content from Cloud Video to an HTML page using the video player SDK for IFrame.
To the page code, add the iframe
<iframe
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/...?autoplay=1&mute=1"
></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:
Configuring the video player options
You can set the video size and player startup options.
Warning
If you adjust more than two settings at the same time, the video will be played back muted.
Video size
To specify video size, set the following parameters in the iframe tag: height for height and width for width.
Here is an example:
<iframe width="560" height="315"
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>
To adjust the video to the container width, change the embed code as follows:
<div style="min-width: 100%">
<div style="position: relative; padding-bottom: 56.25%; height: 0;">
<iframe style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
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/...?autoplay=1&mute=true"
></iframe>
</div>
</div>
Player startup options
Customize your player appearance and video playback using special parameters.
Add parameter=value pairs separated by & to the embed code URL after ?:
https://runtime.video.cloud.yandex.net/player/...?param1=value1&...¶mN=valueN
You can see the list of parameters and their possible values in the table below. If you do not specify the parameters, the player will start with default parameters.
|
Parameter: |
Description: |
|
|
Auto video playback in mute mode at startup:
The |
|
|
Auto video playback at startup:
The default value is For the autoplay option to work correctly in all browsers, use the |
|
|
Time (in seconds) you want to start playback at. The values range from If you do not specify this parameter, your video will play from the beginning, and live stream, from the current moment. |
|
|
With this parameter, you can hide the player's interface elements. All of them are shown by default. List of interface elements
To hide several interface elements, provide a string of comma-separated values, e.g., Note We do not recommend using |
|
|
Player interface language. List of languages
If you do not specify the parameters or provide an unsupported value, the player interface language will be based on user data. |
|
|
Playback looping:
The default value is |
|
|
Mute at startup:
The default value is |
|
|
Scale the thumbnail to fit the screen size when loading a video:
The default value is |
|
|
Stopping playback if the player leaves the visible area and starting playback if the player is in it. The parameter affects both video content and ads. It can take the following values:
The default value is Note When set to |
|
|
Video preload:
The default value is When set to |
|
|
Volume at startup. The values range from If set to |
|
|
Background color of the player and widgets. Supports all colors in HEX |
|
|
Color of widget body text. Supports all colors in HEX |
|
|
Color of auxiliary widget text. Supports all colors in HEX |
|
|
Accent color of widget text. Supports all colors in HEX |
|
|
Background color of an active playlist element. Supports all colors in HEX |
|
|
Color of the player interface elements, i.e., the loading indicator, time scale, and play button on the start screen with Supports all colors in HEX |
|
|
Color of widget section separators. Supports all colors in HEX |
|
|
Rounding of the player section corners. The default value is |
|
|
Rounding of the playlist element corners. The default value is |
|
|
Padding between the player and playlist section. The default value is |
|
|
Padding between playlist elements. The default value is |