parsování xml a výpis xml

This commit is contained in:
2021-01-26 19:03:59 +01:00
parent 0e5089afd6
commit 0ade9c4503
8 changed files with 122 additions and 41 deletions

View File

@@ -13,16 +13,33 @@ class Controller {
this.videoToLoad = urlParams.get("v");
this.loadVideo(this.videoToLoad);
this.loadXml(this.videoToLoad);
this.view.drawCommentsText(this.model.comments);
this.view.videoPlayer.getVideoDuration().then(function(v) {
this.view.drawCommentsToVideo(this.model.comments, v);
}.bind(this))
}
loadVideo(v) {
let video = document.getElementById("video");
console.log(video)
video.children[0].src = "./videos/" + v + ".webm";
video.load();
}
console.log("here");
loadXml(v) {
var Connect = new XMLHttpRequest();
// Define which file to open and
// send the request.
Connect.open("GET", "./videos/" + v + ".xml", false);
Connect.setRequestHeader("Content-Type", "text/xml");
Connect.send(null);
// Place the response in an XML document.
var TheDocument = Connect.responseText;
// Place the root node in an element.
// var Customers = TheDocument.childNodes[0];
this.model.parseXML(TheDocument);
}
}