refactor: rewrite video player

This commit is contained in:
Prayag Prajapati committed 2025-06-27 16:55:17 +05:30
1 parent 0f5482627a
commit 7b0b22b611
34 files changed
+3766 -3007

No files matched your search

@@ -0,0 +1,27 @@
import { Typography } from "@mui/material";
import React from "react";
import { useShallow } from "zustand/shallow";
import ticksDisplay from "@/utils/methods/ticksDisplay";
import { usePlaybackStore } from "@/utils/store/playback";
const ProgressDislay = () => {
const { currentTime, itemDuration, isUserSeeking, seekValue } =
usePlaybackStore(
useShallow((state) => ({
currentTime: state.playerState.currentTime,
itemDuration: state.metadata.itemDuration,
isUserSeeking: state.playerState.isUserSeeking,
seekValue: state.playerState.seekValue,
})),
);
return (
<div className="video-player-osd-controls-timeline-text">
<Typography>
{ticksDisplay(isUserSeeking ? (seekValue ?? 0) : (currentTime ?? 0))}
</Typography>
<Typography>{ticksDisplay(itemDuration)}</Typography>
</div>
);
};
export default ProgressDislay;