diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/page.tmpl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl index 3f3044a9..576f3d66 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -66,6 +66,7 @@ This could be extended to accept hours in the time stamp as well, but currently does not. */ let mainVideo; + let qnaVideo; // some pages have a questions and answers video let timestamps; // expects a string like "mm:ss" @@ -78,11 +79,14 @@ window.onload = function initScript() { mainVideo = document.getElementById("mainVideo"); + qnaVideo = document.getElementById("qnaVideo"); timestamps = document.getElementsByClassName("time-link"); let len = timestamps.length; for (let i = 0; i < len; i++) { timestamps[i].onclick = function () { - mainVideo.currentTime = parseSeconds(this.innerText) + const videoType = this.href.split("/").pop(); + const video = (videoType == "#mainVideo") ? mainVideo : qnaVideo; + video.currentTime = parseSeconds(this.innerText) }; } } |