summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2021-12-04 21:05:14 -0500
committerSacha Chua <sacha@sachachua.com>2021-12-04 21:05:14 -0500
commit76bd2482a4d8ca5ff192915cba7b9893c9a968a7 (patch)
tree087a687249f066f5b0e81f89741e3f92a943c8bf /templates
parentdc3a0b09cc0c9b7c09709008ddb4f6c12f38a6f8 (diff)
downloademacsconf-wiki-76bd2482a4d8ca5ff192915cba7b9893c9a968a7.tar.xz
emacsconf-wiki-76bd2482a4d8ca5ff192915cba7b9893c9a968a7.zip
Video tweaks, removed slashes too
Diffstat (limited to 'templates')
-rw-r--r--templates/page.tmpl6
1 files changed, 4 insertions, 2 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl
index 235d3aa9..65d12e3b 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -321,7 +321,8 @@ transcriptDiv.appendChild(transcriptLink)
if (textTrack.kind === "chapters"){
textTrack.mode = 'hidden';
var video = trackElement.closest('video');
- var chapterList = trackElement.closest('.video-card').querySelector('ol');
+ var chapterList = trackElement.closest('.vid').querySelector('ol');
+ chapterList.innerHTML = '';
for (var i = 0; i < textTrack.cues.length; ++i) {
cue = textTrack.cues[i],
chapterName = cue.text,
@@ -341,6 +342,7 @@ transcriptDiv.appendChild(transcriptLink)
}
textTrack.addEventListener("cuechange",
function() {
+ if (!this.activeCues[0]) return;
var currentLocation = this.activeCues[0].startTime;
if (chapter = chapterList.querySelector('li[data-start="' + currentLocation + '"]')) {
var locations = [].slice.call(chapterList.querySelectorAll("li"));
@@ -354,7 +356,7 @@ transcriptDiv.appendChild(transcriptLink)
}
}
- document.querySelectorAll('track[kind=chapters]').forEach(function(e) { e.addEventListener('load', function() { displayChapters(e); });});
+ document.querySelectorAll('track[kind=chapters]').forEach(function(e) { displayChapters(e); e.addEventListener('load', function() { displayChapters(e); });});
// @license-end
</script>