Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: eXhumer <[email protected]>
  • Loading branch information
eXhumer committed Aug 17, 2024
1 parent 1a6a004 commit 9601f91
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
30 changes: 22 additions & 8 deletions src/Player/React/Component/PlayerUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class FastForwardButton extends Button<ButtonConfig> {
super.configure(player, uimanager);

this.onClick.subscribe(() => {
player.isLive() ?
player.timeShift(Math.min(0, this.interval + player.getTimeShift())) :
if (player.isLive())
player.timeShift(Math.min(0, this.interval + player.getTimeShift()));

else
player.seek(Math.min(player.getDuration(), player.getCurrentTime() + this.interval));
});
}
Expand All @@ -80,8 +82,10 @@ class RewindButton extends Button<ButtonConfig> {
super.configure(player, uimanager);

this.onClick.subscribe(() => {
player.isLive() ?
player.timeShift(Math.max(player.getTimeShift() - this.interval, player.getMaxTimeShift())):
if (player.isLive())
player.timeShift(Math.max(player.getTimeShift() - this.interval, player.getMaxTimeShift()));

else
player.seek(Math.max(0, player.getCurrentTime() - this.interval));
});
}
Expand All @@ -100,11 +104,19 @@ class PIPButton extends ToggleButton<ToggleButtonConfig> {
};

const pictureInPictureStateHandler = () => {
document.pictureInPictureElement !== null ? this.on() : this.off();
if (document.pictureInPictureElement)
this.on();

else
this.off();
};

const pictureInPictureAvailabilityChangedHandler = () => {
isPictureInPictureAvailable() ? this.show() : this.hide();
if (isPictureInPictureAvailable())
this.show();

else
this.hide();
};

const playerReadyHandler = () => {
Expand All @@ -117,8 +129,10 @@ class PIPButton extends ToggleButton<ToggleButtonConfig> {
uimanager.getConfig().events.onUpdated.subscribe(pictureInPictureAvailabilityChangedHandler);

this.onClick.subscribe(() => {
document.pictureInPictureElement ?
document.exitPictureInPicture() :
if (document.pictureInPictureElement)
document.exitPictureInPicture();

else
player.getVideoElement().requestPictureInPicture();
});

Expand Down
2 changes: 1 addition & 1 deletion webpack/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import type IForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const ForkTsCheckerWebpackPlugin: typeof IForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

export const plugins = [
Expand Down

0 comments on commit 9601f91

Please sign in to comment.