Handle autoplay across components

PlayMedia passes the handleAutoPlay method to the Media component as a prop to be used by the MediaPlayer component when a video ends.

The functionality desired here is that when a video ends, if autoplay is set to true and the current related list of media is not empty, PlayMedia should load the media details of the first video in the related list. In turn, the Media and MediaPlayer components should update with the new media details, start playing the new video and render the controls on the player appropriately. The list in the RelatedMedia component should also update with the current media removed from the list, so only the remaining playlist items are visible.

mern-mediastream/client/media/PlayMedia.js ...

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.