summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2021-11-24 02:03:26 -0500
committerSacha Chua <sacha@sachachua.com>2021-11-24 02:03:26 -0500
commit613c0b523d84c1236f1928644220f2ff4862d857 (patch)
tree7941235587dd64d57daae4c6a154b0363e4b48d2 /templates
parent539207c8afbb301d52ebe565d28606a29f6d14f4 (diff)
downloademacsconf-wiki-613c0b523d84c1236f1928644220f2ff4862d857.tar.xz
emacsconf-wiki-613c0b523d84c1236f1928644220f2ff4862d857.zip
Tweak chapter display
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>