Prevent timestamp from being set for Livestreams on "Watch on Youtube" links

This commit is contained in:
Fijxu 2025-09-18 17:10:45 -03:00
parent 325e013e0d
commit 4263ae3024
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4
2 changed files with 14 additions and 11 deletions

View File

@ -137,16 +137,18 @@ player.on('timeupdate', function () {
// YouTube links // YouTube links
let elem_yt_watch = document.getElementById('link-yt-watch'); if (!video_data.live_now) {
if (elem_yt_watch) { let elem_yt_watch = document.getElementById('link-yt-watch');
let base_url_yt_watch = elem_yt_watch.getAttribute('data-base-url'); if (elem_yt_watch) {
elem_yt_watch.href = addCurrentTimeToURL(base_url_yt_watch); let base_url_yt_watch = elem_yt_watch.getAttribute('data-base-url');
} elem_yt_watch.href = addCurrentTimeToURL(base_url_yt_watch);
}
let elem_yt_embed = document.getElementById('link-yt-embed'); let elem_yt_embed = document.getElementById('link-yt-embed');
if (elem_yt_embed) { if (elem_yt_embed) {
let base_url_yt_embed = elem_yt_embed.getAttribute('data-base-url'); let base_url_yt_embed = elem_yt_embed.getAttribute('data-base-url');
elem_yt_embed.href = addCurrentTimeToURL(base_url_yt_embed); elem_yt_embed.href = addCurrentTimeToURL(base_url_yt_embed);
}
} }
// Invidious links // Invidious links

View File

@ -65,7 +65,8 @@ we're going to need to do it here in order to allow for translations.
"vr" => video.vr?, "vr" => video.vr?,
"projection_type" => video.projection_type, "projection_type" => video.projection_type,
"local_disabled" => CONFIG.disabled?("local"), "local_disabled" => CONFIG.disabled?("local"),
"support_reddit" => true "support_reddit" => true,
"live_now" => video.live_now
}.to_pretty_json }.to_pretty_json
%> %>
</script> </script>