nastylování přehrávače
This commit is contained in:
@@ -4,6 +4,6 @@ class Controller {
|
||||
}
|
||||
|
||||
init() {
|
||||
console.log("here");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
const app = new Controller();
|
||||
const app = new Controller(new Model(), new View());
|
||||
3
js/model.js
Normal file
3
js/model.js
Normal file
@@ -0,0 +1,3 @@
|
||||
class Model {
|
||||
constructor() {}
|
||||
}
|
||||
47
js/view.js
Normal file
47
js/view.js
Normal 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
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user