Skip to content

Commit

Permalink
Use PlayerEvent constant
Browse files Browse the repository at this point in the history
  • Loading branch information
viown committed Oct 24, 2024
1 parent 459d0d7 commit 11e4549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getItems } from '../../utils/jellyfin-apiclient/getItems.ts';
import { getItemBackdropImageUrl } from '../../utils/jellyfin-apiclient/backdropImage';

import { bindMediaSegmentManager } from 'apps/stable/features/playback/utils/mediaSegmentManager';
import { PlayerEvent } from 'apps/stable/features/playback/constants/playerEvent';
import { MediaError } from 'types/mediaError';
import { getMediaError } from 'utils/mediaError';
import { toApi } from 'utils/jellyfin-apiclient/compat';
Expand Down Expand Up @@ -939,7 +940,7 @@ export class PlaybackManager {
player = player || self._currentPlayer;

if (mediaSegment && this._skipSegment) {
Events.trigger(player, 'promptskip', [mediaSegment]);
Events.trigger(player, PlayerEvent.PromptSkip, [mediaSegment]);
}
};

Expand Down
5 changes: 3 additions & 2 deletions src/controllers/playback/video/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { PluginType } from '../../../types/plugin.ts';
import { EventType } from 'types/eventType';
import { MediaSegmentType } from '@jellyfin/sdk/lib/generated-client';
import { TICKS_PER_MINUTE, TICKS_PER_SECOND } from 'constants/time';
import { PlayerEvent } from 'apps/stable/features/playback/constants/playerEvent';

function getOpenedDialog() {
return document.querySelector('.dialogContainer .dialog.opened');
Expand Down Expand Up @@ -578,7 +579,7 @@ export default function (view) {
}, state);
Events.on(player, 'playbackstart', onPlaybackStart);
Events.on(player, 'playbackstop', onPlaybackStopped);
Events.on(player, 'promptskip', onPromptSkip);
Events.on(player, PlayerEvent.PromptSkip, onPromptSkip);
Events.on(player, 'volumechange', onVolumeChanged);
Events.on(player, 'pause', onPlayPauseStateChanged);
Events.on(player, 'unpause', onPlayPauseStateChanged);
Expand All @@ -603,7 +604,7 @@ export default function (view) {
if (player) {
Events.off(player, 'playbackstart', onPlaybackStart);
Events.off(player, 'playbackstop', onPlaybackStopped);
Events.off(player, 'promptskip', onPromptSkip);
Events.off(player, PlayerEvent.PromptSkip, onPromptSkip);
Events.off(player, 'volumechange', onVolumeChanged);
Events.off(player, 'pause', onPlayPauseStateChanged);
Events.off(player, 'unpause', onPlayPauseStateChanged);
Expand Down

0 comments on commit 11e4549

Please sign in to comment.