put font-awesome cast icon in span

This commit is contained in:
Roy Olav Purser 2021-06-10 12:23:55 +02:00
parent f04d343bdf
commit 9193895e45
Signed by: roypur
GPG Key ID: E14D26A036F21656
3 changed files with 27 additions and 19 deletions

View File

@ -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);

View File

@ -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);

View File

@ -1,9 +1,6 @@
body {
margin: 0px;
}
.fa-chromecast:before {
font-size: 1.2em;
}
.vjs-button {
cursor:pointer;
}