Přidán formulář k přídávání videí
This commit is contained in:
@@ -9,18 +9,22 @@ class Controller {
|
||||
let videoToLoad = urlParams.get("v");
|
||||
let video = document.getElementById("video");
|
||||
|
||||
this.loadVideo(videoToLoad).then(
|
||||
function () {
|
||||
video.addEventListener(
|
||||
"loadedmetadata",
|
||||
function () {
|
||||
this.view.videoPlayer.updateVideoDuration();
|
||||
this.addEventListenersToVideoControls();
|
||||
this.init(videoToLoad);
|
||||
}.bind(this)
|
||||
);
|
||||
}.bind(this)
|
||||
);
|
||||
if (videoToLoad != null && videoToLoad != "") {
|
||||
this.loadVideo(videoToLoad).then(
|
||||
function () {
|
||||
video.addEventListener(
|
||||
"loadedmetadata",
|
||||
function () {
|
||||
this.view.videoPlayer.updateVideoDuration();
|
||||
this.addEventListenersToVideoControls();
|
||||
this.init(videoToLoad);
|
||||
}.bind(this)
|
||||
);
|
||||
}.bind(this)
|
||||
);
|
||||
} else {
|
||||
this.view.showAddVideo();
|
||||
}
|
||||
}
|
||||
|
||||
init(videoToLoad) {
|
||||
@@ -105,9 +109,15 @@ class Controller {
|
||||
|
||||
async loadVideo(v) {
|
||||
let video = document.getElementById("video");
|
||||
let source = document.createElement("source");
|
||||
|
||||
video.classList.remove("hidden");
|
||||
|
||||
source.setAttribute("src", "./videos/" + v + ".webm");
|
||||
video.append(source);
|
||||
|
||||
video.children[0].src = "./videos/" + v + ".webm";
|
||||
await video.load();
|
||||
this.view.createVideoPlayerObject();
|
||||
}
|
||||
|
||||
async loadXml(v) {
|
||||
|
||||
Reference in New Issue
Block a user