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>
pull/21833/head
Šimon Brandner 2021-07-28 15:04:33 +02:00
parent bc11e215b8
commit 91e65534fa
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
1 changed files with 4 additions and 4 deletions

View File

@ -140,16 +140,16 @@ export default class VideoFeed extends React.Component<IProps, IState> {
// seem to be necessary - Šimon
}
private onNewStream = () => {
this.setState({
private onNewStream = async () => {
await this.setState({
audioMuted: this.props.feed.isAudioMuted(),
videoMuted: this.props.feed.isVideoMuted(),
});
this.playMedia();
};
private onMuteStateChanged = () => {
this.setState({
private onMuteStateChanged = async () => {
await this.setState({
audioMuted: this.props.feed.isAudioMuted(),
videoMuted: this.props.feed.isVideoMuted(),
});