Skip to main content

Introduction

Welcome to our web component-based player! This player features an updated design and comes with built-in controls for a seamless viewing experience. It is highly customizable and easy to integrate into your web applications.

Usage

JavaScript

import { registerComponents } from "@vindral/web-sdk/player"

registerComponents()

HTML

<vindral-player
url="https://lb.cdn.vindral.com"
channelId="vindral_demo1_ci_099ee1fa-80f3-455e-aa23-3d184e93e04f"
></vindral-player>

Attributes

AttributeTypeDescriptionDefault
urlstringURL to use when connecting to the streamhttps://lb.cdn.vindral.com
channel-idstringChannel ID to connect to initiallyN/A
channel-group-idstringChannel group to connect toN/A
pausedbooleanIf set, the player will start in a paused statefalse
mutedbooleanIf set, the player will start mutedfalse
authentication-tokenbooleanAuthentication token for channels with authentication enabledN/A
castbooleanIf set to "false", disables cast functionalitytrue
airplaybooleanIf set, enables AirPlay functionalityfalse
pipbooleanIf set to "false", disables Picture-in-Picture functionalitytrue
fullscreenbooleanIf set to "false", disables fullscreen functionalitytrue
posterboolean | stringURL of the image to show before the video playstrue
cast-receiver-idstringFor custom Cast Receivers, enter your Application Id hereN/A
languagestringInitial language to use when multiple languages are availableN/A
text-trackstringInitial text trackN/A
log-levelerror | warn | info |debug | trace | offSets the log levelinfo
min-buffer-timenumberSets the minimum and initial buffer timeN/A
max-buffer-timenumberSets the maximum buffer time allowedN/A
size-based-resolution-cap-enabledbooleanEnables or disables user bandwidth savings by capping the video resolution to the size of the video elementtrue
burst-enabledbooleanEnable bursting for initial connection and channel switchesfalse
mse-enabledbooleanEnable usage of the MediaSource API on supported browserstrue
mse-opus-enabledbooleanEnable Opus with the MediaSource API on supported browserstrue
ios-background-play-enabledbooleanEnable or disable support for playing audio in the background for iOS devicesfalse
abr-enabledbooleanEnable or disable Adaptive Bit Ratetrue
telemetry-enabledbooleanEnable or disable telemetry. This allows for telemetry and errors being collectedtrue
max-size{ width: number; height: number}Set a cap on the maximum video sizeN/A
max-audio-bit-ratenumberMaximum audio bit rate allowedN/A
max-video-bit-ratenumberMaximum video bit rate allowedN/A
ios-wake-lock-enabledbooleanEnable wake lock for iOS devicesfalse
ios-media-element-enabledbooleanEnables iOS devices to use a media element for playbacktrue
mediaaudio | video | audio+videoSet the type of media to play (audio only, video only, or both)audio+video
video-codecsh264 | av1Comma-separated list of video codecs to use, in order of priority (e.g., "av1,h264")N/A

Properties

AttributeTypeDescriptionDefault
instance Read onlyVindralVindral client instance, available after the 'vindral-instance-ready' event is firedN/A

Events

EventDescription
vindral-instance-readyFired when the Vindral instance is ready for use

CSS Variables

This is the list of CSS variables for showing/hiding specific controls.

vindral-player {
/* Hide all controls */
--vindral-ui-display: none;

--vindral-play-button-display: none;
--vindral-mute-button-display: none;
--vindral-airplay-button-display: none;
--vindral-pip-button-display: none;
--vindral-fullscreen-button-display: none;
--vindral-cast-button-display: none;
--vindral-grid-button-display: none;
--vindral-grid-item-offline-display: none;
--vindral-volume-range-display: none;
--vindral-rendition-menu-display: none;
--vindral-language-menu-display: none;
--vindral-play-overlay-display: none;
--vindral-buffering-overlay-display: none;
}

These CSS variables allow you to customize the appearance of the player.

vindral-player {
--vindral-fg-strong: #000000;
--vindral-fg-subtle: #666666;
--vindral-fg-extra-subtle: #999999;

--vindral-bg-strong: #ffffff;
--vindral-bg-subtle: #f2f2f2;
--vindral-bg-extra-subtle: #e6e6e6;

--vindral-bg-component: #cccccc;
--vindral-bg-component-hover: #b3b3b3;
--vindral-bg-component-active: #999999;

--vindral-padding-1: 4px;
--vindral-padding-2: 8px;
--vindral-padding-3: 12px;
--vindral-padding-4: 16px;
--vindral-padding-5: 32px;

--vindral-control-padding: 4px;
--vindral-button-padding: 8px;
--vindral-ui-font: Arial, sans-serif;
}