mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-27 13:47:50 +02:00
Fix hls not loading video in explore (#19625)
This commit is contained in:
parent
d27e8c1bbf
commit
ec2543c23f
@ -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 { useVideoDimensions } from "@/hooks/use-video-dimensions";
|
||||||
import HlsVideoPlayer from "./HlsVideoPlayer";
|
import HlsVideoPlayer from "./HlsVideoPlayer";
|
||||||
import ActivityIndicator from "../indicators/activity-indicator";
|
import ActivityIndicator from "../indicators/activity-indicator";
|
||||||
@ -89,6 +95,12 @@ export function GenericVideoPlayer({
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const hlsSource = useMemo(() => {
|
||||||
|
return {
|
||||||
|
playlist: source,
|
||||||
|
};
|
||||||
|
}, [source]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={containerRef} className="relative flex h-full w-full flex-col">
|
<div ref={containerRef} className="relative flex h-full w-full flex-col">
|
||||||
<div className="relative flex flex-grow items-center justify-center">
|
<div className="relative flex flex-grow items-center justify-center">
|
||||||
@ -107,9 +119,7 @@ export function GenericVideoPlayer({
|
|||||||
>
|
>
|
||||||
<HlsVideoPlayer
|
<HlsVideoPlayer
|
||||||
videoRef={videoRef}
|
videoRef={videoRef}
|
||||||
currentSource={{
|
currentSource={hlsSource}
|
||||||
playlist: source,
|
|
||||||
}}
|
|
||||||
hotKeys
|
hotKeys
|
||||||
visible
|
visible
|
||||||
frigateControls={false}
|
frigateControls={false}
|
||||||
|
Loading…
Reference in New Issue
Block a user