YTModalComponent

YTModalComponent can be attached to a button-like element to open a YouTube video within a full-screen, blacked-out modal dialog.

YTModalComponentOptions

Option Type Description Default
modalPlayer {YTModalPlayer} The modal player object to use. If not specified, a global singleton player object will be used. null

Example

Press the button below to open a YouTube modal dialog.

HTML

<button class="ytmodal" data-youtube-id="Q0CbN8sfihY">Open YT Modal</button>

SASS

@import 'airkit2/ytmodal/ytmodal'

JavaScript

import {Registry} from 'airkit2';
import {YTModalComponent} from 'airkit2/ytmodal';


const app = new Registry();
const ytmodalOptions = {};
app.register('ytmodal', YTModalComponent, ytmodalOptions);
document.addEventListener('DOMContentLoaded', () => {
  app.run();
});