From a3d4f3b59e0aff9948a0c172bf407bb855b66f53 Mon Sep 17 00:00:00 2001 From: Jeroen Boersma Date: Tue, 10 Feb 2026 22:40:33 +0100 Subject: [PATCH] add: Title listen button time updates When switching between Listen and Watching the timestamp in the url of the listen of watch button is now updated automatically. This means if you switch between listening and viewing you keep in sync with time. --- assets/js/player.js | 6 ++++++ src/invidious/views/watch.ecr | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/js/player.js b/assets/js/player.js index ecdc0448..16312a1e 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -166,6 +166,12 @@ player.on('timeupdate', function () { let base_url_iv_other = elem_iv_other.getAttribute('data-base-url'); elem_iv_other.href = addCurrentTimeToURL(base_url_iv_other, domain); } + + let elem_iv_listen = document.getElementById('link-iv-listen'); + if (elem_iv_listen) { + let base_url_iv_listen = elem_iv_listen.getAttribute('data-base-url'); + elem_iv_listen.href = addCurrentTimeToURL(base_url_iv_listen, domain); + } }); diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 923c2a83..11ab96d6 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -79,11 +79,11 @@ we're going to need to do it here in order to allow for translations.

<%= title %> <% if params.listen %> - " href="/watch?<%= env.params.query %>&listen=0"> + " id="link-iv-listen" data-base-url="/watch?<%= env.params.query %>&listen=0" href="/watch?<%= env.params.query %>&listen=0"> <% else %> - " href="/watch?<%= env.params.query %>&listen=1"> + " id="link-iv-listen" data-base-url="/watch?<%= env.params.query %>&listen=1" href="/watch?<%= env.params.query %>&listen=1"> <% end %>