await setState to avoid races where we would try to play media without an HTMLVideoElement
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
bc11e215b8
commit
91e65534fa
1 changed files with 4 additions and 4 deletions
|
@ -140,16 +140,16 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||||
// seem to be necessary - Šimon
|
// seem to be necessary - Šimon
|
||||||
}
|
}
|
||||||
|
|
||||||
private onNewStream = () => {
|
private onNewStream = async () => {
|
||||||
this.setState({
|
await this.setState({
|
||||||
audioMuted: this.props.feed.isAudioMuted(),
|
audioMuted: this.props.feed.isAudioMuted(),
|
||||||
videoMuted: this.props.feed.isVideoMuted(),
|
videoMuted: this.props.feed.isVideoMuted(),
|
||||||
});
|
});
|
||||||
this.playMedia();
|
this.playMedia();
|
||||||
};
|
};
|
||||||
|
|
||||||
private onMuteStateChanged = () => {
|
private onMuteStateChanged = async () => {
|
||||||
this.setState({
|
await this.setState({
|
||||||
audioMuted: this.props.feed.isAudioMuted(),
|
audioMuted: this.props.feed.isAudioMuted(),
|
||||||
videoMuted: this.props.feed.isVideoMuted(),
|
videoMuted: this.props.feed.isVideoMuted(),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue