summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/page.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl
index 6647f03a..ceaa1049 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -317,7 +317,6 @@ transcriptDiv.appendChild(transcriptLink)
// Copyright (c) 2021 Sacha Chua
// Based on http://thenewcode.com/977/Create-Interactive-HTML5-Video-with-WebVTT-Chapters
function displayChapters(trackElement){
- console.log(trackElement);
if ((trackElement) && (textTrack = trackElement.track)){
if (textTrack.kind === "chapters"){
textTrack.mode = 'hidden';
@@ -343,7 +342,7 @@ transcriptDiv.appendChild(transcriptLink)
textTrack.addEventListener("cuechange",
function() {
var currentLocation = this.activeCues[0].startTime;
- if (chapter = chapterList.querySelector('data-start=[' + currentLocation + ']')) {
+ if (chapter = chapterList.querySelector('data-start=["' + currentLocation + '"]')) {
var locations = [].slice.call(chapterList.querySelectorAll("li"));
for (var i = 0; i < locations.length; ++i) {
locations[i].classList.remove("current");
@@ -354,6 +353,7 @@ transcriptDiv.appendChild(transcriptLink)
}
}
}
+document.querySelectorAll('track[kind=chapters]').forEach(function(e) { displayChapters(e); });
// @license-end
</script>
</body>