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,9 +51,11 @@
button.addClass("vjs-control"); button.addClass("vjs-control");
button.addClass("vjs-button"); button.addClass("vjs-button");
button.addClass("vjs-big-chromecast"); button.addClass("vjs-big-chromecast");
player.addChild(button); player.one("chromecastDevicesAvailable", () => {
player.one("play", (ev) => { player.addChild(button);
player.removeChild(button); player.one("play", () => {
player.removeChild(button);
});
}); });
} }
} }