Handle mute state changes
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
50c27ebed7
commit
5dd34de5fe
1 changed files with 10 additions and 0 deletions
|
@ -85,10 +85,12 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
if (oldFeed) {
|
if (oldFeed) {
|
||||||
this.props.feed.removeListener(CallFeedEvent.NewStream, this.onNewStream);
|
this.props.feed.removeListener(CallFeedEvent.NewStream, this.onNewStream);
|
||||||
|
this.props.feed.removeListener(CallFeedEvent.MuteStateChanged, this.onMuteStateChanged);
|
||||||
this.stopMedia();
|
this.stopMedia();
|
||||||
}
|
}
|
||||||
if (newFeed) {
|
if (newFeed) {
|
||||||
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
|
this.props.feed.addListener(CallFeedEvent.NewStream, this.onNewStream);
|
||||||
|
this.props.feed.addListener(CallFeedEvent.MuteStateChanged, this.onMuteStateChanged);
|
||||||
this.playMedia();
|
this.playMedia();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,6 +139,14 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||||
this.playMedia();
|
this.playMedia();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private onMuteStateChanged = () => {
|
||||||
|
this.setState({
|
||||||
|
audioMuted: this.props.feed.isAudioMuted(),
|
||||||
|
videoMuted: this.props.feed.isVideoMuted(),
|
||||||
|
});
|
||||||
|
this.playMedia();
|
||||||
|
};
|
||||||
|
|
||||||
private onResize = (e) => {
|
private onResize = (e) => {
|
||||||
if (this.props.onResize && !this.props.feed.isLocal()) {
|
if (this.props.onResize && !this.props.feed.isLocal()) {
|
||||||
this.props.onResize(e);
|
this.props.onResize(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue