nastylování přehrávače

This commit is contained in:
2021-01-23 21:19:52 +01:00
parent 4a53f21281
commit db9c865b86
12 changed files with 169 additions and 112 deletions

47
js/view.js Normal file
View File

@@ -0,0 +1,47 @@
class View {
constructor() {
this.init();
}
init() {
this.colorTogglePlaySVG();
this.enableCustomControls();
/* Obarvení aktivního komentáře - dát do special metody */
var mySVG = document.getElementsByClassName("activeIcon")[0];
var svgDoc;
mySVG.addEventListener(
"load",
function () {
svgDoc = mySVG.contentDocument;
svgDoc.getElementById("path4").style.fill = "#ffa800";
},
false
);
}
enableCustomControls() {
const video = document.getElementById("video");
const videoControls = document.getElementById("video-controls");
const videoWorks = !!document.createElement("video").canPlayType;
if (videoWorks) {
video.controls = false;
videoControls.classList.remove("hidden");
}
}
colorTogglePlaySVG() {
var playSVG = document.getElementById("togglePlay");
var svgDoc;
playSVG.addEventListener(
"load",
function () {
svgDoc = playSVG.contentDocument;
svgDoc.getElementById("path4").style.fill = "#ffa800";
},
false
);
}
}