From de77c710421d515272d1d0fcb2e585243ae2089c Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 27 May 2019 12:16:22 -0500 Subject: [PATCH] Add "local" to "next video" URLs --- assets/js/embed.js | 8 ++++++++ assets/js/watch.js | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/assets/js/embed.js b/assets/js/embed.js index 3d56c4ff..cbf21a58 100644 --- a/assets/js/embed.js +++ b/assets/js/embed.js @@ -39,6 +39,10 @@ function get_playlist(plid, timeouts = 0) { url.searchParams.set('speed', video_data.params.speed); } + if (video_data.params.local !== video_data.preferences.local) { + url.searchParams.set('local', video_data.params.local); + } + url.searchParams.set('list', plid); location.assign(url.pathname + url.search); }); @@ -71,6 +75,10 @@ if (video_data.plid) { url.searchParams.set('speed', video_data.params.speed); } + if (video_data.params.local !== video_data.preferences.local) { + url.searchParams.set('local', video_data.params.local); + } + if (video_data.video_series.length !== 0) { url.searchParams.set('playlist', video_data.video_series.join(',')) } diff --git a/assets/js/watch.js b/assets/js/watch.js index d447f441..9b843920 100644 --- a/assets/js/watch.js +++ b/assets/js/watch.js @@ -90,6 +90,10 @@ function continue_autoplay(event) { url.searchParams.set('speed', video_data.params.speed); } + if (video_data.params.local !== video_data.preferences.local) { + url.searchParams.set('local', video_data.params.local); + } + url.searchParams.set('continue', '1'); location.assign(url.pathname + url.search); }); @@ -155,6 +159,10 @@ function get_playlist(plid, timeouts = 0) { url.searchParams.set('speed', video_data.params.speed); } + if (video_data.params.local !== video_data.preferences.local) { + url.searchParams.set('local', video_data.params.local); + } + url.searchParams.set('list', plid); location.assign(url.pathname + url.search); }); @@ -388,6 +396,10 @@ if (video_data.play_next) { url.searchParams.set('speed', video_data.params.speed); } + if (video_data.params.local !== video_data.preferences.local) { + url.searchParams.set('local', video_data.params.local); + } + url.searchParams.set('continue', '1'); location.assign(url.pathname + url.search); });