From 62924993b26bc0a00d2566d5992c3b6ab091965b Mon Sep 17 00:00:00 2001 From: khavinshankar Date: Thu, 14 Sep 2023 10:58:15 +0530 Subject: [PATCH] trigger state change for react player to be rerendered on reset --- src/Common/hooks/useHLSPlayer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/hooks/useHLSPlayer.ts b/src/Common/hooks/useHLSPlayer.ts index 7cb5302e76f..32a52043fe7 100644 --- a/src/Common/hooks/useHLSPlayer.ts +++ b/src/Common/hooks/useHLSPlayer.ts @@ -4,7 +4,7 @@ import { IOptions } from "./useMSEplayer"; export const useHLSPLayer = (ref: ReactPlayer | null) => { const startStream = ({ onSuccess, onError }: IOptions = {}) => { try { - ref && ref.forceUpdate(); + ref?.setState({ url: ref?.props.url + "&t=" + Date.now() }); onSuccess && onSuccess(undefined); } catch (err) { onError && onError(err);