Skip to content

Commit

Permalink
trigger state change for react player to be rerendered on reset
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Sep 14, 2023
1 parent 8c083fc commit 6292499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/hooks/useHLSPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6292499

Please sign in to comment.