Shuffle URL params

The `list` and `index` params are the most important and come first now.
pull/1551/head
saltycrys 2020-12-08 02:30:48 +01:00
rodzic 30c92ce1b7
commit 680dc1f962
2 zmienionych plików z 10 dodań i 8 usunięć

Wyświetl plik

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

Wyświetl plik

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