~cadence/tube-devel

cloudtube: Seek videos without reloading the page on clicked timestamps v1 APPLIED

~lomanic
~lomanic: 1
 Seek videos without reloading the page on clicked timestamps

 1 files changed, 8 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~cadence/tube-devel/patches/22447/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH cloudtube] Seek videos without reloading the page on clicked timestamps Export this patch

~lomanic
From: Lomanic <lomanic@hotmail.fr>

---
 html/static/js/player.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/html/static/js/player.js b/html/static/js/player.js
index 4b3ca6a..cd53293 100644
--- a/html/static/js/player.js
+++ b/html/static/js/player.js
@@ -1,8 +1,9 @@
import {q, ElemJS} from "/static/js/elemjs/elemjs.js"
import {q, qa, ElemJS} from "/static/js/elemjs/elemjs.js"
import {SubscribeButton} from "/static/js/subscribe.js"

const video = q("#video")
const audio = q("#audio")
const timestamps = qa("a[data-clickable-timestamp]")

const videoFormats = new Map()
const audioFormats = new Map()
@@ -221,3 +222,9 @@ document.addEventListener("keydown", event => {
})

new SubscribeButton(q("#subscribe"))

Array.from(timestamps).forEach(el => el.addEventListener('click', event => {
	event.preventDefault()
	video.currentTime = event.target.getAttribute("data-clickable-timestamp")
	window.history.replaceState({}, "", event.target.href)
}))
-- 
2.30.2