Skip to content

Commit

Permalink
Merge pull request #777 from AI4Bharat/reports2
Browse files Browse the repository at this point in the history
fixed minor error for ytdlp
  • Loading branch information
aparna-aa authored Aug 2, 2024
2 parents 68dafbb + caf831e commit 23bdd03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/containers/Organization/Video/components/VideoPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const VideoPanel = memo(
const $video = createRef();

const [poster, setPoster] = useState("play.png");
const [ytdlpError, setYtdlpError] = useState(false);

const videoDetails = useSelector((state) => state.getVideoDetails.data);
const taskData = useSelector((state) => state.getTaskDetails.data);
Expand Down Expand Up @@ -62,7 +63,7 @@ const VideoPanel = memo(

return (
<div className={classes.videoPlayerParent} style={{display: "flex", alignItems: "center", justifyContent: "center", height:"100%"}}>
{ videoDetails.length === 0 && taskData?.video_url?.includes("youtube") ?
{ ((videoDetails.length === 0 && taskData?.video_url?.includes("youtube")) || ytdlpError === true) ?
<ReactPlayerYT
onReady={() => {dispatch(setPlayer($video.current.getInternalPlayer()))}}
ref={$video}
Expand All @@ -89,7 +90,8 @@ const VideoPanel = memo(
className={classes.videoPlayer}
controls={true}
controlsList="nodownload"
onReady={() => {dispatch(setPlayer($video.current.getInternalPlayer()))}}
onReady={() => {dispatch(setPlayer($video.current.getInternalPlayer())); console.log($video.current.getInternalPlayer());}}
onError={() => {setYtdlpError(true);}}
/>
}
</div>
Expand Down

0 comments on commit 23bdd03

Please sign in to comment.