May 2018
Intermediate to advanced
470 pages
13h 54m
English
Besides letting the user set autoplay, the toggle will also indicate whether it is currently set or not:

For the autoplay toggle, we will use a Material-UI Switch component along with a FormControlLabel, and add it to the PlayMedia component over the RelatedMedia component to be rendered only when there are media in the related media list.
mern-mediastream/client/media/PlayMedia.js:
<FormControlLabel control={ <Switch checked={this.state.autoPlay} onChange={this.handleChange} color="primary" /> } label={this.state.autoPlay? 'Autoplay ON':'Autoplay OFF'}/>
To handle the change to the toggle and reflect it in the state's ...
Read now
Unlock full access