Feature/autoplay focus change #174

Merged
kaffem merged 4 commits from feature/autoplay-focus-change into develop 2021-02-08 18:30:26 +01:00
Showing only changes of commit a01a7a8392 - Show all commits

View file

@ -24,7 +24,7 @@ export function init(): void {
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
getGlobalConfiguration().getProperty(SETTINGS_playerAutopauseAfterFocusLost, value => { getGlobalConfiguration().getProperty(SETTINGS_playerAutopauseAfterFocusLost, value => {
if (value) { if (value) {
core.registerScript((node: Node) => { core.registerScript((node: Node) => {
addVisibilityChangeListener(); window.addEventListener('visibilitychange', observeTabFocus, false);
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
}, "^/anime/[0-9]*/[0-9]*$"); }, "^/anime/[0-9]*/[0-9]*$");
} }
}); });
@ -54,10 +54,6 @@ function observeScreenshotTooltip(tooltip: HTMLElement): void {
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
}); });
} }
function addVisibilityChangeListener(): void{
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
window.addEventListener('visibilitychange', observeTabFocus, false);
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
}
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
function observeTabFocus(): void { function observeTabFocus(): void {
let docState = document.visibilityState; let docState = document.visibilityState;
let playerElement = findPlayerElement(); let playerElement = findPlayerElement();

Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.
Serraniel commented 2021-02-07 18:45:28 +01:00 (Migrated from github.com)
Review

Maybe would rename it to indicate it's a Boolean. onSomething mostly is used for events or listeners.

let restartPlayerOnVisible: boolean;
Maybe would rename it to indicate it's a Boolean. `onSomething` mostly is used for events or listeners. ```suggestion let restartPlayerOnVisible: boolean; ```
kaffem commented 2021-02-08 06:05:54 +01:00 (Migrated from github.com)
Review

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.

I agree, instead of 'restart' I used 'resume' since it fits the overall functionality better.