浏览代码

fix: RTC track events emitted when switching jvb<->p2p

JitsiConference should emit JitsiConference events instead of RTC events
when adding/removing tracks on jvb<->p2p switch. This behaviour was mixing RTC layer
with the conference one. When conference switches from jvb to p2p it wants to make
the application switch to use p2p JitsiTracks, but it doesn't mean that the JVB tracks
have been removed on the RTC/peer connection level.
dev1
paweldomas 5 年前
父节点
当前提交
f3199b7e2f
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2
    3
      JitsiConference.js

+ 2
- 3
JitsiConference.js 查看文件

@@ -43,7 +43,6 @@ import VideoSIPGW from './modules/videosipgw/VideoSIPGW';
43 43
 import * as VideoSIPGWConstants from './modules/videosipgw/VideoSIPGWConstants';
44 44
 import { JITSI_MEET_MUC_TYPE } from './modules/xmpp/xmpp';
45 45
 import * as MediaType from './service/RTC/MediaType';
46
-import * as RTCEvents from './service/RTC/RTCEvents';
47 46
 import VideoType from './service/RTC/VideoType';
48 47
 import {
49 48
     ACTION_JINGLE_RESTART,
@@ -2745,7 +2744,7 @@ JitsiConference.prototype._addRemoteP2PTracks = function() {
2745 2744
 JitsiConference.prototype._addRemoteTracks = function(logName, remoteTracks) {
2746 2745
     for (const track of remoteTracks) {
2747 2746
         logger.info(`Adding remote ${logName} track: ${track}`);
2748
-        this.rtc.eventEmitter.emit(RTCEvents.REMOTE_TRACK_ADDED, track);
2747
+        this.onRemoteTrackAdded(track);
2749 2748
     }
2750 2749
 };
2751 2750
 
@@ -2932,7 +2931,7 @@ JitsiConference.prototype._removeRemoteTracks = function(
2932 2931
         remoteTracks) {
2933 2932
     for (const track of remoteTracks) {
2934 2933
         logger.info(`Removing remote ${sessionNickname} track: ${track}`);
2935
-        this.rtc.eventEmitter.emit(RTCEvents.REMOTE_TRACK_REMOVED, track);
2934
+        this.onRemoteTrackRemoved(track);
2936 2935
     }
2937 2936
 };
2938 2937
 

正在加载...
取消
保存