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-control");
|
||||||
smallCastButton.addClass("vjs-button");
|
smallCastButton.addClass("vjs-button");
|
||||||
|
|
||||||
let loadScreen = true;
|
player.on("play", () => {
|
||||||
player.one("play", () => {
|
|
||||||
loadScreen = false;
|
|
||||||
player.removeChild(bigCastButton);
|
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);
|
||||||
@ -75,15 +76,9 @@
|
|||||||
});
|
});
|
||||||
player.on("chromecastDevicesAvailable", () => {
|
player.on("chromecastDevicesAvailable", () => {
|
||||||
player.controlBar.addChild(smallCastButton);
|
player.controlBar.addChild(smallCastButton);
|
||||||
if(loadScreen) {
|
|
||||||
player.addChild(bigCastButton);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.on("chromecastDevicesUnvailable", () => {
|
player.on("chromecastDevicesUnvailable", () => {
|
||||||
player.controlBar.removeChild(smallCastButton);
|
player.controlBar.removeChild(smallCastButton);
|
||||||
if(loadScreen) {
|
|
||||||
player.removeChild(bigCastButton);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
document.addEventListener("DOMContentLoaded", handleCount);
|
document.addEventListener("DOMContentLoaded", handleCount);
|
||||||
|
Loading…
Reference in New Issue
Block a user