Shuffle URL params

The `list` and `index` params are the most important and come first now.
This commit is contained in:
saltycrys 2020-12-08 02:30:48 +01:00
parent 30c92ce1b7
commit 680dc1f962
2 changed files with 10 additions and 8 deletions

View File

@ -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);
});
}

View File

@ -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);
});
}