|
|
@@ -1909,7 +1909,8 @@ JitsiConference.prototype._acceptP2PIncomingCall
|
|
1909
|
1909
|
* @private
|
|
1910
|
1910
|
*/
|
|
1911
|
1911
|
JitsiConference.prototype._addRemoteJVBTracks = function() {
|
|
1912
|
|
- this._addRemoteTracks('JVB', this.jvbJingleSession);
|
|
|
1912
|
+ this._addRemoteTracks(
|
|
|
1913
|
+ 'JVB', this.jvbJingleSession.peerconnection.getRemoteTracks());
|
|
1913
|
1914
|
};
|
|
1914
|
1915
|
|
|
1915
|
1916
|
/**
|
|
|
@@ -1917,25 +1918,18 @@ JitsiConference.prototype._addRemoteJVBTracks = function() {
|
|
1917
|
1918
|
* @private
|
|
1918
|
1919
|
*/
|
|
1919
|
1920
|
JitsiConference.prototype._addRemoteP2PTracks = function() {
|
|
1920
|
|
- this._addRemoteTracks('P2P', this.p2pJingleSession);
|
|
|
1921
|
+ this._addRemoteTracks(
|
|
|
1922
|
+ 'P2P', this.p2pJingleSession.peerconnection.getRemoteTracks());
|
|
1921
|
1923
|
};
|
|
1922
|
1924
|
|
|
1923
|
1925
|
/**
|
|
1924
|
1926
|
* Generates fake "remote track added" events for given Jingle session.
|
|
1925
|
1927
|
* @param {string} logName the session's nickname which will appear in log
|
|
1926
|
1928
|
* messages.
|
|
1927
|
|
- * @param {JingleSessionPC} jingleSession the session for which remote tracks
|
|
1928
|
|
- * will be added.
|
|
|
1929
|
+ * @param {Array<JitsiRemoteTrack>} remoteTracks the tracks that will be added
|
|
1929
|
1930
|
* @private
|
|
1930
|
1931
|
*/
|
|
1931
|
|
-JitsiConference.prototype._addRemoteTracks = function(logName, jingleSession) {
|
|
1932
|
|
- if (!jingleSession) {
|
|
1933
|
|
- logger.info(`Not adding remote ${logName} tracks - no session yet`);
|
|
1934
|
|
-
|
|
1935
|
|
- return;
|
|
1936
|
|
- }
|
|
1937
|
|
- const remoteTracks = jingleSession.peerconnection.getRemoteTracks();
|
|
1938
|
|
-
|
|
|
1932
|
+JitsiConference.prototype._addRemoteTracks = function(logName, remoteTracks) {
|
|
1939
|
1933
|
for (const track of remoteTracks) {
|
|
1940
|
1934
|
logger.info(`Adding remote ${logName} track: ${track}`);
|
|
1941
|
1935
|
this.rtc.eventEmitter.emit(RTCEvents.REMOTE_TRACK_ADDED, track);
|
|
|
@@ -1964,7 +1958,11 @@ JitsiConference.prototype._onIceConnectionEstablished
|
|
1964
|
1958
|
this._setP2PStatus(true);
|
|
1965
|
1959
|
|
|
1966
|
1960
|
// Remove remote tracks
|
|
1967
|
|
- this._removeRemoteJVBTracks();
|
|
|
1961
|
+ if (this.jvbJingleSession) {
|
|
|
1962
|
+ this._removeRemoteJVBTracks();
|
|
|
1963
|
+ } else {
|
|
|
1964
|
+ logger.info('Not removing remote JVB tracks - no session yet');
|
|
|
1965
|
+ }
|
|
1968
|
1966
|
|
|
1969
|
1967
|
// Add remote tracks
|
|
1970
|
1968
|
this._addRemoteP2PTracks();
|
|
|
@@ -1997,7 +1995,8 @@ JitsiConference.prototype._maybeClearDeferredStartP2P = function() {
|
|
1997
|
1995
|
* @private
|
|
1998
|
1996
|
*/
|
|
1999
|
1997
|
JitsiConference.prototype._removeRemoteJVBTracks = function() {
|
|
2000
|
|
- this._removeRemoteTracks('JVB', this.jvbJingleSession);
|
|
|
1998
|
+ this._removeRemoteTracks(
|
|
|
1999
|
+ 'JVB', this.jvbJingleSession.peerconnection.getRemoteTracks());
|
|
2001
|
2000
|
};
|
|
2002
|
2001
|
|
|
2003
|
2002
|
/**
|
|
|
@@ -2006,27 +2005,19 @@ JitsiConference.prototype._removeRemoteJVBTracks = function() {
|
|
2006
|
2005
|
* @private
|
|
2007
|
2006
|
*/
|
|
2008
|
2007
|
JitsiConference.prototype._removeRemoteP2PTracks = function() {
|
|
2009
|
|
- this._removeRemoteTracks('P2P', this.p2pJingleSession);
|
|
|
2008
|
+ this._removeRemoteTracks(
|
|
|
2009
|
+ 'P2P', this.p2pJingleSession.peerconnection.getRemoteTracks());
|
|
2010
|
2010
|
};
|
|
2011
|
2011
|
|
|
2012
|
2012
|
/**
|
|
2013
|
2013
|
* Generates fake "remote track removed" events for given Jingle session.
|
|
2014
|
2014
|
* @param {string} sessionNickname the session's nickname which will appear in
|
|
2015
|
2015
|
* log messages.
|
|
2016
|
|
- * @param {JingleSessionPC} jingleSession the session for which remote tracks
|
|
2017
|
|
- * will be removed.
|
|
|
2016
|
+ * @param {Array<JitsiRemoteTrack>} remoteTracks the tracks that will be removed
|
|
2018
|
2017
|
* @private
|
|
2019
|
2018
|
*/
|
|
2020
|
2019
|
JitsiConference.prototype._removeRemoteTracks
|
|
2021
|
|
-= function(sessionNickname, jingleSession) {
|
|
2022
|
|
- if (!jingleSession) {
|
|
2023
|
|
- logger.info(
|
|
2024
|
|
- `Not removing remote ${sessionNickname} tracks - no session yet`);
|
|
2025
|
|
-
|
|
2026
|
|
- return;
|
|
2027
|
|
- }
|
|
2028
|
|
- const remoteTracks = jingleSession.peerconnection.getRemoteTracks();
|
|
2029
|
|
-
|
|
|
2020
|
+= function(sessionNickname, remoteTracks) {
|
|
2030
|
2021
|
for (const track of remoteTracks) {
|
|
2031
|
2022
|
logger.info(`Removing remote ${sessionNickname} track: ${track}`);
|
|
2032
|
2023
|
this.rtc.eventEmitter.emit(RTCEvents.REMOTE_TRACK_REMOVED, track);
|
|
|
@@ -2270,7 +2261,11 @@ JitsiConference.prototype._stopP2PSession
|
|
2270
|
2261
|
|
|
2271
|
2262
|
if (wasP2PEstablished) {
|
|
2272
|
2263
|
// Add back remote JVB tracks
|
|
2273
|
|
- this._addRemoteJVBTracks();
|
|
|
2264
|
+ if (this.jvbJingleSession) {
|
|
|
2265
|
+ this._addRemoteJVBTracks();
|
|
|
2266
|
+ } else {
|
|
|
2267
|
+ logger.info('Not adding remote JVB tracks - no session yet');
|
|
|
2268
|
+ }
|
|
2274
|
2269
|
}
|
|
2275
|
2270
|
|
|
2276
|
2271
|
// Start remote stats
|