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
3 changed files with 44 additions and 1 deletions

View file

@ -44,6 +44,12 @@
<input type="checkbox" id="playerAutoplayAfterScreenshot" data-default-value="true" /> <input type="checkbox" id="playerAutoplayAfterScreenshot" data-default-value="true" />
<label for="playerAutoplayAfterScreenshot">Autoplay after screenshots</label><br /> <label for="playerAutoplayAfterScreenshot">Autoplay after screenshots</label><br />
<input type="checkbox" id="playerAutopauseAfterFocusLost" data-default-value="true" />
<label for="playerAutopauseAfterFocusLost">Autopause after tab unfocused</label><br />
<input type="checkbox" id="playerAutoplayAfterFocusGain" data-default-value="true" />
<label for="playerAutoplayAfterFocusGain">Autoplay after tab focused</label><br />
<h3>Watch2gether</h3> <h3>Watch2gether</h3>
<input type="checkbox" id="w2gDisplayCharacterCounter" data-default-value="true" /> <input type="checkbox" id="w2gDisplayCharacterCounter" data-default-value="true" />
<label for="w2gDisplayCharacterCounter">Display character count in chat</label><br /> <label for="w2gDisplayCharacterCounter">Display character count in chat</label><br />

View file

@ -14,6 +14,8 @@ export const SETTINGS_animeLanguageDisplay = 'animeLanguageDisplay';
export const SETTINGS_requestBeautifyPage = 'requestBeautifyPage'; export const SETTINGS_requestBeautifyPage = 'requestBeautifyPage';
// player // player
export const SETTINGS_playerAutoplayAfterScreenshot = 'playerAutoplayAfterScreenshot'; export const SETTINGS_playerAutoplayAfterScreenshot = 'playerAutoplayAfterScreenshot';
export const SETTINGS_playerAutopauseAfterFocusLost = 'playerAutopauseAfterFocusLost';
export const SETTINGS_playerAutoplayAfterFocusGain = 'playerAutoplayAfterFocusGain';
// w2g // w2g
export const SETTINGS_w2gDisplayCharacterCounter = 'w2gDisplayCharacterCounter'; export const SETTINGS_w2gDisplayCharacterCounter = 'w2gDisplayCharacterCounter';
class Configuration { class Configuration {

View file

@ -1,9 +1,13 @@
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.
import { getGlobalConfiguration, SETTINGS_playerAutoplayAfterScreenshot } from '../configuration/configuration'; import { getGlobalConfiguration,
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.
SETTINGS_playerAutoplayAfterScreenshot,
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.
SETTINGS_playerAutopauseAfterFocusLost,
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.
SETTINGS_playerAutoplayAfterFocusGain } from '../configuration/configuration';
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.
import * as core from '../utils/aniwatchCore'; import * as core from '../utils/aniwatchCore';
import * as helper from '../utils/helpers'; import * as helper from '../utils/helpers';
const SCREENSHOT_TOOLTIP_ID = 'anilyr-screenshots-tooltip'; const SCREENSHOT_TOOLTIP_ID = 'anilyr-screenshots-tooltip';
const PLAYER_ID = 'player'; const PLAYER_ID = 'player';
let resumePlayerOnVisible: boolean;
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.
export function init(): void { export function init(): void {
getGlobalConfiguration().getProperty(SETTINGS_playerAutoplayAfterScreenshot, value => { getGlobalConfiguration().getProperty(SETTINGS_playerAutoplayAfterScreenshot, value => {
@ -16,6 +20,18 @@ 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.
}, "^/anime/[0-9]*/[0-9]*$"); }, "^/anime/[0-9]*/[0-9]*$");
} }
}); });
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 => {
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.
if (value) {
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.
core.registerScript((node: Node) => {
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.
}, "^/anime/[0-9]*/[0-9]*$");
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.
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_playerAutoplayAfterFocusGain, value => {
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.
resumePlayerOnVisible = value;
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 observeScreenshotTooltip(tooltip: HTMLElement): void { function observeScreenshotTooltip(tooltip: HTMLElement): void {
@ -38,6 +54,21 @@ 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 observeTabFocus(): 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.
let docState = document.visibilityState;
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.
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.
if (docState === 'hidden') {
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.
if (helper.assigned(playerElement)) {
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.
pausePlayer(playerElement);
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.
else if (docState === 'visible' && resumePlayerOnVisible) {
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.
if (helper.assigned(playerElement)) {
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.
resumePlayer(playerElement);
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.
}
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 findPlayerElement(): HTMLVideoElement { function findPlayerElement(): HTMLVideoElement {
let playerCandidate = document.getElementById(PLAYER_ID); let playerCandidate = document.getElementById(PLAYER_ID);
if (playerCandidate instanceof HTMLVideoElement) { if (playerCandidate instanceof HTMLVideoElement) {
@ -49,4 +80,8 @@ function findPlayerElement(): HTMLVideoElement {
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 resumePlayer(player: HTMLVideoElement) { function resumePlayer(player: HTMLVideoElement) {
player.play(); player.play();
}
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 pausePlayer(player: HTMLVideoElement) {
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.
player.pause()
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.
} }