|
|
|
@ -63,6 +63,12 @@ class Controller {
|
|
|
|
|
|
|
|
|
|
const seek = document.getElementById("seek");
|
|
|
|
|
seek.addEventListener("input", this.view.videoPlayer.skipAhead);
|
|
|
|
|
|
|
|
|
|
document.addEventListener("keyup", function (e) {
|
|
|
|
|
if (e.keyCode == 32) {
|
|
|
|
|
this.view.videoPlayer.togglePlay();
|
|
|
|
|
}
|
|
|
|
|
}.bind(this));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async loadVideo(v) {
|
|
|
|
@ -89,17 +95,16 @@ class Controller {
|
|
|
|
|
|
|
|
|
|
getActiveComment() {
|
|
|
|
|
const video = document.getElementById("video");
|
|
|
|
|
let currentTime = Math.round(video.currentTime);
|
|
|
|
|
let currentTime = video.currentTime;
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < this.model.comments.length; i++) {
|
|
|
|
|
if (
|
|
|
|
|
currentTime > this.model.comments[i].start &&
|
|
|
|
|
currentTime < this.model.comments[i].end
|
|
|
|
|
) {
|
|
|
|
|
console.log("active: " + i);
|
|
|
|
|
this.view.activateComment(i);
|
|
|
|
|
this.view.activateCommentText(this.model.comments[i].fulltext);
|
|
|
|
|
return
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
this.view.activateComment(null);
|
|
|
|
|
this.view.activateCommentText(null);
|
|
|
|
|