The RelatedMedia component

The RelatedMedia component takes the list of related media as a prop from the PlayMedia component, and renders the details along with a video snapshot of each video in the list.

We iterate through the media list using the map function to render each media item.

mern-mediastream/client/media/RelatedMedia.js:

{this.props.media.map((item, i) => {     return       <span key={i}>... video snapshot ... | ... media details ...</span>   })}

To show the video snapshot, we will use a basic ReactPlayer without the controls.

mern-mediastream/client/media/RelatedMedia.js:

<Link to={"/media/"+item._id}>  <ReactPlayer url={'/api/media/video/'+item._id} width='160px'      height='140px'/></Link>

Clicking on the snapshot will re-render the PlayMedia ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.