mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use constant for event name
This commit is contained in:
parent
c0467b1f13
commit
32a91eabf1
2 changed files with 7 additions and 4 deletions
|
@ -6,6 +6,7 @@ import RemotePlayButton from 'apps/experimental/components/AppToolbar/RemotePlay
|
|||
import SyncPlayButton from 'apps/experimental/components/AppToolbar/SyncPlayButton';
|
||||
import AppToolbar from 'components/toolbar/AppToolbar';
|
||||
import ViewManagerPage from 'components/viewManager/ViewManagerPage';
|
||||
import { SHOW_OSD_EVENT } from 'controllers/playback/video';
|
||||
import Events, { type Event } from 'utils/events';
|
||||
|
||||
/**
|
||||
|
@ -22,10 +23,10 @@ const VideoPage: FC = () => {
|
|||
useEffect(() => {
|
||||
const doc = documentRef.current;
|
||||
|
||||
if (doc) Events.on(doc, 'showVideoOsd', onShowVideoOsd);
|
||||
if (doc) Events.on(doc, SHOW_OSD_EVENT, onShowVideoOsd);
|
||||
|
||||
return () => {
|
||||
if (doc) Events.off(doc, 'showVideoOsd', onShowVideoOsd);
|
||||
if (doc) Events.off(doc, SHOW_OSD_EVENT, onShowVideoOsd);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ import { PluginType } from '../../../types/plugin.ts';
|
|||
const TICKS_PER_MINUTE = 600000000;
|
||||
const TICKS_PER_SECOND = 10000000;
|
||||
|
||||
export const SHOW_OSD_EVENT = 'showVideoOsd';
|
||||
|
||||
function getOpenedDialog() {
|
||||
return document.querySelector('.dialogContainer .dialog.opened');
|
||||
}
|
||||
|
@ -280,14 +282,14 @@ export default function (view) {
|
|||
let mouseIsDown = false;
|
||||
|
||||
function showOsd(focusElement) {
|
||||
Events.trigger(document, 'showVideoOsd', [ true ]);
|
||||
Events.trigger(document, SHOW_OSD_EVENT, [ true ]);
|
||||
slideDownToShow(headerElement);
|
||||
showMainOsdControls(focusElement);
|
||||
resetIdle();
|
||||
}
|
||||
|
||||
function hideOsd() {
|
||||
Events.trigger(document, 'showVideoOsd', [ false ]);
|
||||
Events.trigger(document, SHOW_OSD_EVENT, [ false ]);
|
||||
slideUpToHide(headerElement);
|
||||
hideMainOsdControls();
|
||||
mouseManager.hideCursor();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue