Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmute client on the server if he was muted by focus #1

Merged
merged 1 commit into from
Jan 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function JitsiConference(options) {
audio: undefined,
video: undefined
};
this.isMutedByFocus = false;
}

/**
Expand Down Expand Up @@ -308,6 +309,12 @@ JitsiConference.prototype._fireAudioLevelChangeEvent = function (audioLevel) {
* @param track the JitsiTrack object related to the event.
*/
JitsiConference.prototype._fireMuteChangeEvent = function (track) {
// check if track was muted by focus and now is unmuted by user
if (this.isMutedByFocus && track.isAudioTrack() && !track.isMuted()) {
this.isMutedByFocus = false;
// unmute local user on server
this.room.muteParticipant(this.room.myroomjid, false);
}
this.eventEmitter.emit(JitsiConferenceEvents.TRACK_MUTE_CHANGED, track);
};

Expand Down Expand Up @@ -794,6 +801,7 @@ function setupListeners(conference) {
conference.room.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS,
function (value) {
conference.rtc.setAudioMute(value);
conference.isMutedByFocus = true;
}
);

Expand Down