mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-30 16:17:41 +01:00
Does this fix it?
This commit is contained in:
parent
41fd23cf20
commit
c5251401e7
5 changed files with 3 additions and 15 deletions
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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());
|
||||||
|
|
||||||
|
|
|
@ -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 & {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue