Handle mute state changes
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
							parent
							
								
									50c27ebed7
								
							
						
					
					
						commit
						5dd34de5fe
					
				|  | @ -85,10 +85,12 @@ export default class VideoFeed extends React.Component<IProps, IState> { | |||
| 
 | ||||
|         if (oldFeed) { | ||||
|             this.props.feed.removeListener(CallFeedEvent.NewStream, this.onNewStream); | ||||
|             this.props.feed.removeListener(CallFeedEvent.MuteStateChanged, this.onMuteStateChanged); | ||||
|             this.stopMedia(); | ||||
|         } | ||||
|         if (newFeed) { | ||||
|             this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream); | ||||
|             this.props.feed.addListener(CallFeedEvent.MuteStateChanged, this.onMuteStateChanged); | ||||
|             this.playMedia(); | ||||
|         } | ||||
|     } | ||||
|  | @ -137,6 +139,14 @@ export default class VideoFeed extends React.Component<IProps, IState> { | |||
|         this.playMedia(); | ||||
|     }; | ||||
| 
 | ||||
|     private onMuteStateChanged = () => { | ||||
|         this.setState({ | ||||
|             audioMuted: this.props.feed.isAudioMuted(), | ||||
|             videoMuted: this.props.feed.isVideoMuted(), | ||||
|         }); | ||||
|         this.playMedia(); | ||||
|     }; | ||||
| 
 | ||||
|     private onResize = (e) => { | ||||
|         if (this.props.onResize && !this.props.feed.isLocal()) { | ||||
|             this.props.onResize(e); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Šimon Brandner
						Šimon Brandner