go from classes to prototypes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user