mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Lint player.js
Follow lint indications : - https://github.com/iv-org/invidious/pull/2895#discussion_r809461103 - https://github.com/iv-org/invidious/pull/2895#discussion_r809461622
This commit is contained in:
parent
7048193f00
commit
1e3f4ed398
1 changed files with 2 additions and 4 deletions
|
@ -185,9 +185,7 @@ player.playbackRate(video_data.params.speed);
|
|||
* @returns cookieValue
|
||||
*/
|
||||
function getCookieValue(name) {
|
||||
var value = document.cookie.split(";").filter(item => {
|
||||
return item.includes(name + "=");
|
||||
});
|
||||
var value = document.cookie.split(";").filter(item => item.includes(name + "="));
|
||||
return value != null && value.length >= 1 ? value[0].substring((name + "=").length, value[0].length) : null;
|
||||
}
|
||||
|
||||
|
@ -207,7 +205,7 @@ function updateCookie(newVolume, newSpeed) {
|
|||
document.cookie = document.cookie.replace(getCookieValue('PREFS'), encodeURIComponent(JSON.stringify(cookieJson)));
|
||||
} else {
|
||||
var date = new Date();
|
||||
//Set expiration in 2 year
|
||||
// Set expiration in 2 year
|
||||
date.setTime(date.getTime() + 63115200);
|
||||
document.cookie = 'PREFS=' +
|
||||
encodeURIComponent(JSON.stringify({ 'volume': volumeValue, 'speed': speedValue })) +
|
||||
|
|
Loading…
Reference in a new issue