add chromecast button if devices are available

This commit is contained in:
Roy Olav Purser 2021-05-20 15:07:33 +02:00
parent ae37908d64
commit 19532ee690
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -51,10 +51,12 @@
button.addClass("vjs-control");
button.addClass("vjs-button");
button.addClass("vjs-big-chromecast");
player.one("chromecastDevicesAvailable", () => {
player.addChild(button);
player.one("play", (ev) => {
player.one("play", () => {
player.removeChild(button);
});
});
}
}
document.addEventListener("DOMContentLoaded", handleCount);