Prevents firing events for the active speaker for the local user. Implements getUserID in JitsiConference.

This commit is contained in:
hristoterezov 2015-10-15 16:46:06 -05:00
parent ae355cbea5
commit ff779512c2
2 changed files with 18 additions and 2 deletions

View File

@ -191,6 +191,14 @@ JitsiConference.prototype.onMemberJoined = function (jid, email, nick) {
// this.participants[jid] = new JitsiParticipant();
}
/**
* Returns the local user's ID
* @return {string} local user's ID
*/
JitsiConference.prototype.myUserId = function () {
return (this.room && this.room.myroomjid)? Strophe.getResourceFromJid(this.room.myroomjid) : null;
}
/**
* Setups the listeners needed for the conference.
* @param conference the conference
@ -221,7 +229,7 @@ function setupListeners(conference) {
// });
conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
if(conference.lastActiveSpeaker !== id && conference.room
&& conference.room.myroomjid !== id) {
&& conference.myUserId() !== id) {
conference.lastActiveSpeaker = id;
conference.eventEmitter.emit(JitsiConferenceEvents.ACTIVE_SPEAKER_CHANGED, id);
}

View File

@ -192,6 +192,14 @@ JitsiConference.prototype.onMemberJoined = function (jid, email, nick) {
// this.participants[jid] = new JitsiParticipant();
}
/**
* Returns the local user's ID
* @return {string} local user's ID
*/
JitsiConference.prototype.myUserId = function () {
return (this.room && this.room.myroomjid)? Strophe.getResourceFromJid(this.room.myroomjid) : null;
}
/**
* Setups the listeners needed for the conference.
* @param conference the conference
@ -222,7 +230,7 @@ function setupListeners(conference) {
// });
conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
if(conference.lastActiveSpeaker !== id && conference.room
&& conference.room.myroomjid !== id) {
&& conference.myUserId() !== id) {
conference.lastActiveSpeaker = id;
conference.eventEmitter.emit(JitsiConferenceEvents.ACTIVE_SPEAKER_CHANGED, id);
}