parsování xml a výpis xml
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user