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 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();

View File

@ -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);
},
};
}

View File

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

View File

@ -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 & {

View File

@ -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);