Merge pull request #11515 from mariogasparoni/fix-11490
Cleanup joinedAudioOnly state when user disconnects or reconnect microphone
This commit is contained in:
commit
e70470e975
@ -135,4 +135,5 @@ export default {
|
||||
},
|
||||
isReturningFromBreakoutAudioTransfer:
|
||||
() => AudioManager.returningFromBreakoutAudioTransfer,
|
||||
isReconnecting: () => AudioManager.isReconnecting,
|
||||
};
|
||||
|
@ -102,11 +102,14 @@ class BreakoutRoom extends PureComponent {
|
||||
breakoutRoomUser,
|
||||
breakoutRooms,
|
||||
closeBreakoutPanel,
|
||||
isMicrophoneUser,
|
||||
isReconnecting,
|
||||
} = this.props;
|
||||
|
||||
const {
|
||||
waiting,
|
||||
requestedBreakoutId,
|
||||
joinedAudioOnly,
|
||||
} = this.state;
|
||||
|
||||
if (breakoutRooms.length <= 0) closeBreakoutPanel();
|
||||
@ -120,6 +123,10 @@ class BreakoutRoom extends PureComponent {
|
||||
_.delay(() => this.setState({ waiting: false }), 1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (joinedAudioOnly && (!isMicrophoneUser || isReconnecting)) {
|
||||
this.clearJoinedAudioOnly();
|
||||
}
|
||||
}
|
||||
|
||||
getBreakoutURL(breakoutId) {
|
||||
@ -144,6 +151,10 @@ class BreakoutRoom extends PureComponent {
|
||||
return null;
|
||||
}
|
||||
|
||||
clearJoinedAudioOnly() {
|
||||
this.setState({ joinedAudioOnly: false });
|
||||
}
|
||||
|
||||
transferUserToBreakoutRoom(breakoutId) {
|
||||
const { transferToBreakout } = this.props;
|
||||
transferToBreakout(breakoutId);
|
||||
|
@ -25,6 +25,7 @@ export default withTracker((props) => {
|
||||
const breakoutRooms = findBreakouts();
|
||||
const isMicrophoneUser = AudioService.isConnected() && !AudioService.isListenOnly();
|
||||
const isMeteorConnected = Meteor.status().connected;
|
||||
const isReconnecting = AudioService.isReconnecting();
|
||||
const { setReturningFromBreakoutAudioTransfer } = AudioService;
|
||||
|
||||
return {
|
||||
@ -43,5 +44,6 @@ export default withTracker((props) => {
|
||||
isUserInBreakoutRoom,
|
||||
exitAudio: () => AudioManager.exitAudio(),
|
||||
setReturningFromBreakoutAudioTransfer,
|
||||
isReconnecting,
|
||||
};
|
||||
})(BreakoutContainer);
|
||||
|
@ -52,6 +52,7 @@ class AudioManager {
|
||||
outputDeviceId: null,
|
||||
muteHandle: null,
|
||||
autoplayBlocked: false,
|
||||
isReconnecting: false,
|
||||
});
|
||||
|
||||
this.useKurento = Meteor.settings.public.kurento.enableListenOnly;
|
||||
@ -392,12 +393,15 @@ class AudioManager {
|
||||
} = response;
|
||||
|
||||
if (status === STARTED) {
|
||||
this.isReconnecting = false;
|
||||
this.onAudioJoin();
|
||||
resolve(STARTED);
|
||||
} else if (status === ENDED) {
|
||||
this.isReconnecting = false;
|
||||
logger.info({ logCode: 'audio_ended' }, 'Audio ended without issue');
|
||||
this.onAudioExit();
|
||||
} else if (status === FAILED) {
|
||||
this.isReconnecting = false;
|
||||
const errorKey = this.messages.error[error] || this.messages.error.GENERIC_ERROR;
|
||||
const errorMsg = this.intl.formatMessage(errorKey, { 0: bridgeError });
|
||||
this.error = !!error;
|
||||
@ -415,10 +419,12 @@ class AudioManager {
|
||||
this.onAudioExit();
|
||||
}
|
||||
} else if (status === RECONNECTING) {
|
||||
this.isReconnecting = true;
|
||||
logger.info({ logCode: 'audio_reconnecting' }, 'Attempting to reconnect audio');
|
||||
this.notify(this.intl.formatMessage(this.messages.info.RECONNECTING_AUDIO), true);
|
||||
this.playHangUpSound();
|
||||
} else if (status === AUTOPLAY_BLOCKED) {
|
||||
this.isReconnecting = false;
|
||||
this.autoplayBlocked = true;
|
||||
this.onAudioJoin();
|
||||
resolve(AUTOPLAY_BLOCKED);
|
||||
|
Loading…
Reference in New Issue
Block a user