소스 검색

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

dev1
hristoterezov 10 년 전
부모
커밋
74215b3744
2개의 변경된 파일18개의 추가작업 그리고 2개의 파일을 삭제
  1. 9
    1
      JitsiConference.js
  2. 9
    1
      lib-jitsi-meet.js

+ 9
- 1
JitsiConference.js 파일 보기

@@ -191,6 +191,14 @@ JitsiConference.prototype.onMemberJoined = function (jid, email, nick) {
191 191
 //    this.participants[jid] = new JitsiParticipant();
192 192
 }
193 193
 
194
+/**
195
+ * Returns the local user's ID
196
+ * @return {string} local user's ID
197
+ */
198
+JitsiConference.prototype.myUserId = function () {
199
+    return (this.room && this.room.myroomjid)? Strophe.getResourceFromJid(this.room.myroomjid) : null;
200
+}
201
+
194 202
 /**
195 203
  * Setups the listeners needed for the conference.
196 204
  * @param conference the conference
@@ -221,7 +229,7 @@ function setupListeners(conference) {
221 229
 //    });
222 230
     conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
223 231
         if(conference.lastActiveSpeaker !== id && conference.room
224
-            && conference.room.myroomjid !== id) {
232
+            && conference.myUserId() !== id) {
225 233
             conference.lastActiveSpeaker = id;
226 234
             conference.eventEmitter.emit(JitsiConferenceEvents.ACTIVE_SPEAKER_CHANGED, id);
227 235
         }

+ 9
- 1
lib-jitsi-meet.js 파일 보기

@@ -192,6 +192,14 @@ JitsiConference.prototype.onMemberJoined = function (jid, email, nick) {
192 192
 //    this.participants[jid] = new JitsiParticipant();
193 193
 }
194 194
 
195
+/**
196
+ * Returns the local user's ID
197
+ * @return {string} local user's ID
198
+ */
199
+JitsiConference.prototype.myUserId = function () {
200
+    return (this.room && this.room.myroomjid)? Strophe.getResourceFromJid(this.room.myroomjid) : null;
201
+}
202
+
195 203
 /**
196 204
  * Setups the listeners needed for the conference.
197 205
  * @param conference the conference
@@ -222,7 +230,7 @@ function setupListeners(conference) {
222 230
 //    });
223 231
     conference.rtc.addListener(RTCEvents.DOMINANTSPEAKER_CHANGED, function (id) {
224 232
         if(conference.lastActiveSpeaker !== id && conference.room
225
-            && conference.room.myroomjid !== id) {
233
+            && conference.myUserId() !== id) {
226 234
             conference.lastActiveSpeaker = id;
227 235
             conference.eventEmitter.emit(JitsiConferenceEvents.ACTIVE_SPEAKER_CHANGED, id);
228 236
         }

Loading…
취소
저장