|
|
@@ -46,20 +46,25 @@ function createMuteUnmutePromise(track, mute) {
|
|
46
|
46
|
* One <tt>JitsiLocalTrack</tt> corresponds to one WebRTC MediaStreamTrack.
|
|
47
|
47
|
*/
|
|
48
|
48
|
export default class JitsiLocalTrack extends JitsiTrack {
|
|
49
|
|
- /* eslint-disable max-params */
|
|
50
|
49
|
/**
|
|
51
|
50
|
* Constructs new JitsiLocalTrack instanse.
|
|
52
|
|
- * @param {number} rtcId the ID assigned by the RTC module
|
|
53
|
|
- * @param stream WebRTC MediaStream, parent of the track
|
|
54
|
|
- * @param track underlying WebRTC MediaStreamTrack for new JitsiRemoteTrack
|
|
55
|
|
- * @param mediaType the MediaType of the JitsiRemoteTrack
|
|
56
|
|
- * @param videoType the VideoType of the JitsiRemoteTrack
|
|
57
|
|
- * @param resolution the video resolution if it's a video track
|
|
58
|
|
- * @param deviceId the ID of the local device for this track
|
|
59
|
|
- * @param facingMode the camera facing mode used in getUserMedia call
|
|
|
51
|
+ * @param {Object} trackInfo
|
|
|
52
|
+ * @param {number} trackInfo.rtcId the ID assigned by the RTC module
|
|
|
53
|
+ * @param trackInfo.stream WebRTC MediaStream, parent of the track
|
|
|
54
|
+ * @param trackInfo.track underlying WebRTC MediaStreamTrack for new
|
|
|
55
|
+ * JitsiRemoteTrack
|
|
|
56
|
+ * @param trackInfo.mediaType the MediaType of the JitsiRemoteTrack
|
|
|
57
|
+ * @param trackInfo.videoType the VideoType of the JitsiRemoteTrack
|
|
|
58
|
+ * @param trackInfo.resolution the video resolution if it's a video track
|
|
|
59
|
+ * @param trackInfo.deviceId the ID of the local device for this track
|
|
|
60
|
+ * @param trackInfo.facingMode the camera facing mode used in getUserMedia
|
|
|
61
|
+ * call
|
|
|
62
|
+ * @param {sourceId} trackInfo.sourceId - The id of the desktop sharing
|
|
|
63
|
+ * source. NOTE: defined for desktop sharing tracks only.
|
|
60
|
64
|
* @constructor
|
|
61
|
65
|
*/
|
|
62
|
|
- constructor(
|
|
|
66
|
+ constructor(trackInfo) {
|
|
|
67
|
+ const {
|
|
63
|
68
|
rtcId,
|
|
64
|
69
|
stream,
|
|
65
|
70
|
track,
|
|
|
@@ -67,7 +72,10 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
|
67
|
72
|
videoType,
|
|
68
|
73
|
resolution,
|
|
69
|
74
|
deviceId,
|
|
70
|
|
- facingMode) {
|
|
|
75
|
+ facingMode,
|
|
|
76
|
+ sourceId
|
|
|
77
|
+ } = trackInfo;
|
|
|
78
|
+
|
|
71
|
79
|
super(
|
|
72
|
80
|
null /* RTC */,
|
|
73
|
81
|
stream,
|
|
|
@@ -88,6 +96,7 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
|
88
|
96
|
this.rtcId = rtcId;
|
|
89
|
97
|
this.dontFireRemoveEvent = false;
|
|
90
|
98
|
this.resolution = resolution;
|
|
|
99
|
+ this.sourceId = sourceId;
|
|
91
|
100
|
|
|
92
|
101
|
// FIXME: currently firefox is ignoring our constraints about
|
|
93
|
102
|
// resolutions so we do not store it, to avoid wrong reporting of local
|
|
|
@@ -177,8 +186,6 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
|
177
|
186
|
this._initNoDataFromSourceHandlers();
|
|
178
|
187
|
}
|
|
179
|
188
|
|
|
180
|
|
- /* eslint-enable max-params */
|
|
181
|
|
-
|
|
182
|
189
|
/**
|
|
183
|
190
|
* Returns if associated MediaStreamTrack is in the 'ended' state
|
|
184
|
191
|
* @returns {boolean}
|