Переглянути джерело

fix(JitsiTrack) Add setSourceName/getSourceName methods to JitsiTrack class.

dev1
Jaya Allamsetty 2 роки тому
джерело
коміт
0fc0a3ff31

+ 10
- 3
modules/RTC/JitsiRemoteTrack.js Переглянути файл

@@ -265,14 +265,21 @@ export default class JitsiRemoteTrack extends JitsiTrack {
265 265
      * Update the properties when the track is remapped to another source.
266 266
      *
267 267
      * @param {string} owner The endpoint ID of the new owner.
268
-     * @param {string} name The new source name.
269 268
      */
270
-    setNewSource(owner, name) {
269
+    setOwner(owner) {
271 270
         this.ownerEndpointId = owner;
272
-        this._sourceName = name;
273 271
         this.emit(JitsiTrackEvents.TRACK_OWNER_CHANGED, owner);
274 272
     }
275 273
 
274
+    /**
275
+     * Sets the name of the source associated with the remtoe track.
276
+     *
277
+     * @param {string} name - The source name to be associated with the track.
278
+     */
279
+    setSourceName(name) {
280
+        this._sourceName = name;
281
+    }
282
+
276 283
     /**
277 284
      * Changes the video type of the track.
278 285
      *

+ 17
- 0
modules/RTC/JitsiTrack.js Переглянути файл

@@ -303,6 +303,14 @@ export default class JitsiTrack extends EventEmitter {
303 303
         return this.stream;
304 304
     }
305 305
 
306
+    /**
307
+     * Returns the source name of the track.
308
+     * @returns {String|undefined}
309
+     */
310
+    getSourceName() { // eslint-disable-line no-unused-vars
311
+        // Should be defined by the classes that are extending JitsiTrack
312
+    }
313
+
306 314
     /**
307 315
      * Returns the ID of the underlying WebRTC Media Stream(if any)
308 316
      * @returns {String|null}
@@ -497,4 +505,13 @@ export default class JitsiTrack extends EventEmitter {
497 505
                         audioOutputDeviceId);
498 506
                 }));
499 507
     }
508
+
509
+    /**
510
+     * Assigns the source name to a track.
511
+     * @param {String} name - The name to be assigned to the track.
512
+     * @returns {void}
513
+     */
514
+    setSourceName(name) { // eslint-disable-line no-unused-vars
515
+        // Should be defined by the classes that are extending JitsiTrack
516
+    }
500 517
 }

+ 2
- 1
modules/xmpp/JingleSessionPC.js Переглянути файл

@@ -1856,7 +1856,8 @@ export default class JingleSessionPC extends JingleSession {
1856 1856
                         track._setVideoType('desktop');
1857 1857
                     }
1858 1858
 
1859
-                    track.setNewSource(s.owner, s.source);
1859
+                    track.setSourceName(s.source);
1860
+                    track.setOwner(s.owner);
1860 1861
                 } else {
1861 1862
                     logger.error(`Remapped SSRC ${s.ssrc} not found`);
1862 1863
                 }

Завантаження…
Відмінити
Зберегти