* fix recordings check

* Only calculate inpoint offset for beginning of hour segment

* Cleanup

* Fix seeking

* add Czech

* explore i18n fix

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
This commit is contained in:
Josh Hawkins
2025-05-19 14:43:22 -06:00
committed by GitHub
co-authored by Nicolas Mowen
parent 717517aeb5
commit 8a143b4284
8 changed files with 44 additions and 27 deletions
@@ -13,6 +13,7 @@ import { VideoResolutionType } from "@/types/live";
import axios from "axios";
import { cn } from "@/lib/utils";
import { useTranslation } from "react-i18next";
import { calculateInpointOffset } from "@/utils/videoUtil";
/**
* Dynamically switches between video playback and scrubbing preview player.
@@ -197,18 +198,10 @@ export default function DynamicVideoPlayer({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [controller, recordings]);
/** the HLS endpoint returns the vod segments with the first
* segment of the hour trimmed, meaning it will start at
* the beginning of the hour, cutting off any difference
* that the segment has.
*/
const inpointOffset = useMemo(() => {
if (!recordingParams || !recordings) {
return 0;
}
return recordingParams.after - recordings[0].start_time;
}, [recordingParams, recordings]);
const inpointOffset = useMemo(
() => calculateInpointOffset(recordingParams.after, (recordings || [])[0]),
[recordingParams, recordings],
);
return (
<>