diff --git a/frontend/script.js b/frontend/script.js index 2f64545..1f9d7d1 100644 --- a/frontend/script.js +++ b/frontend/script.js @@ -51,9 +51,11 @@ button.addClass("vjs-control"); button.addClass("vjs-button"); button.addClass("vjs-big-chromecast"); - player.addChild(button); - player.one("play", (ev) => { - player.removeChild(button); + player.one("chromecastDevicesAvailable", () => { + player.addChild(button); + player.one("play", () => { + player.removeChild(button); + }); }); } }