diff --git a/src/video/components/actions/TimeAction.tsx b/src/video/components/actions/TimeAction.tsx index d71d345c..184256ea 100644 --- a/src/video/components/actions/TimeAction.tsx +++ b/src/video/components/actions/TimeAction.tsx @@ -42,7 +42,8 @@ export function TimeAction(props: Props) { const descriptor = useVideoPlayerDescriptor(); const videoTime = useProgress(descriptor); const mediaPlaying = useMediaPlaying(descriptor); - const { timeFormat, setTimeFormat } = useInterface(descriptor); + const { setTimeFormat } = useControls(descriptor); + const { timeFormat } = useInterface(descriptor); const { isMobile } = useIsMobile(); const { t } = useTranslation(); diff --git a/src/video/state/logic/interface.ts b/src/video/state/logic/interface.ts index 5a5ea719..6d0357ab 100644 --- a/src/video/state/logic/interface.ts +++ b/src/video/state/logic/interface.ts @@ -1,4 +1,5 @@ import { useEffect, useState } from "react"; +import { useControls } from "@/video/state/logic/controls"; import { getPlayerState } from "../cache"; import { listenEvent, sendEvent, unlistenEvent } from "../events"; import { VideoPlayerState, VideoPlayerTimeFormat } from "../types"; @@ -10,7 +11,6 @@ export type VideoInterfaceEvent = { isFullscreen: boolean; popoutBounds: null | DOMRect; timeFormat: VideoPlayerTimeFormat; - setTimeFormat(timeFormat: VideoPlayerTimeFormat): void; }; function getInterfaceFromState(state: VideoPlayerState): VideoInterfaceEvent { @@ -21,9 +21,6 @@ function getInterfaceFromState(state: VideoPlayerState): VideoInterfaceEvent { isFullscreen: state.interface.isFullscreen, popoutBounds: state.interface.popoutBounds, timeFormat: state.interface.timeFormat, - setTimeFormat(timeFormat: VideoPlayerTimeFormat) { - state.stateProvider?.setTimeFormat(timeFormat); - }, }; } diff --git a/src/video/state/providers/castingStateProvider.ts b/src/video/state/providers/castingStateProvider.ts index e668cebc..faf34dc5 100644 --- a/src/video/state/providers/castingStateProvider.ts +++ b/src/video/state/providers/castingStateProvider.ts @@ -173,10 +173,6 @@ export function createCastingStateProvider( updateSource(descriptor, state); } }, - setTimeFormat(format) { - state.interface.timeFormat = format; - updateInterface(descriptor, state); - }, providerStart() { this.setVolume(getStoredVolume()); diff --git a/src/video/state/providers/providerTypes.ts b/src/video/state/providers/providerTypes.ts index 2cab148b..ad09e812 100644 --- a/src/video/state/providers/providerTypes.ts +++ b/src/video/state/providers/providerTypes.ts @@ -1,5 +1,4 @@ import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams"; -import { VideoPlayerTimeFormat } from "@/video/state/types"; type VideoPlayerSource = { source: string; @@ -24,7 +23,6 @@ export type VideoPlayerStateController = { getId(): string; togglePictureInPicture(): void; setPlaybackSpeed(num: number): void; - setTimeFormat(timeFormat: VideoPlayerTimeFormat): void; }; export type VideoPlayerStateProvider = VideoPlayerStateController & { diff --git a/src/video/state/providers/videoStateProvider.ts b/src/video/state/providers/videoStateProvider.ts index e8aa9aa3..e527419b 100644 --- a/src/video/state/providers/videoStateProvider.ts +++ b/src/video/state/providers/videoStateProvider.ts @@ -133,10 +133,6 @@ export function createVideoStateProvider( // update localstorage setStoredVolume(volume); }, - setTimeFormat(num) { - state.interface.timeFormat = num; - updateInterface(descriptor, state); - }, setSource(source) { if (!source) { resetStateForSource(descriptor, state);