April 2020
Intermediate to advanced
716 pages
18h 55m
English
On the play media page, we will add an autoplay toggle option above the related media list. Besides letting the user set autoplay, the toggle will also indicate whether it is currently set or not, as shown in the following screenshot:

To add the autoplay toggle option, we will use a Material-UI Switch component along with a FormControlLabel, and add it to the PlayMedia component over the RelatedMedia component. It will only be rendered when there are media in the related media list. We will add this Switch component representing the autoplay toggle as shown in the following code:
mern-mediastream/client/media/PlayMedia.js ...
Read now
Unlock full access