Using a React media player to render the video

In the frontend of the application, we can render the video file being streamed from MongoDB GridFS in a media player. A good option for a React-flavored media player is the ReactPlayer component, available as a node module, which can be customized as required. Providing the video stream as a source to a default ReactPlayer component will render with basic player controls, as shown in the following screenshot:

To start using ReactPlayer in our frontend code, we need to install the corresponding node module by running the following Yarn command from the command line:

yarn add react-player 

Once ...

Get Full-Stack React Projects - Second Edition 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.