Fix hls not loading video in explore (#19625)

This commit is contained in:
Nicolas Mowen 2025-08-19 12:14:14 -06:00 committed by GitHub
parent d27e8c1bbf
commit ec2543c23f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,10 @@
import React, { useState, useRef, useEffect, useCallback } from "react";
import React, {
useState,
useRef,
useEffect,
useCallback,
useMemo,
} from "react";
import { useVideoDimensions } from "@/hooks/use-video-dimensions";
import HlsVideoPlayer from "./HlsVideoPlayer";
import ActivityIndicator from "../indicators/activity-indicator";
@ -89,6 +95,12 @@ export function GenericVideoPlayer({
},
);
const hlsSource = useMemo(() => {
return {
playlist: source,
};
}, [source]);
return (
<div ref={containerRef} className="relative flex h-full w-full flex-col">
<div className="relative flex flex-grow items-center justify-center">
@ -107,9 +119,7 @@ export function GenericVideoPlayer({
>
<HlsVideoPlayer
videoRef={videoRef}
currentSource={{
playlist: source,
}}
currentSource={hlsSource}
hotKeys
visible
frigateControls={false}