Does this fix it?

This commit is contained in:
Isra 2023-04-14 14:18:17 -05:00
parent 41fd23cf20
commit c5251401e7
5 changed files with 3 additions and 15 deletions

View File

@ -42,7 +42,8 @@ export function TimeAction(props: Props) {
const descriptor = useVideoPlayerDescriptor(); const descriptor = useVideoPlayerDescriptor();
const videoTime = useProgress(descriptor); const videoTime = useProgress(descriptor);
const mediaPlaying = useMediaPlaying(descriptor); const mediaPlaying = useMediaPlaying(descriptor);
const { timeFormat, setTimeFormat } = useInterface(descriptor); const { setTimeFormat } = useControls(descriptor);
const { timeFormat } = useInterface(descriptor);
const { isMobile } = useIsMobile(); const { isMobile } = useIsMobile();
const { t } = useTranslation(); const { t } = useTranslation();

View File

@ -1,4 +1,5 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { useControls } from "@/video/state/logic/controls";
import { getPlayerState } from "../cache"; import { getPlayerState } from "../cache";
import { listenEvent, sendEvent, unlistenEvent } from "../events"; import { listenEvent, sendEvent, unlistenEvent } from "../events";
import { VideoPlayerState, VideoPlayerTimeFormat } from "../types"; import { VideoPlayerState, VideoPlayerTimeFormat } from "../types";
@ -10,7 +11,6 @@ export type VideoInterfaceEvent = {
isFullscreen: boolean; isFullscreen: boolean;
popoutBounds: null | DOMRect; popoutBounds: null | DOMRect;
timeFormat: VideoPlayerTimeFormat; timeFormat: VideoPlayerTimeFormat;
setTimeFormat(timeFormat: VideoPlayerTimeFormat): void;
}; };
function getInterfaceFromState(state: VideoPlayerState): VideoInterfaceEvent { function getInterfaceFromState(state: VideoPlayerState): VideoInterfaceEvent {
@ -21,9 +21,6 @@ function getInterfaceFromState(state: VideoPlayerState): VideoInterfaceEvent {
isFullscreen: state.interface.isFullscreen, isFullscreen: state.interface.isFullscreen,
popoutBounds: state.interface.popoutBounds, popoutBounds: state.interface.popoutBounds,
timeFormat: state.interface.timeFormat, timeFormat: state.interface.timeFormat,
setTimeFormat(timeFormat: VideoPlayerTimeFormat) {
state.stateProvider?.setTimeFormat(timeFormat);
},
}; };
} }

View File

@ -173,10 +173,6 @@ export function createCastingStateProvider(
updateSource(descriptor, state); updateSource(descriptor, state);
} }
}, },
setTimeFormat(format) {
state.interface.timeFormat = format;
updateInterface(descriptor, state);
},
providerStart() { providerStart() {
this.setVolume(getStoredVolume()); this.setVolume(getStoredVolume());

View File

@ -1,5 +1,4 @@
import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams"; import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams";
import { VideoPlayerTimeFormat } from "@/video/state/types";
type VideoPlayerSource = { type VideoPlayerSource = {
source: string; source: string;
@ -24,7 +23,6 @@ export type VideoPlayerStateController = {
getId(): string; getId(): string;
togglePictureInPicture(): void; togglePictureInPicture(): void;
setPlaybackSpeed(num: number): void; setPlaybackSpeed(num: number): void;
setTimeFormat(timeFormat: VideoPlayerTimeFormat): void;
}; };
export type VideoPlayerStateProvider = VideoPlayerStateController & { export type VideoPlayerStateProvider = VideoPlayerStateController & {

View File

@ -133,10 +133,6 @@ export function createVideoStateProvider(
// update localstorage // update localstorage
setStoredVolume(volume); setStoredVolume(volume);
}, },
setTimeFormat(num) {
state.interface.timeFormat = num;
updateInterface(descriptor, state);
},
setSource(source) { setSource(source) {
if (!source) { if (!source) {
resetStateForSource(descriptor, state); resetStateForSource(descriptor, state);