mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Shuffle URL params
The `list` and `index` params are the most important and come first now.
This commit is contained in:
parent
30c92ce1b7
commit
680dc1f962
2 changed files with 10 additions and 8 deletions
|
@ -31,6 +31,11 @@ function get_playlist(plid, retries) {
|
|||
player.on('ended', function () {
|
||||
var url = new URL('https://example.com/embed/' + xhr.response.nextVideo);
|
||||
|
||||
url.searchParams.set('list', plid);
|
||||
if (!plid.startsWith('RD')) {
|
||||
url.searchParams.set('index', xhr.response.index);
|
||||
}
|
||||
|
||||
if (video_data.params.autoplay || video_data.params.continue_autoplay) {
|
||||
url.searchParams.set('autoplay', '1');
|
||||
}
|
||||
|
@ -47,10 +52,6 @@ function get_playlist(plid, retries) {
|
|||
url.searchParams.set('local', video_data.params.local);
|
||||
}
|
||||
|
||||
url.searchParams.set('list', plid);
|
||||
if (!plid.startsWith('RD')) {
|
||||
url.searchParams.set('index', xhr.response.index);
|
||||
}
|
||||
location.assign(url.pathname + url.search);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -154,6 +154,11 @@ function get_playlist(plid, retries) {
|
|||
player.on('ended', function () {
|
||||
var url = new URL('https://example.com/watch?v=' + xhr.response.nextVideo);
|
||||
|
||||
url.searchParams.set('list', plid);
|
||||
if (!plid.startsWith('RD')) {
|
||||
url.searchParams.set('index', xhr.response.index);
|
||||
}
|
||||
|
||||
if (video_data.params.autoplay || video_data.params.continue_autoplay) {
|
||||
url.searchParams.set('autoplay', '1');
|
||||
}
|
||||
|
@ -170,10 +175,6 @@ function get_playlist(plid, retries) {
|
|||
url.searchParams.set('local', video_data.params.local);
|
||||
}
|
||||
|
||||
url.searchParams.set('list', plid);
|
||||
if (!plid.startsWith('RD')) {
|
||||
url.searchParams.set('index', xhr.response.index);
|
||||
}
|
||||
location.assign(url.pathname + url.search);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue