|
|
@@ -150,6 +150,18 @@ JitsiTrack.prototype.getUsageLabel = function () {
|
|
150
|
150
|
}
|
|
151
|
151
|
};
|
|
152
|
152
|
|
|
|
153
|
+/**
|
|
|
154
|
+ * Eventually will trigger RTCEvents.TRACK_ATTACHED event.
|
|
|
155
|
+ * @param container the video/audio container to which this stream is attached
|
|
|
156
|
+ * and for which event will be fired.
|
|
|
157
|
+ * @private
|
|
|
158
|
+ */
|
|
|
159
|
+JitsiTrack.prototype._maybeFireTrackAttached = function (container) {
|
|
|
160
|
+ if (this.rtc && container) {
|
|
|
161
|
+ this.rtc.eventEmitter.emit(RTCEvents.TRACK_ATTACHED, this, container);
|
|
|
162
|
+ }
|
|
|
163
|
+};
|
|
|
164
|
+
|
|
153
|
165
|
/**
|
|
154
|
166
|
* Mutes the track.
|
|
155
|
167
|
*/
|
|
|
@@ -194,10 +206,10 @@ JitsiTrack.prototype.attach = function (container) {
|
|
194
|
206
|
}
|
|
195
|
207
|
this.containers.push(container);
|
|
196
|
208
|
|
|
197
|
|
- this.rtc.eventEmitter.emit(RTCEvents.TRACK_ATTACHED, this, container);
|
|
|
209
|
+ this._maybeFireTrackAttached(container);
|
|
198
|
210
|
|
|
199
|
211
|
return container;
|
|
200
|
|
-}
|
|
|
212
|
+};
|
|
201
|
213
|
|
|
202
|
214
|
/**
|
|
203
|
215
|
* Removes the track from the passed HTML container.
|