show big button regardless of chromecast being detected
This commit is contained in:
parent
45d9841743
commit
560928bc6e
@ -61,11 +61,12 @@
|
||||
smallCastButton.addClass("vjs-control");
|
||||
smallCastButton.addClass("vjs-button");
|
||||
|
||||
let loadScreen = true;
|
||||
player.one("play", () => {
|
||||
loadScreen = false;
|
||||
player.on("play", () => {
|
||||
player.removeChild(bigCastButton);
|
||||
});
|
||||
player.on("pause", () => {
|
||||
player.addChild(bigCastButton);
|
||||
});
|
||||
|
||||
player.on("chromecastConnected", () => {
|
||||
console.log(player.chromecastSessionManager.remotePlayer.volumeLevel);
|
||||
@ -75,15 +76,9 @@
|
||||
});
|
||||
player.on("chromecastDevicesAvailable", () => {
|
||||
player.controlBar.addChild(smallCastButton);
|
||||
if(loadScreen) {
|
||||
player.addChild(bigCastButton);
|
||||
}
|
||||
});
|
||||
player.on("chromecastDevicesUnvailable", () => {
|
||||
player.controlBar.removeChild(smallCastButton);
|
||||
if(loadScreen) {
|
||||
player.removeChild(bigCastButton);
|
||||
}
|
||||
});
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", handleCount);
|
||||
|
Loading…
Reference in New Issue
Block a user