go from classes to prototypes

This commit is contained in:
2020-01-27 16:56:16 +01:00
parent 9c862c48e1
commit cd69b63583
19 changed files with 1147 additions and 1114 deletions

View File

@@ -1,26 +1,24 @@
class VideoViewer {
constructor(viewer, file, next) {let v = this;
v.viewer = viewer;
v.file = file;
v.next = next;
function VideoViewer(viewer, file, next) {let v = this;
v.viewer = viewer;
v.file = file;
v.next = next;
v.vidContainer = document.createElement("div");
v.vidContainer.classList = "image-container";
v.vidContainer = document.createElement("div");
v.vidContainer.classList = "image-container";
v.vidElement = document.createElement("video");
v.vidElement.autoplay = "autoplay";
v.vidElement.controls = "controls";
v.vidElement.classList = "center drop-shadow";
v.vidElement.addEventListener("ended", () => { v.next(); }, false);
v.vidElement = document.createElement("video");
v.vidElement.autoplay = "autoplay";
v.vidElement.controls = "controls";
v.vidElement.classList = "center drop-shadow";
v.vidElement.addEventListener("ended", () => { v.next(); }, false);
v.videoSource = document.createElement("source");
v.videoSource.src = apiEndpoint+"/file/"+v.file.id;
v.videoSource = document.createElement("source");
v.videoSource.src = apiEndpoint+"/file/"+v.file.id;
v.vidElement.appendChild(v.videoSource);
v.vidContainer.appendChild(v.vidElement);
}
render(parent) {let v = this;
parent.appendChild(v.vidContainer);
}
v.vidElement.appendChild(v.videoSource);
v.vidContainer.appendChild(v.vidElement);
}
VideoViewer.prototype.render = function(parent) {let v = this;
parent.appendChild(v.vidContainer);
}