simplify cast
This commit is contained in:
		@@ -56,31 +56,20 @@
 | 
			
		||||
        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");
 | 
			
		||||
        smallCastButton.addClass("fa-chromecast");
 | 
			
		||||
        smallCastButton.addClass("vjs-control");
 | 
			
		||||
        smallCastButton.addClass("vjs-button");
 | 
			
		||||
 | 
			
		||||
        player.controlBar.addChild(smallCastButton);
 | 
			
		||||
        player.on("play", () => {
 | 
			
		||||
            player.controlBar.removeChild(bigCastButton);
 | 
			
		||||
        });
 | 
			
		||||
        player.on("chromecastConnected", () => {
 | 
			
		||||
            console.log(player.chromecastSessionManager.remotePlayer.volumeLevel);
 | 
			
		||||
            if(player.volume() > 0.3) {
 | 
			
		||||
                player.volume(0.2);
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
        player.on("chromecastDevicesAvailable", () => {
 | 
			
		||||
            player.controlBar.addChild(smallCastButton);
 | 
			
		||||
        });
 | 
			
		||||
        player.on("chromecastDevicesUnvailable", () => {
 | 
			
		||||
            player.controlBar.removeChild(smallCastButton);
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
    document.addEventListener("DOMContentLoaded", handleCount);
 | 
			
		||||
    xhr.addEventListener("load", handleCount);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user