Skip to content
Snippets Groups Projects
Unverified Commit ff1357cb authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Revert "Improve audio reconnection for muted users for 2.2"

parent 6fc4dbae
No related branches found
No related tags found
No related merge requests found
......@@ -3,9 +3,8 @@ import { extractCredentials } from '/imports/api/common/server/helpers';
import RedisPubSub from '/imports/startup/server/redis';
import Users from '/imports/api/users';
import VoiceUsers from '/imports/api/voice-users';
import _ from 'lodash';
export default function muteToggle(uId, implicitMutedState) {
export default function muteToggle(uId) {
const REDIS_CONFIG = Meteor.settings.private.redis;
const CHANNEL = REDIS_CONFIG.channels.toAkkaApps;
const EVENT_NAME = 'MuteUserCmdMsg';
......@@ -31,7 +30,7 @@ export default function muteToggle(uId, implicitMutedState) {
const payload = {
userId: userToMute,
mutedBy: requesterUserId,
mute: _.isNil(implicitMutedState) ? !muted : implicitMutedState,
mute: !muted,
};
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
......
......@@ -8,7 +8,6 @@ import { notify } from '/imports/ui/services/notification';
import playAndRetry from '/imports/utils/mediaElementPlayRetry';
import iosWebviewAudioPolyfills from '/imports/utils/ios-webview-audio-polyfills';
import { tryGenerateIceCandidates } from '/imports/utils/safari-webrtc';
import { makeCall } from '/imports/ui/services/api';
import AudioErrors from './error-codes';
const MEDIA = Meteor.settings.public.media;
......@@ -45,7 +44,6 @@ class AudioManager {
outputDeviceId: null,
muteHandle: null,
autoplayBlocked: false,
wasMuted: false,
});
this.useKurento = Meteor.settings.public.kurento.enableListenOnly;
......@@ -283,17 +281,13 @@ class AudioManager {
this.isConnecting = false;
this.isConnected = true;
if (this.wasMuted) {
makeCall('toggleVoice', true);
this.wasMuted = false;
}
// listen to the VoiceUsers changes and update the flag
if (!this.muteHandle) {
const query = VoiceUsers.find({ intId: Auth.userID }, { fields: { muted: 1, talking: 1 } });
this.muteHandle = query.observeChanges({
changed: (id, fields) => {
if (fields.muted !== undefined && fields.muted !== this.isMuted) {
this.isMuted = true;
this.isMuted = fields.muted;
const muteState = this.isMuted ? 'selfMuted' : 'selfUnmuted';
window.parent.postMessage({ response: muteState }, '*');
}
......@@ -385,8 +379,6 @@ class AudioManager {
this.onAudioExit();
}
} else if (status === RECONNECTING) {
// I catch it here, because any place after reconnecting will clear this state
if (this.isMuted) this.wasMuted = true;
logger.info({ logCode: 'audio_reconnecting' }, 'Attempting to reconnect audio');
this.notify(this.intl.formatMessage(this.messages.info.RECONNECTING_AUDIO), true);
this.playHangUpSound();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment