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