summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-11-28 14:47:23 -0500
committerSacha Chua <sacha@sachachua.com>2022-11-28 14:47:23 -0500
commite74706118c987c43748b6c0a1e4208f1d460c67c (patch)
treefb9360d772c3164d5e94ee283ac86b248c9d73c6 /templates
parent4e6de17fbca7861e757fcbf09ee6ea5607101f54 (diff)
downloademacsconf-wiki-e74706118c987c43748b6c0a1e4208f1d460c67c.tar.xz
emacsconf-wiki-e74706118c987c43748b6c0a1e4208f1d460c67c.zip
add reload js for detecting fallback
Diffstat (limited to '')
-rw-r--r--templates/page.tmpl17
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl
index dd6ac641..7cf2eb50 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -391,6 +391,23 @@ transcriptDiv.appendChild(transcriptLink)
document.querySelectorAll('pre.chapters').forEach(displayChapters);
+ var video = document.querySelector('video.reload');
+if (video) {
+ var myVar = setInterval(reloadAsNeeded, 1000);
+ var oldTime = '';
+ function reloadAsNeeded() {
+ if ((video.paused != true && (video.currentTime - oldTime) == 0 && video.currentTime != 0)) {
+ var source = video.querySelector('source');
+ var oldVideo = source.src;
+ source.src = '';
+ source.src = oldVideo;
+ video.load();
+ video.play();
+ }
+ oldTime = video.currentTime;
+ };
+}
+
// @license-end
</script>
</body>