From 202f1344a83ae84cd8d2e9da758da6fce40ca6ad Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sun, 23 May 2021 22:02:33 +0200 Subject: [PATCH] add cast button on video load success --- frontend/script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/script.js b/frontend/script.js index 48026ff..faac55e 100644 --- a/frontend/script.js +++ b/frontend/script.js @@ -54,7 +54,10 @@ bigCastButton.addClass("vjs-control"); bigCastButton.addClass("vjs-button"); bigCastButton.addClass("vjs-big-chromecast"); - player.addChild(bigCastButton); + + player.one("canplay", () => { + player.addChild(bigCastButton); + }); const smallCastButton = new Button(player, cbutton); smallCastButton.addClass("fab");