add cast button

This commit is contained in:
Roy Olav Purser 2021-05-21 14:19:12 +02:00
parent 560928bc6e
commit 99ba95bd25
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -54,6 +54,14 @@
bigCastButton.addClass("vjs-control"); bigCastButton.addClass("vjs-control");
bigCastButton.addClass("vjs-button"); bigCastButton.addClass("vjs-button");
bigCastButton.addClass("vjs-big-chromecast"); bigCastButton.addClass("vjs-big-chromecast");
player.addChild(bigCastButton);
player.on("play", () => {
bigCastButton.hide();
});
player.on("pause", () => {
bigCastButton.show();
});
const smallCastButton = new Button(player, cbutton); const smallCastButton = new Button(player, cbutton);
smallCastButton.addClass("fab"); smallCastButton.addClass("fab");
@ -61,13 +69,6 @@
smallCastButton.addClass("vjs-control"); smallCastButton.addClass("vjs-control");
smallCastButton.addClass("vjs-button"); smallCastButton.addClass("vjs-button");
player.on("play", () => {
player.removeChild(bigCastButton);
});
player.on("pause", () => {
player.addChild(bigCastButton);
});
player.on("chromecastConnected", () => { player.on("chromecastConnected", () => {
console.log(player.chromecastSessionManager.remotePlayer.volumeLevel); console.log(player.chromecastSessionManager.remotePlayer.volumeLevel);
if(player.volume() > 0.3) { if(player.volume() > 0.3) {