put font-awesome cast icon in span
This commit is contained in:
parent
f04d343bdf
commit
9193895e45
@ -30,7 +30,6 @@ fs.readFile("/app/setup/chromecast.css", "utf-8", (err, a) => {
|
||||
if(err === null) {
|
||||
data = b + "\n" + data + "\n";
|
||||
}
|
||||
console.log(data);
|
||||
fs.writeFile("/app/style.css", css.stringify(css.parse(data), {"compress": true}), (err) => {
|
||||
if(err !== null) {
|
||||
console.log(err);
|
||||
|
@ -32,28 +32,40 @@
|
||||
}
|
||||
cbutton.text = "Chromecast";
|
||||
|
||||
const bigCastButton = new Button(player, cbutton);
|
||||
bigCastButton.addClass("fab");
|
||||
bigCastButton.addClass("fa-chromecast");
|
||||
bigCastButton.addClass("vjs-control");
|
||||
bigCastButton.addClass("vjs-button");
|
||||
bigCastButton.addClass("vjs-big-chromecast");
|
||||
player.addChild(bigCastButton);
|
||||
const bigCastButtonWrapper = new Button(player, cbutton);
|
||||
const bigCastButton = bigCastButtonWrapper.el();
|
||||
for(const elem of bigCastButton.children) {
|
||||
bigCastButton.removeChild(elem);
|
||||
}
|
||||
bigCastButton.classList.add("vjs-control");
|
||||
bigCastButton.classList.add("vjs-button");
|
||||
bigCastButton.classList.add("fab");
|
||||
bigCastButton.classList.add("fa-chromecast");
|
||||
bigCastButton.classList.add("vjs-big-chromecast");
|
||||
player.addChild(bigCastButtonWrapper);
|
||||
|
||||
player.one("error", () => {
|
||||
player.removeChild(bigCastButton);
|
||||
player.removeChild(bigCastButtonWrapper);
|
||||
});
|
||||
|
||||
player.one("play", () => {
|
||||
player.removeChild(bigCastButton);
|
||||
player.removeChild(bigCastButtonWrapper);
|
||||
});
|
||||
|
||||
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);
|
||||
const smallCastButtonWrapper = new Button(player, cbutton);
|
||||
const smallCastButton = smallCastButtonWrapper.el();
|
||||
smallCastButton.classList.add("vjs-control");
|
||||
smallCastButton.classList.add("vjs-button");
|
||||
|
||||
for(const elem of smallCastButton.children) {
|
||||
if(elem.classList.contains("vjs-icon-placeholder")) {
|
||||
elem.classList.add("fab");
|
||||
elem.classList.add("fa-chromecast");
|
||||
}
|
||||
}
|
||||
|
||||
player.controlBar.addChild(smallCastButtonWrapper);
|
||||
|
||||
player.on("chromecastConnected", () => {
|
||||
if(player.volume() > 0.3) {
|
||||
player.volume(0.2);
|
||||
|
@ -1,9 +1,6 @@
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
.fa-chromecast:before {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
.vjs-button {
|
||||
cursor:pointer;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user