twilio-video 2.25.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +112 -1
- package/README.md +1 -1
- package/dist/twilio-video.js +1481 -1134
- package/dist/twilio-video.min.js +21 -21
- package/es5/media/track/localaudiotrack.js +28 -7
- package/es5/media/track/localaudiotrack.js.map +1 -1
- package/es5/media/track/localmediatrack.js +29 -0
- package/es5/media/track/localmediatrack.js.map +1 -1
- package/es5/media/track/localvideotrack.js +31 -10
- package/es5/media/track/localvideotrack.js.map +1 -1
- package/es5/media/track/sender.js +39 -1
- package/es5/media/track/sender.js.map +1 -1
- package/es5/room.js +50 -1
- package/es5/room.js.map +1 -1
- package/es5/transceiver.js +3 -3
- package/es5/transceiver.js.map +1 -1
- package/es5/webrtc/getstats.js +75 -58
- package/es5/webrtc/getstats.js.map +1 -1
- package/es5/webrtc/getusermedia.js +1 -1
- package/es5/webrtc/getusermedia.js.map +1 -1
- package/es5/webrtc/index.js.map +1 -1
- package/es5/webrtc/rtcpeerconnection/chrome.js +339 -286
- package/es5/webrtc/rtcpeerconnection/chrome.js.map +1 -1
- package/es5/webrtc/rtcpeerconnection/firefox.js +225 -179
- package/es5/webrtc/rtcpeerconnection/firefox.js.map +1 -1
- package/es5/webrtc/rtcpeerconnection/index.js.map +1 -1
- package/es5/webrtc/rtcpeerconnection/safari.js +276 -236
- package/es5/webrtc/rtcpeerconnection/safari.js.map +1 -1
- package/es5/webrtc/rtcrtpsender.js +12 -9
- package/es5/webrtc/rtcrtpsender.js.map +1 -1
- package/es5/webrtc/rtcsessiondescription/chrome.js +29 -22
- package/es5/webrtc/rtcsessiondescription/chrome.js.map +1 -1
- package/es5/webrtc/rtcsessiondescription/index.js.map +1 -1
- package/es5/webrtc/util/index.js +32 -15
- package/es5/webrtc/util/index.js.map +1 -1
- package/es5/webrtc/util/latch.js +83 -82
- package/es5/webrtc/util/latch.js.map +1 -1
- package/es5/webrtc/util/sdp.js +12 -19
- package/es5/webrtc/util/sdp.js.map +1 -1
- package/lib/media/track/localaudiotrack.js +30 -8
- package/lib/media/track/localmediatrack.js +29 -0
- package/lib/media/track/localvideotrack.js +33 -10
- package/lib/media/track/sender.js +42 -1
- package/lib/room.js +41 -1
- package/lib/transceiver.js +3 -3
- package/lib/webrtc/getstats.js +155 -171
- package/lib/webrtc/getusermedia.js +1 -2
- package/lib/webrtc/index.js +1 -1
- package/lib/webrtc/rtcpeerconnection/chrome.js +284 -316
- package/lib/webrtc/rtcpeerconnection/firefox.js +173 -197
- package/lib/webrtc/rtcpeerconnection/index.js +1 -1
- package/lib/webrtc/rtcpeerconnection/safari.js +228 -256
- package/lib/webrtc/rtcrtpsender.js +10 -8
- package/lib/webrtc/rtcsessiondescription/chrome.js +24 -24
- package/lib/webrtc/rtcsessiondescription/index.js +1 -1
- package/lib/webrtc/util/index.js +26 -33
- package/lib/webrtc/util/latch.js +78 -83
- package/lib/webrtc/util/sdp.js +32 -41
- package/package.json +2 -2
- package/tsdef/LocalAudioTrack.d.ts +3 -0
- package/tsdef/LocalVideoTrack.d.ts +3 -0
- package/tsdef/Room.d.ts +1 -0
- package/es5/webrtc/util/eventtarget.js +0 -34
- package/es5/webrtc/util/eventtarget.js.map +0 -1
- package/lib/webrtc/util/eventtarget.js +0 -39
package/dist/twilio-video.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! twilio-video.js 2.
|
|
1
|
+
/*! twilio-video.js 2.26.0
|
|
2
2
|
|
|
3
3
|
The following license applies to all parts of this software except as
|
|
4
4
|
documented below.
|
|
@@ -83,7 +83,7 @@ function createCancelableRoomPromise(getLocalTracks, createLocalParticipant, cre
|
|
|
83
83
|
}
|
|
84
84
|
module.exports = createCancelableRoomPromise;
|
|
85
85
|
|
|
86
|
-
},{"./util/cancelablepromise":
|
|
86
|
+
},{"./util/cancelablepromise":124}],2:[function(require,module,exports){
|
|
87
87
|
'use strict';
|
|
88
88
|
var MediaStreamTrack = require('./webrtc').MediaStreamTrack;
|
|
89
89
|
var _a = require('./webrtc/util'), guessBrowser = _a.guessBrowser, guessBrowserVersion = _a.guessBrowserVersion;
|
|
@@ -999,7 +999,7 @@ function normalizeCodecSettings(nameOrSettings) {
|
|
|
999
999
|
}
|
|
1000
1000
|
module.exports = connect;
|
|
1001
1001
|
|
|
1002
|
-
},{"./cancelableroompromise":1,"./encodingparameters":9,"./localparticipant":
|
|
1002
|
+
},{"./cancelableroompromise":1,"./encodingparameters":9,"./localparticipant":13,"./media/track/es5":15,"./networkqualityconfiguration":44,"./room":57,"./signaling/v2":71,"./util":132,"./util/cancelablepromise":124,"./util/constants":125,"./util/eventobserver":130,"./util/insightspublisher":133,"./util/insightspublisher/null":134,"./util/log":136,"./util/validate":150,"./webrtc":158,"./webrtc/util":170}],3:[function(require,module,exports){
|
|
1003
1003
|
'use strict';
|
|
1004
1004
|
var _a = require('./util/constants'), DEFAULT_LOG_LEVEL = _a.DEFAULT_LOG_LEVEL, DEFAULT_LOGGER_NAME = _a.DEFAULT_LOGGER_NAME;
|
|
1005
1005
|
/**
|
|
@@ -1148,7 +1148,7 @@ module.exports = {
|
|
|
1148
1148
|
video: createLocalVideoTrack
|
|
1149
1149
|
};
|
|
1150
1150
|
|
|
1151
|
-
},{"./util/constants":
|
|
1151
|
+
},{"./util/constants":125}],4:[function(require,module,exports){
|
|
1152
1152
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1153
1153
|
'use strict';
|
|
1154
1154
|
var __assign = (this && this.__assign) || function () {
|
|
@@ -1406,7 +1406,7 @@ function createLocalTracks(options) {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
exports.createLocalTracks = createLocalTracks;
|
|
1408
1408
|
|
|
1409
|
-
},{"./media/track/es5":
|
|
1409
|
+
},{"./media/track/es5":15,"./media/track/noisecancellationimpl":29,"./util":132,"./util/constants":125,"./util/log":136,"./webaudio/workaround180748":155,"./webrtc":158}],5:[function(require,module,exports){
|
|
1410
1410
|
'use strict';
|
|
1411
1411
|
var __extends = (this && this.__extends) || (function () {
|
|
1412
1412
|
var extendStatics = function (d, b) {
|
|
@@ -1605,7 +1605,7 @@ var DataTrackSender = /** @class */ (function (_super) {
|
|
|
1605
1605
|
}(DataTrackTransceiver));
|
|
1606
1606
|
module.exports = DataTrackSender;
|
|
1607
1607
|
|
|
1608
|
-
},{"../util":
|
|
1608
|
+
},{"../util":132,"./transceiver":7}],7:[function(require,module,exports){
|
|
1609
1609
|
'use strict';
|
|
1610
1610
|
var __extends = (this && this.__extends) || (function () {
|
|
1611
1611
|
var extendStatics = function (d, b) {
|
|
@@ -1665,7 +1665,7 @@ var DataTrackTransceiver = /** @class */ (function (_super) {
|
|
|
1665
1665
|
}(TrackTransceiver));
|
|
1666
1666
|
module.exports = DataTrackTransceiver;
|
|
1667
1667
|
|
|
1668
|
-
},{"../transceiver":
|
|
1668
|
+
},{"../transceiver":119}],8:[function(require,module,exports){
|
|
1669
1669
|
'use strict';
|
|
1670
1670
|
var __extends = (this && this.__extends) || (function () {
|
|
1671
1671
|
var extendStatics = function (d, b) {
|
|
@@ -1866,7 +1866,54 @@ var EventEmitter = require('events').EventEmitter;
|
|
|
1866
1866
|
var hidePrivateAndCertainPublicPropertiesInClass = require('./util').hidePrivateAndCertainPublicPropertiesInClass;
|
|
1867
1867
|
module.exports = hidePrivateAndCertainPublicPropertiesInClass(EventEmitter, ['domain']);
|
|
1868
1868
|
|
|
1869
|
-
},{"./util":
|
|
1869
|
+
},{"./util":132,"events":173}],11:[function(require,module,exports){
|
|
1870
|
+
'use strict';
|
|
1871
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
1872
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1873
|
+
if (!m) return o;
|
|
1874
|
+
var i = m.call(o), r, ar = [], e;
|
|
1875
|
+
try {
|
|
1876
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
1877
|
+
}
|
|
1878
|
+
catch (error) { e = { error: error }; }
|
|
1879
|
+
finally {
|
|
1880
|
+
try {
|
|
1881
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
1882
|
+
}
|
|
1883
|
+
finally { if (e) throw e.error; }
|
|
1884
|
+
}
|
|
1885
|
+
return ar;
|
|
1886
|
+
};
|
|
1887
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
1888
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
1889
|
+
to[j] = from[i];
|
|
1890
|
+
return to;
|
|
1891
|
+
};
|
|
1892
|
+
var EventEmitter = require('events').EventEmitter;
|
|
1893
|
+
var EventTarget = /** @class */ (function () {
|
|
1894
|
+
function EventTarget() {
|
|
1895
|
+
Object.defineProperties(this, {
|
|
1896
|
+
_eventEmitter: {
|
|
1897
|
+
value: new EventEmitter()
|
|
1898
|
+
}
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
EventTarget.prototype.dispatchEvent = function (event) {
|
|
1902
|
+
return this._eventEmitter.emit(event.type, event);
|
|
1903
|
+
};
|
|
1904
|
+
EventTarget.prototype.addEventListener = function () {
|
|
1905
|
+
var _a;
|
|
1906
|
+
return (_a = this._eventEmitter).addListener.apply(_a, __spreadArray([], __read(arguments)));
|
|
1907
|
+
};
|
|
1908
|
+
EventTarget.prototype.removeEventListener = function () {
|
|
1909
|
+
var _a;
|
|
1910
|
+
return (_a = this._eventEmitter).removeListener.apply(_a, __spreadArray([], __read(arguments)));
|
|
1911
|
+
};
|
|
1912
|
+
return EventTarget;
|
|
1913
|
+
}());
|
|
1914
|
+
module.exports = EventTarget;
|
|
1915
|
+
|
|
1916
|
+
},{"events":173}],12:[function(require,module,exports){
|
|
1870
1917
|
'use strict';
|
|
1871
1918
|
var __assign = (this && this.__assign) || function () {
|
|
1872
1919
|
__assign = Object.assign || function(t) {
|
|
@@ -1940,7 +1987,7 @@ module.exports = {
|
|
|
1940
1987
|
LocalDataTrack: LocalDataTrack,
|
|
1941
1988
|
};
|
|
1942
1989
|
|
|
1943
|
-
},{"../package.json":174,"./connect":2,"./createlocaltrack":3,"./createlocaltracks":4,"./media/track/es5":
|
|
1990
|
+
},{"../package.json":174,"./connect":2,"./createlocaltrack":3,"./createlocaltracks":4,"./media/track/es5":15,"./preflight/preflighttest":51,"./util/support":145,"./vendor/loglevel":152}],13:[function(require,module,exports){
|
|
1944
1991
|
'use strict';
|
|
1945
1992
|
var __extends = (this && this.__extends) || (function () {
|
|
1946
1993
|
var extendStatics = function (d, b) {
|
|
@@ -2652,7 +2699,7 @@ function getTrackPublication(trackPublications, track) {
|
|
|
2652
2699
|
}
|
|
2653
2700
|
module.exports = LocalParticipant;
|
|
2654
2701
|
|
|
2655
|
-
},{"./media/track/es5":
|
|
2702
|
+
},{"./media/track/es5":15,"./media/track/localaudiotrackpublication":21,"./media/track/localdatatrackpublication":23,"./media/track/localvideotrackpublication":27,"./participant":46,"./util":132,"./util/constants":125,"./util/validate":150,"./webrtc":158}],14:[function(require,module,exports){
|
|
2656
2703
|
'use strict';
|
|
2657
2704
|
var __extends = (this && this.__extends) || (function () {
|
|
2658
2705
|
var extendStatics = function (d, b) {
|
|
@@ -2807,7 +2854,7 @@ var AudioTrack = /** @class */ (function (_super) {
|
|
|
2807
2854
|
*/
|
|
2808
2855
|
module.exports = AudioTrack;
|
|
2809
2856
|
|
|
2810
|
-
},{"./mediatrack":
|
|
2857
|
+
},{"./mediatrack":28}],15:[function(require,module,exports){
|
|
2811
2858
|
'use strict';
|
|
2812
2859
|
module.exports = {
|
|
2813
2860
|
LocalAudioTrack: require('./localaudiotrack'),
|
|
@@ -2815,7 +2862,7 @@ module.exports = {
|
|
|
2815
2862
|
LocalDataTrack: require('./localdatatrack')
|
|
2816
2863
|
};
|
|
2817
2864
|
|
|
2818
|
-
},{"./localaudiotrack":
|
|
2865
|
+
},{"./localaudiotrack":16,"./localdatatrack":17,"./localvideotrack":18}],16:[function(require,module,exports){
|
|
2819
2866
|
// eslint-disable-next-line no-warning-comments
|
|
2820
2867
|
// TODO(mroberts): Remove this when we go to the next major version. This is
|
|
2821
2868
|
// only in place so that we can support ES6 classes without requiring `new`.
|
|
@@ -2830,7 +2877,7 @@ function LocalAudioTrack(mediaStreamTrack, options) {
|
|
|
2830
2877
|
inherits(LocalAudioTrack, LocalAudioTrackClass);
|
|
2831
2878
|
module.exports = LocalAudioTrack;
|
|
2832
2879
|
|
|
2833
|
-
},{"../../../vendor/inherits":
|
|
2880
|
+
},{"../../../vendor/inherits":151,"../localaudiotrack":20}],17:[function(require,module,exports){
|
|
2834
2881
|
// eslint-disable-next-line no-warning-comments
|
|
2835
2882
|
// TODO(mroberts): Remove this when we go to the next major version. This is
|
|
2836
2883
|
// only in place so that we can support ES6 classes without requiring `new`.
|
|
@@ -2845,7 +2892,7 @@ function LocalDataTrack(options) {
|
|
|
2845
2892
|
inherits(LocalDataTrack, LocalDataTrackClass);
|
|
2846
2893
|
module.exports = LocalDataTrack;
|
|
2847
2894
|
|
|
2848
|
-
},{"../../../vendor/inherits":
|
|
2895
|
+
},{"../../../vendor/inherits":151,"../localdatatrack":22}],18:[function(require,module,exports){
|
|
2849
2896
|
// eslint-disable-next-line no-warning-comments
|
|
2850
2897
|
// TODO(mroberts): Remove this when we go to the next major version. This is
|
|
2851
2898
|
// only in place so that we can support ES6 classes without requiring `new`.
|
|
@@ -2860,7 +2907,7 @@ function LocalVideoTrack(mediaStreamTrack, options) {
|
|
|
2860
2907
|
inherits(LocalVideoTrack, LocalVideoTrackClass);
|
|
2861
2908
|
module.exports = LocalVideoTrack;
|
|
2862
2909
|
|
|
2863
|
-
},{"../../../vendor/inherits":
|
|
2910
|
+
},{"../../../vendor/inherits":151,"../localvideotrack":26}],19:[function(require,module,exports){
|
|
2864
2911
|
'use strict';
|
|
2865
2912
|
var __extends = (this && this.__extends) || (function () {
|
|
2866
2913
|
var extendStatics = function (d, b) {
|
|
@@ -2972,7 +3019,7 @@ var Track = /** @class */ (function (_super) {
|
|
|
2972
3019
|
*/
|
|
2973
3020
|
module.exports = Track;
|
|
2974
3021
|
|
|
2975
|
-
},{"../../eventemitter":10,"../../util":
|
|
3022
|
+
},{"../../eventemitter":10,"../../util":132,"../../util/constants":125,"../../util/log":136}],20:[function(require,module,exports){
|
|
2976
3023
|
'use strict';
|
|
2977
3024
|
var __extends = (this && this.__extends) || (function () {
|
|
2978
3025
|
var extendStatics = function (d, b) {
|
|
@@ -3001,6 +3048,10 @@ var LocalMediaAudioTrack = mixinLocalMediaTrack(AudioTrack);
|
|
|
3001
3048
|
* {@link LocalAudioTrack#stop}.
|
|
3002
3049
|
* @extends AudioTrack
|
|
3003
3050
|
* @property {Track.ID} id - The {@link LocalAudioTrack}'s ID
|
|
3051
|
+
* @property {boolean} isMuted - Whether or not the audio source has stopped sending samples to the
|
|
3052
|
+
* {@link LocalAudioTrack}; This can happen when the microphone is taken over by another application,
|
|
3053
|
+
* mainly on mobile devices; When this property toggles, then <code>muted</code> and <code>unmuted</code>
|
|
3054
|
+
* events are fired appropriately
|
|
3004
3055
|
* @property {boolean} isStopped - Whether or not the {@link LocalAudioTrack} is
|
|
3005
3056
|
* stopped
|
|
3006
3057
|
* @property {NoiseCancellation?} noiseCancellation - When a LocalAudioTrack is created
|
|
@@ -3008,8 +3059,10 @@ var LocalMediaAudioTrack = mixinLocalMediaTrack(AudioTrack);
|
|
|
3008
3059
|
* to enable or disable the noise cancellation at runtime.
|
|
3009
3060
|
* @emits LocalAudioTrack#disabled
|
|
3010
3061
|
* @emits LocalAudioTrack#enabled
|
|
3062
|
+
* @emits LocalAudioTrack#muted
|
|
3011
3063
|
* @emits LocalAudioTrack#started
|
|
3012
3064
|
* @emits LocalAudioTrack#stopped
|
|
3065
|
+
* @emits LocalAudioTrack#unmuted
|
|
3013
3066
|
*/
|
|
3014
3067
|
var LocalAudioTrack = /** @class */ (function (_super) {
|
|
3015
3068
|
__extends(LocalAudioTrack, _super);
|
|
@@ -3167,7 +3220,7 @@ var LocalAudioTrack = /** @class */ (function (_super) {
|
|
|
3167
3220
|
});
|
|
3168
3221
|
};
|
|
3169
3222
|
/**
|
|
3170
|
-
* Disable the {@link LocalAudioTrack}. This is
|
|
3223
|
+
* Disable the {@link LocalAudioTrack}. This is equivalent to muting the audio source.
|
|
3171
3224
|
* @returns {this}
|
|
3172
3225
|
* @fires LocalAudioTrack#disabled
|
|
3173
3226
|
*/
|
|
@@ -3175,13 +3228,13 @@ var LocalAudioTrack = /** @class */ (function (_super) {
|
|
|
3175
3228
|
return _super.prototype.disable.apply(this, arguments);
|
|
3176
3229
|
};
|
|
3177
3230
|
/**
|
|
3178
|
-
* Enable the {@link LocalAudioTrack}. This is
|
|
3231
|
+
* Enable the {@link LocalAudioTrack}. This is equivalent to unmuting the audio source.
|
|
3179
3232
|
* @returns {this}
|
|
3180
3233
|
* @fires LocalAudioTrack#enabled
|
|
3181
3234
|
*/ /**
|
|
3182
|
-
* Enable or disable the {@link LocalAudioTrack}. This is
|
|
3183
|
-
*
|
|
3184
|
-
* @param {boolean} [enabled] - Specify false to
|
|
3235
|
+
* Enable or disable the {@link LocalAudioTrack}. This is equivalent to unmuting or muting
|
|
3236
|
+
* the audio source respectively.
|
|
3237
|
+
* @param {boolean} [enabled] - Specify false to disable the
|
|
3185
3238
|
* {@link LocalAudioTrack}
|
|
3186
3239
|
* @returns {this}
|
|
3187
3240
|
* @fires LocalAudioTrack#disabled
|
|
@@ -3245,16 +3298,22 @@ var LocalAudioTrack = /** @class */ (function (_super) {
|
|
|
3245
3298
|
return LocalAudioTrack;
|
|
3246
3299
|
}(LocalMediaAudioTrack));
|
|
3247
3300
|
/**
|
|
3248
|
-
* The {@link LocalAudioTrack} was disabled, i.e.
|
|
3301
|
+
* The {@link LocalAudioTrack} was disabled, i.e. the audio source was muted by the user.
|
|
3249
3302
|
* @param {LocalAudioTrack} track - The {@link LocalAudioTrack} that was
|
|
3250
3303
|
* disabled
|
|
3251
3304
|
* @event LocalAudioTrack#disabled
|
|
3252
3305
|
*/
|
|
3253
3306
|
/**
|
|
3254
|
-
* The {@link LocalAudioTrack} was enabled, i.e.
|
|
3307
|
+
* The {@link LocalAudioTrack} was enabled, i.e. the audio source was unmuted by the user.
|
|
3255
3308
|
* @param {LocalAudioTrack} track - The {@link LocalAudioTrack} that was enabled
|
|
3256
3309
|
* @event LocalAudioTrack#enabled
|
|
3257
3310
|
*/
|
|
3311
|
+
/**
|
|
3312
|
+
* The {@link LocalAudioTrack} was muted because the audio source stopped sending samples, most
|
|
3313
|
+
* likely due to another application taking said audio source, especially on mobile devices.
|
|
3314
|
+
* @param {LocalAudioTrack} track - The {@link LocalAudioTrack} that was muted
|
|
3315
|
+
* @event LocalAudioTrack#muted
|
|
3316
|
+
*/
|
|
3258
3317
|
/**
|
|
3259
3318
|
* The {@link LocalAudioTrack} started. This means there is enough audio data to
|
|
3260
3319
|
* begin playback.
|
|
@@ -3268,9 +3327,18 @@ var LocalAudioTrack = /** @class */ (function (_super) {
|
|
|
3268
3327
|
* @param {LocalAudioTrack} track - The {@link LocalAudioTrack} that stopped
|
|
3269
3328
|
* @event LocalAudioTrack#stopped
|
|
3270
3329
|
*/
|
|
3330
|
+
/**
|
|
3331
|
+
* The {@link LocalAudioTrack} was unmuted because the audio source resumed sending samples,
|
|
3332
|
+
* most likely due to the application that took over the said audio source has released it
|
|
3333
|
+
* back to the application, especially on mobile devices. This event is also fired when
|
|
3334
|
+
* {@link LocalAudioTrack#restart} is called on a muted {@link LocalAudioTrack} with a
|
|
3335
|
+
* new audio source.
|
|
3336
|
+
* @param {LocalAudioTrack} track - The {@link LocalAudioTrack} that was unmuted
|
|
3337
|
+
* @event LocalAudioTrack#unmuted
|
|
3338
|
+
*/
|
|
3271
3339
|
module.exports = LocalAudioTrack;
|
|
3272
3340
|
|
|
3273
|
-
},{"../../util/browserdetection":
|
|
3341
|
+
},{"../../util/browserdetection":123,"./audiotrack":14,"./localmediatrack":24}],21:[function(require,module,exports){
|
|
3274
3342
|
'use strict';
|
|
3275
3343
|
var __extends = (this && this.__extends) || (function () {
|
|
3276
3344
|
var extendStatics = function (d, b) {
|
|
@@ -3316,7 +3384,7 @@ var LocalAudioTrackPublication = /** @class */ (function (_super) {
|
|
|
3316
3384
|
}(LocalTrackPublication));
|
|
3317
3385
|
module.exports = LocalAudioTrackPublication;
|
|
3318
3386
|
|
|
3319
|
-
},{"./localtrackpublication":
|
|
3387
|
+
},{"./localtrackpublication":25}],22:[function(require,module,exports){
|
|
3320
3388
|
'use strict';
|
|
3321
3389
|
var __extends = (this && this.__extends) || (function () {
|
|
3322
3390
|
var extendStatics = function (d, b) {
|
|
@@ -3454,7 +3522,7 @@ var LocalDataTrack = /** @class */ (function (_super) {
|
|
|
3454
3522
|
*/
|
|
3455
3523
|
module.exports = LocalDataTrack;
|
|
3456
3524
|
|
|
3457
|
-
},{"../../data/sender":6,"./":
|
|
3525
|
+
},{"../../data/sender":6,"./":19}],23:[function(require,module,exports){
|
|
3458
3526
|
'use strict';
|
|
3459
3527
|
var __extends = (this && this.__extends) || (function () {
|
|
3460
3528
|
var extendStatics = function (d, b) {
|
|
@@ -3500,7 +3568,7 @@ var LocalDataTrackPublication = /** @class */ (function (_super) {
|
|
|
3500
3568
|
}(LocalTrackPublication));
|
|
3501
3569
|
module.exports = LocalDataTrackPublication;
|
|
3502
3570
|
|
|
3503
|
-
},{"./localtrackpublication":
|
|
3571
|
+
},{"./localtrackpublication":25}],24:[function(require,module,exports){
|
|
3504
3572
|
/* eslint new-cap:0 */
|
|
3505
3573
|
'use strict';
|
|
3506
3574
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -3535,7 +3603,9 @@ function mixinLocalMediaTrack(AudioOrVideoTrack) {
|
|
|
3535
3603
|
* enabled and disabled with {@link LocalMediaTrack#enable} and
|
|
3536
3604
|
* {@link LocalMediaTrack#disable} or stopped completely with
|
|
3537
3605
|
* {@link LocalMediaTrack#stop}.
|
|
3606
|
+
* @emits LocalMediaTrack#muted
|
|
3538
3607
|
* @emits LocalMediaTrack#stopped
|
|
3608
|
+
* @emits LocalMediaTrack#unmuted
|
|
3539
3609
|
*/
|
|
3540
3610
|
return /** @class */ (function (_super) {
|
|
3541
3611
|
__extends(LocalMediaTrack, _super);
|
|
@@ -3573,6 +3643,12 @@ function mixinLocalMediaTrack(AudioOrVideoTrack) {
|
|
|
3573
3643
|
_gUMSilentTrackWorkaround: {
|
|
3574
3644
|
value: options.gUMSilentTrackWorkaround
|
|
3575
3645
|
},
|
|
3646
|
+
_eventsToReemitters: {
|
|
3647
|
+
value: new Map([
|
|
3648
|
+
['muted', function () { return _this.emit('muted', _this); }],
|
|
3649
|
+
['unmuted', function () { return _this.emit('unmuted', _this); }]
|
|
3650
|
+
])
|
|
3651
|
+
},
|
|
3576
3652
|
_workaroundWebKitBug1208516: {
|
|
3577
3653
|
value: options.workaroundWebKitBug1208516
|
|
3578
3654
|
},
|
|
@@ -3600,6 +3676,12 @@ function mixinLocalMediaTrack(AudioOrVideoTrack) {
|
|
|
3600
3676
|
return mediaTrackSender.enabled;
|
|
3601
3677
|
}
|
|
3602
3678
|
},
|
|
3679
|
+
isMuted: {
|
|
3680
|
+
enumerable: true,
|
|
3681
|
+
get: function () {
|
|
3682
|
+
return mediaTrackSender.muted;
|
|
3683
|
+
}
|
|
3684
|
+
},
|
|
3603
3685
|
isStopped: {
|
|
3604
3686
|
enumerable: true,
|
|
3605
3687
|
get: function () {
|
|
@@ -3612,17 +3694,20 @@ function mixinLocalMediaTrack(AudioOrVideoTrack) {
|
|
|
3612
3694
|
if (_this._workaroundWebKitBug1208516) {
|
|
3613
3695
|
_this._workaroundWebKitBug1208516Cleanup = restartWhenInadvertentlyStopped(_this);
|
|
3614
3696
|
}
|
|
3697
|
+
_this._reemitTrackSenderEvents();
|
|
3615
3698
|
return _this;
|
|
3616
3699
|
}
|
|
3617
3700
|
/**
|
|
3618
3701
|
* @private
|
|
3619
3702
|
*/
|
|
3620
3703
|
LocalMediaTrack.prototype._end = function () {
|
|
3704
|
+
var _this = this;
|
|
3621
3705
|
if (this._didCallEnd) {
|
|
3622
3706
|
return;
|
|
3623
3707
|
}
|
|
3624
3708
|
_super.prototype._end.call(this);
|
|
3625
3709
|
this._didCallEnd = true;
|
|
3710
|
+
this._eventsToReemitters.forEach(function (reemitter, event) { return _this._trackSender.removeListener(event, reemitter); });
|
|
3626
3711
|
this.emit('stopped', this);
|
|
3627
3712
|
};
|
|
3628
3713
|
/**
|
|
@@ -3632,6 +3717,9 @@ function mixinLocalMediaTrack(AudioOrVideoTrack) {
|
|
|
3632
3717
|
if (this._didCallEnd) {
|
|
3633
3718
|
this._didCallEnd = false;
|
|
3634
3719
|
}
|
|
3720
|
+
if (this._eventsToReemitters) {
|
|
3721
|
+
this._reemitTrackSenderEvents();
|
|
3722
|
+
}
|
|
3635
3723
|
_super.prototype._initialize.call(this);
|
|
3636
3724
|
};
|
|
3637
3725
|
/**
|
|
@@ -3653,6 +3741,15 @@ function mixinLocalMediaTrack(AudioOrVideoTrack) {
|
|
|
3653
3741
|
return mediaStream.getTracks()[0];
|
|
3654
3742
|
});
|
|
3655
3743
|
};
|
|
3744
|
+
/**
|
|
3745
|
+
* @private
|
|
3746
|
+
*/
|
|
3747
|
+
LocalMediaTrack.prototype._reemitTrackSenderEvents = function () {
|
|
3748
|
+
var _this = this;
|
|
3749
|
+
this._eventsToReemitters.forEach(function (reemitter, event) { return _this._trackSender.on(event, reemitter); });
|
|
3750
|
+
this._trackSender.dequeue('muted');
|
|
3751
|
+
this._trackSender.dequeue('unmuted');
|
|
3752
|
+
};
|
|
3656
3753
|
/**
|
|
3657
3754
|
* @private
|
|
3658
3755
|
*/
|
|
@@ -3855,7 +3952,7 @@ function restartWhenInadvertentlyStopped(localMediaTrack) {
|
|
|
3855
3952
|
}
|
|
3856
3953
|
module.exports = mixinLocalMediaTrack;
|
|
3857
3954
|
|
|
3858
|
-
},{"../../util":
|
|
3955
|
+
},{"../../util":132,"../../util/browserdetection":123,"../../util/constants":125,"../../util/detectsilentaudio":126,"../../util/detectsilentvideo":127,"../../util/documentvisibilitymonitor.js":128,"../../util/localmediarestartdeferreds":135,"../../webaudio/workaround180748":155,"../../webrtc":158,"./sender":39}],25:[function(require,module,exports){
|
|
3859
3956
|
/* eslint new-cap:0 */
|
|
3860
3957
|
'use strict';
|
|
3861
3958
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -4021,7 +4118,7 @@ var LocalTrackPublication = /** @class */ (function (_super) {
|
|
|
4021
4118
|
*/
|
|
4022
4119
|
module.exports = LocalTrackPublication;
|
|
4023
4120
|
|
|
4024
|
-
},{"../../util/constants":
|
|
4121
|
+
},{"../../util/constants":125,"./trackpublication":40}],26:[function(require,module,exports){
|
|
4025
4122
|
'use strict';
|
|
4026
4123
|
var __extends = (this && this.__extends) || (function () {
|
|
4027
4124
|
var extendStatics = function (d, b) {
|
|
@@ -4052,12 +4149,18 @@ var LocalMediaVideoTrack = mixinLocalMediaTrack(VideoTrack);
|
|
|
4052
4149
|
* {@link LocalVideoTrack#stop}.
|
|
4053
4150
|
* @extends VideoTrack
|
|
4054
4151
|
* @property {Track.ID} id - The {@link LocalVideoTrack}'s ID
|
|
4152
|
+
* @property {boolean} isMuted - Whether or not the video source has stopped sending frames to the
|
|
4153
|
+
* {@link LocalVideoTrack}; This can happen when the camera is taken over by another application,
|
|
4154
|
+
* mainly on mobile devices; When this property toggles, then <code>muted</code> and <code>unmuted</code>
|
|
4155
|
+
* events are fired appropriately
|
|
4055
4156
|
* @property {boolean} isStopped - Whether or not the {@link LocalVideoTrack} is
|
|
4056
4157
|
* stopped
|
|
4057
4158
|
* @emits LocalVideoTrack#disabled
|
|
4058
4159
|
* @emits LocalVideoTrack#enabled
|
|
4160
|
+
* @emits LocalVideoTrack#muted
|
|
4059
4161
|
* @emits LocalVideoTrack#started
|
|
4060
4162
|
* @emits LocalVideoTrack#stopped
|
|
4163
|
+
* @emits LocalVideoTrack#unmuted
|
|
4061
4164
|
*/
|
|
4062
4165
|
var LocalVideoTrack = /** @class */ (function (_super) {
|
|
4063
4166
|
__extends(LocalVideoTrack, _super);
|
|
@@ -4184,8 +4287,8 @@ var LocalVideoTrack = /** @class */ (function (_super) {
|
|
|
4184
4287
|
return result;
|
|
4185
4288
|
};
|
|
4186
4289
|
/**
|
|
4187
|
-
* Disable the {@link LocalVideoTrack}. This is
|
|
4188
|
-
* If a {@link VideoProcessor} is added, then
|
|
4290
|
+
* Disable the {@link LocalVideoTrack}. This is equivalent to pausing a video source.
|
|
4291
|
+
* If a {@link VideoProcessor} is added, then <code>processedTrack</code> is also disabled.
|
|
4189
4292
|
* @returns {this}
|
|
4190
4293
|
* @fires VideoTrack#disabled
|
|
4191
4294
|
*/
|
|
@@ -4197,15 +4300,15 @@ var LocalVideoTrack = /** @class */ (function (_super) {
|
|
|
4197
4300
|
return result;
|
|
4198
4301
|
};
|
|
4199
4302
|
/**
|
|
4200
|
-
* Enable the {@link LocalVideoTrack}. This is
|
|
4201
|
-
* If a {@link VideoProcessor} is added, then
|
|
4303
|
+
* Enable the {@link LocalVideoTrack}. This is equivalent to unpausing the video source.
|
|
4304
|
+
* If a {@link VideoProcessor} is added, then <code>processedTrack</code> is also enabled.
|
|
4202
4305
|
* @returns {this}
|
|
4203
4306
|
* @fires VideoTrack#enabled
|
|
4204
4307
|
*/ /**
|
|
4205
|
-
* Enable or disable the {@link LocalVideoTrack}. This is
|
|
4206
|
-
*
|
|
4207
|
-
*
|
|
4208
|
-
* @param {boolean} [enabled] - Specify false to
|
|
4308
|
+
* Enable or disable the {@link LocalVideoTrack}. This is equivalent to unpausing or pausing
|
|
4309
|
+
* the video source respectively. If a {@link VideoProcessor} is added, then <code>processedTrack</code>
|
|
4310
|
+
* is also enabled or disabled.
|
|
4311
|
+
* @param {boolean} [enabled] - Specify false to disable the
|
|
4209
4312
|
* {@link LocalVideoTrack}
|
|
4210
4313
|
* @returns {this}
|
|
4211
4314
|
* @fires VideoTrack#disabled
|
|
@@ -4343,16 +4446,22 @@ function workaroundSilentLocalVideo(localVideoTrack, doc) {
|
|
|
4343
4446
|
};
|
|
4344
4447
|
}
|
|
4345
4448
|
/**
|
|
4346
|
-
* The {@link LocalVideoTrack} was disabled, i.e.
|
|
4449
|
+
* The {@link LocalVideoTrack} was disabled, i.e. the video source was paused by the user.
|
|
4347
4450
|
* @param {LocalVideoTrack} track - The {@link LocalVideoTrack} that was
|
|
4348
4451
|
* disabled
|
|
4349
4452
|
* @event LocalVideoTrack#disabled
|
|
4350
4453
|
*/
|
|
4351
4454
|
/**
|
|
4352
|
-
* The {@link LocalVideoTrack} was enabled, i.e.
|
|
4455
|
+
* The {@link LocalVideoTrack} was enabled, i.e. the video source was unpaused by the user.
|
|
4353
4456
|
* @param {LocalVideoTrack} track - The {@link LocalVideoTrack} that was enabled
|
|
4354
4457
|
* @event LocalVideoTrack#enabled
|
|
4355
4458
|
*/
|
|
4459
|
+
/**
|
|
4460
|
+
* The {@link LocalVideoTrack} was muted because the video source stopped sending frames, most
|
|
4461
|
+
* likely due to another application taking said video source, especially on mobile devices.
|
|
4462
|
+
* @param {LocalVideoTrack} track - The {@link LocalVideoTrack} that was muted
|
|
4463
|
+
* @event LocalVideoTrack#muted
|
|
4464
|
+
*/
|
|
4356
4465
|
/**
|
|
4357
4466
|
* The {@link LocalVideoTrack} started. This means there is enough video data
|
|
4358
4467
|
* to begin playback.
|
|
@@ -4366,9 +4475,18 @@ function workaroundSilentLocalVideo(localVideoTrack, doc) {
|
|
|
4366
4475
|
* @param {LocalVideoTrack} track - The {@link LocalVideoTrack} that stopped
|
|
4367
4476
|
* @event LocalVideoTrack#stopped
|
|
4368
4477
|
*/
|
|
4478
|
+
/**
|
|
4479
|
+
* The {@link LocalVideoTrack} was unmuted because the video source resumed sending frames,
|
|
4480
|
+
* most likely due to the application that took over the said video source has released it
|
|
4481
|
+
* back to the application, especially on mobile devices. This event is also fired when
|
|
4482
|
+
* {@link LocalVideoTrack#restart} is called on a muted {@link LocalVideoTrack} with a
|
|
4483
|
+
* new video source.
|
|
4484
|
+
* @param {LocalVideoTrack} track - The {@link LocalVideoTrack} that was unmuted
|
|
4485
|
+
* @event LocalVideoTrack#unmuted
|
|
4486
|
+
*/
|
|
4369
4487
|
module.exports = LocalVideoTrack;
|
|
4370
4488
|
|
|
4371
|
-
},{"../../util":
|
|
4489
|
+
},{"../../util":132,"../../util/browserdetection":123,"../../util/detectsilentvideo":127,"./localmediatrack":24,"./videotrack":43}],27:[function(require,module,exports){
|
|
4372
4490
|
'use strict';
|
|
4373
4491
|
var __extends = (this && this.__extends) || (function () {
|
|
4374
4492
|
var extendStatics = function (d, b) {
|
|
@@ -4414,7 +4532,7 @@ var LocalVideoTrackPublication = /** @class */ (function (_super) {
|
|
|
4414
4532
|
}(LocalTrackPublication));
|
|
4415
4533
|
module.exports = LocalVideoTrackPublication;
|
|
4416
4534
|
|
|
4417
|
-
},{"./localtrackpublication":
|
|
4535
|
+
},{"./localtrackpublication":25}],28:[function(require,module,exports){
|
|
4418
4536
|
'use strict';
|
|
4419
4537
|
var __extends = (this && this.__extends) || (function () {
|
|
4420
4538
|
var extendStatics = function (d, b) {
|
|
@@ -4778,7 +4896,7 @@ function shimMediaElement(el, onUnintentionallyPaused) {
|
|
|
4778
4896
|
}
|
|
4779
4897
|
module.exports = MediaTrack;
|
|
4780
4898
|
|
|
4781
|
-
},{"../../util":
|
|
4899
|
+
},{"../../util":132,"../../util/browserdetection":123,"../../util/localmediarestartdeferreds":135,"../../webrtc":158,"./":19}],29:[function(require,module,exports){
|
|
4782
4900
|
'use strict';
|
|
4783
4901
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4784
4902
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -5007,7 +5125,7 @@ function applyNoiseCancellation(mediaStreamTrack, noiseCancellationOptions, log)
|
|
|
5007
5125
|
}
|
|
5008
5126
|
exports.applyNoiseCancellation = applyNoiseCancellation;
|
|
5009
5127
|
|
|
5010
|
-
},{"../../noisecancellationadapter":
|
|
5128
|
+
},{"../../noisecancellationadapter":45,"../../util/log":136}],30:[function(require,module,exports){
|
|
5011
5129
|
'use strict';
|
|
5012
5130
|
var __extends = (this && this.__extends) || (function () {
|
|
5013
5131
|
var extendStatics = function (d, b) {
|
|
@@ -5043,7 +5161,7 @@ var MediaTrackReceiver = /** @class */ (function (_super) {
|
|
|
5043
5161
|
}(MediaTrackTransceiver));
|
|
5044
5162
|
module.exports = MediaTrackReceiver;
|
|
5045
5163
|
|
|
5046
|
-
},{"./transceiver":
|
|
5164
|
+
},{"./transceiver":41}],31:[function(require,module,exports){
|
|
5047
5165
|
'use strict';
|
|
5048
5166
|
var __extends = (this && this.__extends) || (function () {
|
|
5049
5167
|
var extendStatics = function (d, b) {
|
|
@@ -5152,7 +5270,7 @@ var RemoteAudioTrack = /** @class */ (function (_super) {
|
|
|
5152
5270
|
*/
|
|
5153
5271
|
module.exports = RemoteAudioTrack;
|
|
5154
5272
|
|
|
5155
|
-
},{"./audiotrack":
|
|
5273
|
+
},{"./audiotrack":14,"./remotemediatrack":35}],32:[function(require,module,exports){
|
|
5156
5274
|
'use strict';
|
|
5157
5275
|
var __extends = (this && this.__extends) || (function () {
|
|
5158
5276
|
var extendStatics = function (d, b) {
|
|
@@ -5224,7 +5342,7 @@ var RemoteAudioTrackPublication = /** @class */ (function (_super) {
|
|
|
5224
5342
|
*/
|
|
5225
5343
|
module.exports = RemoteAudioTrackPublication;
|
|
5226
5344
|
|
|
5227
|
-
},{"./remotetrackpublication":
|
|
5345
|
+
},{"./remotetrackpublication":36}],33:[function(require,module,exports){
|
|
5228
5346
|
'use strict';
|
|
5229
5347
|
var __extends = (this && this.__extends) || (function () {
|
|
5230
5348
|
var extendStatics = function (d, b) {
|
|
@@ -5411,7 +5529,7 @@ var RemoteDataTrack = /** @class */ (function (_super) {
|
|
|
5411
5529
|
*/
|
|
5412
5530
|
module.exports = RemoteDataTrack;
|
|
5413
5531
|
|
|
5414
|
-
},{"../../util/constants":
|
|
5532
|
+
},{"../../util/constants":125,"./":19}],34:[function(require,module,exports){
|
|
5415
5533
|
'use strict';
|
|
5416
5534
|
var __extends = (this && this.__extends) || (function () {
|
|
5417
5535
|
var extendStatics = function (d, b) {
|
|
@@ -5473,7 +5591,7 @@ var RemoteDataTrackPublication = /** @class */ (function (_super) {
|
|
|
5473
5591
|
*/
|
|
5474
5592
|
module.exports = RemoteDataTrackPublication;
|
|
5475
5593
|
|
|
5476
|
-
},{"./remotetrackpublication":
|
|
5594
|
+
},{"./remotetrackpublication":36}],35:[function(require,module,exports){
|
|
5477
5595
|
'use strict';
|
|
5478
5596
|
var __extends = (this && this.__extends) || (function () {
|
|
5479
5597
|
var extendStatics = function (d, b) {
|
|
@@ -5759,7 +5877,7 @@ function playIfPausedWhileInBackground(remoteMediaTrack) {
|
|
|
5759
5877
|
*/
|
|
5760
5878
|
module.exports = mixinRemoteMediaTrack;
|
|
5761
5879
|
|
|
5762
|
-
},{"../../util/browserdetection":
|
|
5880
|
+
},{"../../util/browserdetection":123,"../../util/constants":125,"../../util/documentvisibilitymonitor.js":128}],36:[function(require,module,exports){
|
|
5763
5881
|
'use strict';
|
|
5764
5882
|
var __extends = (this && this.__extends) || (function () {
|
|
5765
5883
|
var extendStatics = function (d, b) {
|
|
@@ -5954,7 +6072,7 @@ var RemoteTrackPublication = /** @class */ (function (_super) {
|
|
|
5954
6072
|
*/
|
|
5955
6073
|
module.exports = RemoteTrackPublication;
|
|
5956
6074
|
|
|
5957
|
-
},{"./trackpublication":
|
|
6075
|
+
},{"./trackpublication":40}],37:[function(require,module,exports){
|
|
5958
6076
|
'use strict';
|
|
5959
6077
|
var __extends = (this && this.__extends) || (function () {
|
|
5960
6078
|
var extendStatics = function (d, b) {
|
|
@@ -6388,7 +6506,7 @@ function maybeUpdateDimensionHint(remoteVideoTrack) {
|
|
|
6388
6506
|
*/
|
|
6389
6507
|
module.exports = RemoteVideoTrack;
|
|
6390
6508
|
|
|
6391
|
-
},{"../../util/documentvisibilitymonitor.js":
|
|
6509
|
+
},{"../../util/documentvisibilitymonitor.js":128,"../../util/nullobserver.js":139,"../../util/timeout":146,"./remotemediatrack":35,"./videotrack":43}],38:[function(require,module,exports){
|
|
6392
6510
|
'use strict';
|
|
6393
6511
|
var __extends = (this && this.__extends) || (function () {
|
|
6394
6512
|
var extendStatics = function (d, b) {
|
|
@@ -6460,7 +6578,7 @@ var RemoteVideoTrackPublication = /** @class */ (function (_super) {
|
|
|
6460
6578
|
*/
|
|
6461
6579
|
module.exports = RemoteVideoTrackPublication;
|
|
6462
6580
|
|
|
6463
|
-
},{"./remotetrackpublication":
|
|
6581
|
+
},{"./remotetrackpublication":36}],39:[function(require,module,exports){
|
|
6464
6582
|
'use strict';
|
|
6465
6583
|
var __extends = (this && this.__extends) || (function () {
|
|
6466
6584
|
var extendStatics = function (d, b) {
|
|
@@ -6511,6 +6629,12 @@ var MediaTrackSender = /** @class */ (function (_super) {
|
|
|
6511
6629
|
_clones: {
|
|
6512
6630
|
value: new Set()
|
|
6513
6631
|
},
|
|
6632
|
+
_eventsToReemitters: {
|
|
6633
|
+
value: new Map([
|
|
6634
|
+
['mute', function () { return _this.queue('muted'); }],
|
|
6635
|
+
['unmute', function () { return _this.queue('unmuted'); }]
|
|
6636
|
+
])
|
|
6637
|
+
},
|
|
6514
6638
|
_senders: {
|
|
6515
6639
|
value: new Set()
|
|
6516
6640
|
},
|
|
@@ -6518,13 +6642,36 @@ var MediaTrackSender = /** @class */ (function (_super) {
|
|
|
6518
6642
|
value: new Map()
|
|
6519
6643
|
},
|
|
6520
6644
|
isPublishing: {
|
|
6645
|
+
enumerable: true,
|
|
6521
6646
|
get: function () {
|
|
6522
6647
|
return !!this._clones.size;
|
|
6523
6648
|
}
|
|
6649
|
+
},
|
|
6650
|
+
muted: {
|
|
6651
|
+
enumerable: true,
|
|
6652
|
+
get: function () {
|
|
6653
|
+
return this._track.muted;
|
|
6654
|
+
}
|
|
6524
6655
|
}
|
|
6525
6656
|
});
|
|
6657
|
+
_this._reemitMediaStreamTrackEvents();
|
|
6526
6658
|
return _this;
|
|
6527
6659
|
}
|
|
6660
|
+
/**
|
|
6661
|
+
* @private
|
|
6662
|
+
*/
|
|
6663
|
+
MediaTrackSender.prototype._reemitMediaStreamTrackEvents = function (mediaStreamTrack) {
|
|
6664
|
+
if (mediaStreamTrack === void 0) { mediaStreamTrack = this._track; }
|
|
6665
|
+
var _a = this, eventsToReemitters = _a._eventsToReemitters, track = _a._track;
|
|
6666
|
+
eventsToReemitters.forEach(function (reemitter, event) { return mediaStreamTrack.addEventListener(event, reemitter); });
|
|
6667
|
+
if (track !== mediaStreamTrack) {
|
|
6668
|
+
eventsToReemitters.forEach(function (reemitter, event) { return track.removeEventListener(event, reemitter); });
|
|
6669
|
+
if (track.muted !== mediaStreamTrack.muted) {
|
|
6670
|
+
var reemitter = eventsToReemitters.get(mediaStreamTrack.muted ? 'mute' : 'unmute');
|
|
6671
|
+
reemitter();
|
|
6672
|
+
}
|
|
6673
|
+
}
|
|
6674
|
+
};
|
|
6528
6675
|
/**
|
|
6529
6676
|
* Return a new {@link MediaTrackSender} containing a clone of the underlying
|
|
6530
6677
|
* MediaStreamTrack. No RTCRtpSenders are copied.
|
|
@@ -6556,6 +6703,7 @@ var MediaTrackSender = /** @class */ (function (_super) {
|
|
|
6556
6703
|
}).concat(senders.map(function (sender) {
|
|
6557
6704
|
return _this._replaceTrack(sender, mediaStreamTrack);
|
|
6558
6705
|
}))).finally(function () {
|
|
6706
|
+
_this._reemitMediaStreamTrackEvents(mediaStreamTrack);
|
|
6559
6707
|
_this._track = mediaStreamTrack;
|
|
6560
6708
|
});
|
|
6561
6709
|
};
|
|
@@ -6604,12 +6752,20 @@ var MediaTrackSender = /** @class */ (function (_super) {
|
|
|
6604
6752
|
return MediaTrackSender;
|
|
6605
6753
|
}(MediaTrackTransceiver));
|
|
6606
6754
|
/**
|
|
6607
|
-
* The {@link MediaTrackSender}
|
|
6755
|
+
* The {@link MediaTrackSender}'s underlying MediaStreamTrack was muted.
|
|
6756
|
+
* @event MediaTrackSender#muted
|
|
6757
|
+
*/
|
|
6758
|
+
/**
|
|
6759
|
+
* The {@link MediaTrackSender} replaced the underlying MediaStreamTrack.
|
|
6608
6760
|
* @event MediaTrackSender#replaced
|
|
6609
6761
|
*/
|
|
6762
|
+
/**
|
|
6763
|
+
* The {@link MediaTrackSender}'s underlying MediaStreamTrack was unmuted.
|
|
6764
|
+
* @event MediaTrackSender#unmuted
|
|
6765
|
+
*/
|
|
6610
6766
|
module.exports = MediaTrackSender;
|
|
6611
6767
|
|
|
6612
|
-
},{"./transceiver":
|
|
6768
|
+
},{"./transceiver":41}],40:[function(require,module,exports){
|
|
6613
6769
|
'use strict';
|
|
6614
6770
|
var __extends = (this && this.__extends) || (function () {
|
|
6615
6771
|
var extendStatics = function (d, b) {
|
|
@@ -6706,7 +6862,7 @@ var TrackPublication = /** @class */ (function (_super) {
|
|
|
6706
6862
|
*/
|
|
6707
6863
|
module.exports = TrackPublication;
|
|
6708
6864
|
|
|
6709
|
-
},{"../../eventemitter":10,"../../util":
|
|
6865
|
+
},{"../../eventemitter":10,"../../util":132,"../../util/constants":125,"../../util/log":136}],41:[function(require,module,exports){
|
|
6710
6866
|
'use strict';
|
|
6711
6867
|
var __extends = (this && this.__extends) || (function () {
|
|
6712
6868
|
var extendStatics = function (d, b) {
|
|
@@ -6773,7 +6929,7 @@ var MediaTrackTransceiver = /** @class */ (function (_super) {
|
|
|
6773
6929
|
}(TrackTransceiver));
|
|
6774
6930
|
module.exports = MediaTrackTransceiver;
|
|
6775
6931
|
|
|
6776
|
-
},{"../../transceiver":
|
|
6932
|
+
},{"../../transceiver":119}],42:[function(require,module,exports){
|
|
6777
6933
|
'use strict';
|
|
6778
6934
|
var __extends = (this && this.__extends) || (function () {
|
|
6779
6935
|
var extendStatics = function (d, b) {
|
|
@@ -6928,7 +7084,7 @@ var VideoProcessorEventObserver = /** @class */ (function (_super) {
|
|
|
6928
7084
|
}(EventEmitter));
|
|
6929
7085
|
module.exports = VideoProcessorEventObserver;
|
|
6930
7086
|
|
|
6931
|
-
},{"../../util/constants":
|
|
7087
|
+
},{"../../util/constants":125,"events":173}],43:[function(require,module,exports){
|
|
6932
7088
|
'use strict';
|
|
6933
7089
|
var __extends = (this && this.__extends) || (function () {
|
|
6934
7090
|
var extendStatics = function (d, b) {
|
|
@@ -7443,7 +7599,7 @@ function dimensionsChanged(track, elem) {
|
|
|
7443
7599
|
*/
|
|
7444
7600
|
module.exports = VideoTrack;
|
|
7445
7601
|
|
|
7446
|
-
},{"../../util/constants":
|
|
7602
|
+
},{"../../util/constants":125,"./mediatrack":28,"./videoprocessoreventobserver":42}],44:[function(require,module,exports){
|
|
7447
7603
|
'use strict';
|
|
7448
7604
|
var __extends = (this && this.__extends) || (function () {
|
|
7449
7605
|
var extendStatics = function (d, b) {
|
|
@@ -7542,7 +7698,7 @@ var NetworkQualityConfigurationImpl = /** @class */ (function (_super) {
|
|
|
7542
7698
|
}(EventEmitter));
|
|
7543
7699
|
module.exports = NetworkQualityConfigurationImpl;
|
|
7544
7700
|
|
|
7545
|
-
},{"./util":
|
|
7701
|
+
},{"./util":132,"./util/constants":125,"events":173}],45:[function(require,module,exports){
|
|
7546
7702
|
'use strict';
|
|
7547
7703
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7548
7704
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -7697,7 +7853,7 @@ function createNoiseCancellationAudioProcessor(noiseCancellationOptions, log) {
|
|
|
7697
7853
|
}
|
|
7698
7854
|
exports.createNoiseCancellationAudioProcessor = createNoiseCancellationAudioProcessor;
|
|
7699
7855
|
|
|
7700
|
-
},{"./util/dynamicimport":
|
|
7856
|
+
},{"./util/dynamicimport":129,"./util/log":136}],46:[function(require,module,exports){
|
|
7701
7857
|
'use strict';
|
|
7702
7858
|
var __extends = (this && this.__extends) || (function () {
|
|
7703
7859
|
var extendStatics = function (d, b) {
|
|
@@ -8314,7 +8470,7 @@ function reemitTrackPublicationEvents(participant, publication) {
|
|
|
8314
8470
|
}
|
|
8315
8471
|
module.exports = Participant;
|
|
8316
8472
|
|
|
8317
|
-
},{"./eventemitter":10,"./media/track/remoteaudiotrack":
|
|
8473
|
+
},{"./eventemitter":10,"./media/track/remoteaudiotrack":31,"./media/track/remoteaudiotrackpublication":32,"./media/track/remotedatatrack":33,"./media/track/remotedatatrackpublication":34,"./media/track/remotevideotrack":37,"./media/track/remotevideotrackpublication":38,"./util":132}],47:[function(require,module,exports){
|
|
8318
8474
|
"use strict";
|
|
8319
8475
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8320
8476
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -8468,7 +8624,7 @@ function extractSelectedActiveCandidatePair(stats) {
|
|
|
8468
8624
|
};
|
|
8469
8625
|
}
|
|
8470
8626
|
|
|
8471
|
-
},{}],
|
|
8627
|
+
},{}],48:[function(require,module,exports){
|
|
8472
8628
|
"use strict";
|
|
8473
8629
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8474
8630
|
exports.getTurnCredentials = void 0;
|
|
@@ -8516,7 +8672,7 @@ function getTurnCredentials(token, wsServer) {
|
|
|
8516
8672
|
}
|
|
8517
8673
|
exports.getTurnCredentials = getTurnCredentials;
|
|
8518
8674
|
|
|
8519
|
-
},{"../twilioconnection.js":
|
|
8675
|
+
},{"../twilioconnection.js":120,"../util/constants":125,"../util/twilio-video-errors":147,"events":173}],49:[function(require,module,exports){
|
|
8520
8676
|
"use strict";
|
|
8521
8677
|
var __read = (this && this.__read) || function (o, n) {
|
|
8522
8678
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -8557,7 +8713,7 @@ function makeStat(values) {
|
|
|
8557
8713
|
}
|
|
8558
8714
|
exports.makeStat = makeStat;
|
|
8559
8715
|
|
|
8560
|
-
},{}],
|
|
8716
|
+
},{}],50:[function(require,module,exports){
|
|
8561
8717
|
"use strict";
|
|
8562
8718
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8563
8719
|
exports.mosToScore = exports.calculateMOS = void 0;
|
|
@@ -8618,7 +8774,7 @@ function mosToScore(mosValue) {
|
|
|
8618
8774
|
}
|
|
8619
8775
|
exports.mosToScore = mosToScore;
|
|
8620
8776
|
|
|
8621
|
-
},{}],
|
|
8777
|
+
},{}],51:[function(require,module,exports){
|
|
8622
8778
|
"use strict";
|
|
8623
8779
|
var __extends = (this && this.__extends) || (function () {
|
|
8624
8780
|
var extendStatics = function (d, b) {
|
|
@@ -9262,7 +9418,7 @@ function runPreflight(token, options) {
|
|
|
9262
9418
|
}
|
|
9263
9419
|
exports.runPreflight = runPreflight;
|
|
9264
9420
|
|
|
9265
|
-
},{"../eventemitter":10,"../util/constants":
|
|
9421
|
+
},{"../eventemitter":10,"../util/constants":125,"../util/eventobserver":130,"../util/index":132,"../util/insightspublisher":133,"../util/log":136,"../util/movingaveragedelta":137,"../util/sid":144,"../util/twilio-video-errors":147,"./getCombinedConnectionStats":47,"./getturncredentials":48,"./makestat":49,"./mos":50,"./syntheticaudio":52,"./syntheticvideo":53,"./timer":54}],52:[function(require,module,exports){
|
|
9266
9422
|
"use strict";
|
|
9267
9423
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9268
9424
|
exports.syntheticAudio = void 0;
|
|
@@ -9285,7 +9441,7 @@ function syntheticAudio() {
|
|
|
9285
9441
|
}
|
|
9286
9442
|
exports.syntheticAudio = syntheticAudio;
|
|
9287
9443
|
|
|
9288
|
-
},{"../webaudio/audiocontext":
|
|
9444
|
+
},{"../webaudio/audiocontext":153}],53:[function(require,module,exports){
|
|
9289
9445
|
"use strict";
|
|
9290
9446
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9291
9447
|
exports.syntheticVideo = void 0;
|
|
@@ -9319,7 +9475,7 @@ function syntheticVideo(_a) {
|
|
|
9319
9475
|
}
|
|
9320
9476
|
exports.syntheticVideo = syntheticVideo;
|
|
9321
9477
|
|
|
9322
|
-
},{}],
|
|
9478
|
+
},{}],54:[function(require,module,exports){
|
|
9323
9479
|
"use strict";
|
|
9324
9480
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9325
9481
|
exports.Timer = void 0;
|
|
@@ -9349,7 +9505,7 @@ var Timer = /** @class */ (function () {
|
|
|
9349
9505
|
}());
|
|
9350
9506
|
exports.Timer = Timer;
|
|
9351
9507
|
|
|
9352
|
-
},{}],
|
|
9508
|
+
},{}],55:[function(require,module,exports){
|
|
9353
9509
|
'use strict';
|
|
9354
9510
|
var __extends = (this && this.__extends) || (function () {
|
|
9355
9511
|
var extendStatics = function (d, b) {
|
|
@@ -9450,7 +9606,7 @@ var QueueingEventEmitter = /** @class */ (function (_super) {
|
|
|
9450
9606
|
}(EventEmitter));
|
|
9451
9607
|
module.exports = QueueingEventEmitter;
|
|
9452
9608
|
|
|
9453
|
-
},{"events":173}],
|
|
9609
|
+
},{"events":173}],56:[function(require,module,exports){
|
|
9454
9610
|
'use strict';
|
|
9455
9611
|
var __extends = (this && this.__extends) || (function () {
|
|
9456
9612
|
var extendStatics = function (d, b) {
|
|
@@ -9731,7 +9887,7 @@ var RemoteParticipant = /** @class */ (function (_super) {
|
|
|
9731
9887
|
*/
|
|
9732
9888
|
module.exports = RemoteParticipant;
|
|
9733
9889
|
|
|
9734
|
-
},{"./participant":
|
|
9890
|
+
},{"./participant":46}],57:[function(require,module,exports){
|
|
9735
9891
|
'use strict';
|
|
9736
9892
|
var __extends = (this && this.__extends) || (function () {
|
|
9737
9893
|
var extendStatics = function (d, b) {
|
|
@@ -9772,7 +9928,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
9772
9928
|
var EventEmitter = require('./eventemitter');
|
|
9773
9929
|
var RemoteParticipant = require('./remoteparticipant');
|
|
9774
9930
|
var StatsReport = require('./stats/statsreport');
|
|
9775
|
-
var
|
|
9931
|
+
var _a = require('./util'), flatMap = _a.flatMap, valueToJSON = _a.valueToJSON;
|
|
9776
9932
|
var nInstances = 0;
|
|
9777
9933
|
/**
|
|
9778
9934
|
* A {@link Room} represents communication between you and one or more
|
|
@@ -9930,6 +10086,55 @@ var Room = /** @class */ (function (_super) {
|
|
|
9930
10086
|
});
|
|
9931
10087
|
});
|
|
9932
10088
|
};
|
|
10089
|
+
/**
|
|
10090
|
+
* Restart the muted local media {@link Track}s and play inadvertently paused HTMLMediaElements
|
|
10091
|
+
* that are attached to local and remote media {@link Track}s. This method is useful mainly on
|
|
10092
|
+
* mobile browsers (Safari and Chrome on iOS), where there is a possibility that the muted local
|
|
10093
|
+
* media {@link Track}s are never unmuted and inadvertently paused HTMLMediaElements are never
|
|
10094
|
+
* played again, especially after handling an incoming phone call.
|
|
10095
|
+
* @returns {this}
|
|
10096
|
+
*/
|
|
10097
|
+
Room.prototype.refreshInactiveMedia = function () {
|
|
10098
|
+
var localTrackPublications = this.localParticipant.tracks;
|
|
10099
|
+
var localMediaTracks = Array.from(localTrackPublications.values())
|
|
10100
|
+
.filter(function (_a) {
|
|
10101
|
+
var kind = _a.track.kind;
|
|
10102
|
+
return kind !== 'data';
|
|
10103
|
+
})
|
|
10104
|
+
.map(function (_a) {
|
|
10105
|
+
var track = _a.track;
|
|
10106
|
+
return track;
|
|
10107
|
+
});
|
|
10108
|
+
var remoteMediaTracks = flatMap(this.participants, function (participants) { return Array.from(participants.tracks.values()); })
|
|
10109
|
+
.filter(function (_a) {
|
|
10110
|
+
var track = _a.track;
|
|
10111
|
+
return track && track.kind !== 'data';
|
|
10112
|
+
})
|
|
10113
|
+
.map(function (_a) {
|
|
10114
|
+
var track = _a.track;
|
|
10115
|
+
return track;
|
|
10116
|
+
});
|
|
10117
|
+
var mediaTracks = localMediaTracks.concat(remoteMediaTracks);
|
|
10118
|
+
var unmuteEvent = new Event('unmute');
|
|
10119
|
+
localMediaTracks.forEach(function (_a) {
|
|
10120
|
+
var isMuted = _a.isMuted, mediaStreamTrack = _a.mediaStreamTrack;
|
|
10121
|
+
if (isMuted) {
|
|
10122
|
+
mediaStreamTrack.dispatchEvent(unmuteEvent);
|
|
10123
|
+
}
|
|
10124
|
+
});
|
|
10125
|
+
var pauseEvent = new Event('pause');
|
|
10126
|
+
mediaTracks.forEach(function (_a) {
|
|
10127
|
+
var attachments = _a._attachments, elShims = _a._elShims;
|
|
10128
|
+
return attachments.forEach(function (el) {
|
|
10129
|
+
var shim = elShims.get(el);
|
|
10130
|
+
var isInadvertentlyPaused = el.paused && shim && !shim.pausedIntentionally();
|
|
10131
|
+
if (isInadvertentlyPaused) {
|
|
10132
|
+
el.dispatchEvent(pauseEvent);
|
|
10133
|
+
}
|
|
10134
|
+
});
|
|
10135
|
+
});
|
|
10136
|
+
return this;
|
|
10137
|
+
};
|
|
9933
10138
|
Room.prototype.toJSON = function () {
|
|
9934
10139
|
return valueToJSON(this);
|
|
9935
10140
|
};
|
|
@@ -10358,7 +10563,7 @@ function handleSignalingEvents(room, signaling) {
|
|
|
10358
10563
|
}
|
|
10359
10564
|
module.exports = Room;
|
|
10360
10565
|
|
|
10361
|
-
},{"./eventemitter":10,"./remoteparticipant":
|
|
10566
|
+
},{"./eventemitter":10,"./remoteparticipant":56,"./stats/statsreport":116,"./util":132}],58:[function(require,module,exports){
|
|
10362
10567
|
/* eslint consistent-return:0 */
|
|
10363
10568
|
'use strict';
|
|
10364
10569
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -10528,7 +10733,7 @@ var Signaling = /** @class */ (function (_super) {
|
|
|
10528
10733
|
}(StateMachine));
|
|
10529
10734
|
module.exports = Signaling;
|
|
10530
10735
|
|
|
10531
|
-
},{"../statemachine":
|
|
10736
|
+
},{"../statemachine":88,"./participant":61,"./room":65}],59:[function(require,module,exports){
|
|
10532
10737
|
'use strict';
|
|
10533
10738
|
var __extends = (this && this.__extends) || (function () {
|
|
10534
10739
|
var extendStatics = function (d, b) {
|
|
@@ -10610,7 +10815,7 @@ var LocalParticipantSignaling = /** @class */ (function (_super) {
|
|
|
10610
10815
|
}(ParticipantSignaling));
|
|
10611
10816
|
module.exports = LocalParticipantSignaling;
|
|
10612
10817
|
|
|
10613
|
-
},{"./participant":
|
|
10818
|
+
},{"./participant":61}],60:[function(require,module,exports){
|
|
10614
10819
|
'use strict';
|
|
10615
10820
|
var __extends = (this && this.__extends) || (function () {
|
|
10616
10821
|
var extendStatics = function (d, b) {
|
|
@@ -10741,7 +10946,7 @@ function setError(publication, error) {
|
|
|
10741
10946
|
}
|
|
10742
10947
|
module.exports = LocalTrackPublicationSignaling;
|
|
10743
10948
|
|
|
10744
|
-
},{"./track":
|
|
10949
|
+
},{"./track":66}],61:[function(require,module,exports){
|
|
10745
10950
|
'use strict';
|
|
10746
10951
|
var __extends = (this && this.__extends) || (function () {
|
|
10747
10952
|
var extendStatics = function (d, b) {
|
|
@@ -10966,7 +11171,7 @@ var ParticipantSignaling = /** @class */ (function (_super) {
|
|
|
10966
11171
|
*/
|
|
10967
11172
|
module.exports = ParticipantSignaling;
|
|
10968
11173
|
|
|
10969
|
-
},{"../statemachine":
|
|
11174
|
+
},{"../statemachine":88,"../stats/networkqualitystats":103}],62:[function(require,module,exports){
|
|
10970
11175
|
'use strict';
|
|
10971
11176
|
var __extends = (this && this.__extends) || (function () {
|
|
10972
11177
|
var extendStatics = function (d, b) {
|
|
@@ -11039,7 +11244,7 @@ var RecordingSignaling = /** @class */ (function (_super) {
|
|
|
11039
11244
|
*/
|
|
11040
11245
|
module.exports = RecordingSignaling;
|
|
11041
11246
|
|
|
11042
|
-
},{"events":173}],
|
|
11247
|
+
},{"events":173}],63:[function(require,module,exports){
|
|
11043
11248
|
'use strict';
|
|
11044
11249
|
var __extends = (this && this.__extends) || (function () {
|
|
11045
11250
|
var extendStatics = function (d, b) {
|
|
@@ -11079,7 +11284,7 @@ var RemoteParticipantSignaling = /** @class */ (function (_super) {
|
|
|
11079
11284
|
}(ParticipantSignaling));
|
|
11080
11285
|
module.exports = RemoteParticipantSignaling;
|
|
11081
11286
|
|
|
11082
|
-
},{"./participant":
|
|
11287
|
+
},{"./participant":61}],64:[function(require,module,exports){
|
|
11083
11288
|
'use strict';
|
|
11084
11289
|
var __extends = (this && this.__extends) || (function () {
|
|
11085
11290
|
var extendStatics = function (d, b) {
|
|
@@ -11184,7 +11389,7 @@ var RemoteTrackPublicationSignaling = /** @class */ (function (_super) {
|
|
|
11184
11389
|
}(TrackSignaling));
|
|
11185
11390
|
module.exports = RemoteTrackPublicationSignaling;
|
|
11186
11391
|
|
|
11187
|
-
},{"./track":
|
|
11392
|
+
},{"./track":66}],65:[function(require,module,exports){
|
|
11188
11393
|
'use strict';
|
|
11189
11394
|
var __extends = (this && this.__extends) || (function () {
|
|
11190
11395
|
var extendStatics = function (d, b) {
|
|
@@ -11465,7 +11670,7 @@ function maybeUpdateState(roomSignaling) {
|
|
|
11465
11670
|
}
|
|
11466
11671
|
module.exports = RoomSignaling;
|
|
11467
11672
|
|
|
11468
|
-
},{"../statemachine":
|
|
11673
|
+
},{"../statemachine":88,"../util":132,"../util/constants":125,"../util/log":136,"../util/timeout":146,"../util/twilio-video-errors":147,"./recording":62}],66:[function(require,module,exports){
|
|
11469
11674
|
'use strict';
|
|
11470
11675
|
var __extends = (this && this.__extends) || (function () {
|
|
11471
11676
|
var extendStatics = function (d, b) {
|
|
@@ -11648,7 +11853,7 @@ var TrackSignaling = /** @class */ (function (_super) {
|
|
|
11648
11853
|
*/
|
|
11649
11854
|
module.exports = TrackSignaling;
|
|
11650
11855
|
|
|
11651
|
-
},{"events":173}],
|
|
11856
|
+
},{"events":173}],67:[function(require,module,exports){
|
|
11652
11857
|
'use strict';
|
|
11653
11858
|
var CancelablePromise = require('../../util/cancelablepromise');
|
|
11654
11859
|
var DefaultPeerConnectionManager = require('./peerconnectionmanager');
|
|
@@ -11765,7 +11970,7 @@ function createCancelableRoomSignalingPromise(token, wsServer, localParticipant,
|
|
|
11765
11970
|
}
|
|
11766
11971
|
module.exports = createCancelableRoomSignalingPromise;
|
|
11767
11972
|
|
|
11768
|
-
},{"../../util":
|
|
11973
|
+
},{"../../util":132,"../../util/cancelablepromise":124,"../../util/twilio-video-errors":147,"./peerconnectionmanager":78,"./room":84,"./twilioconnectiontransport":87}],68:[function(require,module,exports){
|
|
11769
11974
|
'use strict';
|
|
11770
11975
|
var __extends = (this && this.__extends) || (function () {
|
|
11771
11976
|
var extendStatics = function (d, b) {
|
|
@@ -11843,7 +12048,7 @@ var DominantSpeakerSignaling = /** @class */ (function (_super) {
|
|
|
11843
12048
|
*/
|
|
11844
12049
|
module.exports = DominantSpeakerSignaling;
|
|
11845
12050
|
|
|
11846
|
-
},{"./mediasignaling":
|
|
12051
|
+
},{"./mediasignaling":74}],69:[function(require,module,exports){
|
|
11847
12052
|
'use strict';
|
|
11848
12053
|
var Filter = require('../../util/filter');
|
|
11849
12054
|
/**
|
|
@@ -11911,7 +12116,7 @@ var IceBox = /** @class */ (function () {
|
|
|
11911
12116
|
}());
|
|
11912
12117
|
module.exports = IceBox;
|
|
11913
12118
|
|
|
11914
|
-
},{"../../util/filter":
|
|
12119
|
+
},{"../../util/filter":131}],70:[function(require,module,exports){
|
|
11915
12120
|
'use strict';
|
|
11916
12121
|
var _a = require('../../util/constants'), ICE_ACTIVITY_CHECK_PERIOD_MS = _a.ICE_ACTIVITY_CHECK_PERIOD_MS, ICE_INACTIVITY_THRESHOLD_MS = _a.ICE_INACTIVITY_THRESHOLD_MS;
|
|
11917
12122
|
/**
|
|
@@ -12044,7 +12249,7 @@ var IceConnectionMonitor = /** @class */ (function () {
|
|
|
12044
12249
|
}());
|
|
12045
12250
|
module.exports = IceConnectionMonitor;
|
|
12046
12251
|
|
|
12047
|
-
},{"../../util/constants":
|
|
12252
|
+
},{"../../util/constants":125}],71:[function(require,module,exports){
|
|
12048
12253
|
'use strict';
|
|
12049
12254
|
var __extends = (this && this.__extends) || (function () {
|
|
12050
12255
|
var extendStatics = function (d, b) {
|
|
@@ -12109,7 +12314,7 @@ var SignalingV2 = /** @class */ (function (_super) {
|
|
|
12109
12314
|
}(Signaling));
|
|
12110
12315
|
module.exports = SignalingV2;
|
|
12111
12316
|
|
|
12112
|
-
},{"../":
|
|
12317
|
+
},{"../":58,"./cancelableroomsignalingpromise":67,"./localparticipant":72}],72:[function(require,module,exports){
|
|
12113
12318
|
'use strict';
|
|
12114
12319
|
var __extends = (this && this.__extends) || (function () {
|
|
12115
12320
|
var extendStatics = function (d, b) {
|
|
@@ -12449,7 +12654,7 @@ var LocalParticipantV2 = /** @class */ (function (_super) {
|
|
|
12449
12654
|
*/
|
|
12450
12655
|
module.exports = LocalParticipantV2;
|
|
12451
12656
|
|
|
12452
|
-
},{"../../util":
|
|
12657
|
+
},{"../../util":132,"../../util/constants":125,"../../util/log":136,"../localparticipant":59,"./localtrackpublication":73}],73:[function(require,module,exports){
|
|
12453
12658
|
'use strict';
|
|
12454
12659
|
var __extends = (this && this.__extends) || (function () {
|
|
12455
12660
|
var extendStatics = function (d, b) {
|
|
@@ -12576,7 +12781,7 @@ var LocalTrackPublicationV2 = /** @class */ (function (_super) {
|
|
|
12576
12781
|
*/
|
|
12577
12782
|
module.exports = LocalTrackPublicationV2;
|
|
12578
12783
|
|
|
12579
|
-
},{"../../util/twilio-video-errors":
|
|
12784
|
+
},{"../../util/twilio-video-errors":147,"../../util/twiliowarning":149,"../localtrackpublication":60}],74:[function(require,module,exports){
|
|
12580
12785
|
/* eslint callback-return:0 */
|
|
12581
12786
|
'use strict';
|
|
12582
12787
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -12673,7 +12878,7 @@ var MediaSignaling = /** @class */ (function (_super) {
|
|
|
12673
12878
|
}(EventEmitter));
|
|
12674
12879
|
module.exports = MediaSignaling;
|
|
12675
12880
|
|
|
12676
|
-
},{"events":173}],
|
|
12881
|
+
},{"events":173}],75:[function(require,module,exports){
|
|
12677
12882
|
/* eslint callback-return:0 */
|
|
12678
12883
|
'use strict';
|
|
12679
12884
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -12832,7 +13037,7 @@ function next(monitor) {
|
|
|
12832
13037
|
*/
|
|
12833
13038
|
module.exports = NetworkQualityMonitor;
|
|
12834
13039
|
|
|
12835
|
-
},{"../../stats/peerconnectionreportfactory":
|
|
13040
|
+
},{"../../stats/peerconnectionreportfactory":106,"events":173}],76:[function(require,module,exports){
|
|
12836
13041
|
'use strict';
|
|
12837
13042
|
var __extends = (this && this.__extends) || (function () {
|
|
12838
13043
|
var extendStatics = function (d, b) {
|
|
@@ -13097,7 +13302,7 @@ function createNetworkQualityInputsMessage(networkQualityInputs, networkQualityR
|
|
|
13097
13302
|
}
|
|
13098
13303
|
module.exports = NetworkQualitySignaling;
|
|
13099
13304
|
|
|
13100
|
-
},{"../../util/asyncvar":
|
|
13305
|
+
},{"../../util/asyncvar":121,"../../util/timeout":146,"./mediasignaling":74}],77:[function(require,module,exports){
|
|
13101
13306
|
'use strict';
|
|
13102
13307
|
var __extends = (this && this.__extends) || (function () {
|
|
13103
13308
|
var extendStatics = function (d, b) {
|
|
@@ -14957,7 +15162,7 @@ function setMaxBitrate(params, maxBitrate) {
|
|
|
14957
15162
|
}
|
|
14958
15163
|
module.exports = PeerConnectionV2;
|
|
14959
15164
|
|
|
14960
|
-
},{"../../data/receiver":5,"../../media/track/receiver":
|
|
15165
|
+
},{"../../data/receiver":5,"../../media/track/receiver":30,"../../statemachine":88,"../../util":132,"../../util/backoff":122,"../../util/constants":125,"../../util/log":136,"../../util/sdp":140,"../../util/sdp/issue8329":141,"../../util/sdp/trackmatcher":143,"../../util/timeout":146,"../../util/twilio-video-errors":147,"../../webrtc":158,"../../webrtc/util":170,"./icebox":69,"./iceconnectionmonitor.js":70}],78:[function(require,module,exports){
|
|
14961
15166
|
'use strict';
|
|
14962
15167
|
var __extends = (this && this.__extends) || (function () {
|
|
14963
15168
|
var extendStatics = function (d, b) {
|
|
@@ -15525,7 +15730,7 @@ function updateConnectionState(pcm) {
|
|
|
15525
15730
|
}
|
|
15526
15731
|
module.exports = PeerConnectionManager;
|
|
15527
15732
|
|
|
15528
|
-
},{"../../media/track/sender":
|
|
15733
|
+
},{"../../media/track/sender":39,"../../queueingeventemitter":55,"../../util":132,"../../util/twilio-video-errors":147,"../../webaudio/audiocontext":153,"../../webrtc/util":170,"./peerconnection":77}],79:[function(require,module,exports){
|
|
15529
15734
|
/* eslint callback-return:0 */
|
|
15530
15735
|
'use strict';
|
|
15531
15736
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -15611,7 +15816,7 @@ var PublisherHintsSignaling = /** @class */ (function (_super) {
|
|
|
15611
15816
|
}(MediaSignaling));
|
|
15612
15817
|
module.exports = PublisherHintsSignaling;
|
|
15613
15818
|
|
|
15614
|
-
},{"./mediasignaling":
|
|
15819
|
+
},{"./mediasignaling":74}],80:[function(require,module,exports){
|
|
15615
15820
|
'use strict';
|
|
15616
15821
|
var __extends = (this && this.__extends) || (function () {
|
|
15617
15822
|
var extendStatics = function (d, b) {
|
|
@@ -15671,7 +15876,7 @@ var RecordingV2 = /** @class */ (function (_super) {
|
|
|
15671
15876
|
*/
|
|
15672
15877
|
module.exports = RecordingV2;
|
|
15673
15878
|
|
|
15674
|
-
},{"../recording":
|
|
15879
|
+
},{"../recording":62}],81:[function(require,module,exports){
|
|
15675
15880
|
'use strict';
|
|
15676
15881
|
var __extends = (this && this.__extends) || (function () {
|
|
15677
15882
|
var extendStatics = function (d, b) {
|
|
@@ -15791,7 +15996,7 @@ var RemoteParticipantV2 = /** @class */ (function (_super) {
|
|
|
15791
15996
|
}(RemoteParticipantSignaling));
|
|
15792
15997
|
module.exports = RemoteParticipantV2;
|
|
15793
15998
|
|
|
15794
|
-
},{"../remoteparticipant":
|
|
15999
|
+
},{"../remoteparticipant":63,"./remotetrackpublication":82}],82:[function(require,module,exports){
|
|
15795
16000
|
'use strict';
|
|
15796
16001
|
var __extends = (this && this.__extends) || (function () {
|
|
15797
16002
|
var extendStatics = function (d, b) {
|
|
@@ -15845,7 +16050,7 @@ var RemoteTrackPublicationV2 = /** @class */ (function (_super) {
|
|
|
15845
16050
|
*/
|
|
15846
16051
|
module.exports = RemoteTrackPublicationV2;
|
|
15847
16052
|
|
|
15848
|
-
},{"../remotetrackpublication":
|
|
16053
|
+
},{"../remotetrackpublication":64}],83:[function(require,module,exports){
|
|
15849
16054
|
/* eslint callback-return:0 */
|
|
15850
16055
|
'use strict';
|
|
15851
16056
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -15996,7 +16201,7 @@ var RenderHintsSignaling = /** @class */ (function (_super) {
|
|
|
15996
16201
|
}(MediaSignaling));
|
|
15997
16202
|
module.exports = RenderHintsSignaling;
|
|
15998
16203
|
|
|
15999
|
-
},{"../../util":
|
|
16204
|
+
},{"../../util":132,"../../util/timeout":146,"./mediasignaling":74}],84:[function(require,module,exports){
|
|
16000
16205
|
/* eslint-disable no-console */
|
|
16001
16206
|
'use strict';
|
|
16002
16207
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -16854,7 +17059,7 @@ function replaceNullsWithDefaults(activeIceCandidatePair, peerConnectionId) {
|
|
|
16854
17059
|
}
|
|
16855
17060
|
module.exports = RoomV2;
|
|
16856
17061
|
|
|
16857
|
-
},{"../../stats/statsreport":
|
|
17062
|
+
},{"../../stats/statsreport":116,"../../util":132,"../../util/movingaveragedelta":137,"../../util/twilio-video-errors":147,"../room":65,"./dominantspeakersignaling":68,"./networkqualitymonitor":75,"./networkqualitysignaling":76,"./publisherhintsignaling.js":79,"./recording":80,"./remoteparticipant":81,"./renderhintssignaling":83,"./trackprioritysignaling":85,"./trackswitchoffsignaling":86}],85:[function(require,module,exports){
|
|
16858
17063
|
'use strict';
|
|
16859
17064
|
var __extends = (this && this.__extends) || (function () {
|
|
16860
17065
|
var extendStatics = function (d, b) {
|
|
@@ -16920,7 +17125,7 @@ var TrackPrioritySignaling = /** @class */ (function (_super) {
|
|
|
16920
17125
|
}(MediaSignaling));
|
|
16921
17126
|
module.exports = TrackPrioritySignaling;
|
|
16922
17127
|
|
|
16923
|
-
},{"./mediasignaling":
|
|
17128
|
+
},{"./mediasignaling":74}],86:[function(require,module,exports){
|
|
16924
17129
|
'use strict';
|
|
16925
17130
|
var __extends = (this && this.__extends) || (function () {
|
|
16926
17131
|
var extendStatics = function (d, b) {
|
|
@@ -16978,7 +17183,7 @@ var TrackSwitchOffSignaling = /** @class */ (function (_super) {
|
|
|
16978
17183
|
*/
|
|
16979
17184
|
module.exports = TrackSwitchOffSignaling;
|
|
16980
17185
|
|
|
16981
|
-
},{"./mediasignaling":
|
|
17186
|
+
},{"./mediasignaling":74}],87:[function(require,module,exports){
|
|
16982
17187
|
'use strict';
|
|
16983
17188
|
var __extends = (this && this.__extends) || (function () {
|
|
16984
17189
|
var extendStatics = function (d, b) {
|
|
@@ -17565,7 +17770,7 @@ function setupTransport(transport) {
|
|
|
17565
17770
|
}
|
|
17566
17771
|
module.exports = TwilioConnectionTransport;
|
|
17567
17772
|
|
|
17568
|
-
},{"../../statemachine":
|
|
17773
|
+
},{"../../statemachine":88,"../../twilioconnection":120,"../../util":132,"../../util/backoff":122,"../../util/constants":125,"../../util/timeout":146,"../../util/twilio-video-errors":147}],88:[function(require,module,exports){
|
|
17569
17774
|
'use strict';
|
|
17570
17775
|
var __extends = (this && this.__extends) || (function () {
|
|
17571
17776
|
var extendStatics = function (d, b) {
|
|
@@ -18011,7 +18216,7 @@ function createUnreachableError(here, there) {
|
|
|
18011
18216
|
}
|
|
18012
18217
|
module.exports = StateMachine;
|
|
18013
18218
|
|
|
18014
|
-
},{"./util":
|
|
18219
|
+
},{"./util":132,"events":173}],89:[function(require,module,exports){
|
|
18015
18220
|
/* eslint no-undefined:0 */
|
|
18016
18221
|
'use strict';
|
|
18017
18222
|
/**
|
|
@@ -18024,7 +18229,7 @@ function average(xs) {
|
|
|
18024
18229
|
}
|
|
18025
18230
|
module.exports = average;
|
|
18026
18231
|
|
|
18027
|
-
},{}],
|
|
18232
|
+
},{}],90:[function(require,module,exports){
|
|
18028
18233
|
'use strict';
|
|
18029
18234
|
/**
|
|
18030
18235
|
* @property {number} [availableSend] - bps (undefined in Firefox)
|
|
@@ -18082,7 +18287,7 @@ var IceReport = /** @class */ (function () {
|
|
|
18082
18287
|
}());
|
|
18083
18288
|
module.exports = IceReport;
|
|
18084
18289
|
|
|
18085
|
-
},{}],
|
|
18290
|
+
},{}],91:[function(require,module,exports){
|
|
18086
18291
|
'use strict';
|
|
18087
18292
|
var IceReport = require('./icereport');
|
|
18088
18293
|
/**
|
|
@@ -18127,7 +18332,7 @@ var IceReportFactory = /** @class */ (function () {
|
|
|
18127
18332
|
}());
|
|
18128
18333
|
module.exports = IceReportFactory;
|
|
18129
18334
|
|
|
18130
|
-
},{"./icereport":
|
|
18335
|
+
},{"./icereport":90}],92:[function(require,module,exports){
|
|
18131
18336
|
'use strict';
|
|
18132
18337
|
var __extends = (this && this.__extends) || (function () {
|
|
18133
18338
|
var extendStatics = function (d, b) {
|
|
@@ -18185,7 +18390,7 @@ var LocalAudioTrackStats = /** @class */ (function (_super) {
|
|
|
18185
18390
|
*/
|
|
18186
18391
|
module.exports = LocalAudioTrackStats;
|
|
18187
18392
|
|
|
18188
|
-
},{"./localtrackstats":
|
|
18393
|
+
},{"./localtrackstats":93}],93:[function(require,module,exports){
|
|
18189
18394
|
'use strict';
|
|
18190
18395
|
var __extends = (this && this.__extends) || (function () {
|
|
18191
18396
|
var extendStatics = function (d, b) {
|
|
@@ -18245,7 +18450,7 @@ var LocalTrackStats = /** @class */ (function (_super) {
|
|
|
18245
18450
|
}(TrackStats));
|
|
18246
18451
|
module.exports = LocalTrackStats;
|
|
18247
18452
|
|
|
18248
|
-
},{"./trackstats":
|
|
18453
|
+
},{"./trackstats":118}],94:[function(require,module,exports){
|
|
18249
18454
|
'use strict';
|
|
18250
18455
|
var __extends = (this && this.__extends) || (function () {
|
|
18251
18456
|
var extendStatics = function (d, b) {
|
|
@@ -18338,7 +18543,7 @@ var LocalVideoTrackStats = /** @class */ (function (_super) {
|
|
|
18338
18543
|
}(LocalTrackStats));
|
|
18339
18544
|
module.exports = LocalVideoTrackStats;
|
|
18340
18545
|
|
|
18341
|
-
},{"./localtrackstats":
|
|
18546
|
+
},{"./localtrackstats":93}],95:[function(require,module,exports){
|
|
18342
18547
|
'use strict';
|
|
18343
18548
|
var __extends = (this && this.__extends) || (function () {
|
|
18344
18549
|
var extendStatics = function (d, b) {
|
|
@@ -18372,7 +18577,7 @@ var NetworkQualityAudioStats = /** @class */ (function (_super) {
|
|
|
18372
18577
|
}(NetworkQualityMediaStats));
|
|
18373
18578
|
module.exports = NetworkQualityAudioStats;
|
|
18374
18579
|
|
|
18375
|
-
},{"./networkqualitymediastats":
|
|
18580
|
+
},{"./networkqualitymediastats":99}],96:[function(require,module,exports){
|
|
18376
18581
|
'use strict';
|
|
18377
18582
|
/**
|
|
18378
18583
|
* Bandwidth network quality statistics.
|
|
@@ -18406,7 +18611,7 @@ var NetworkQualityBandwidthStats = /** @class */ (function () {
|
|
|
18406
18611
|
}());
|
|
18407
18612
|
module.exports = NetworkQualityBandwidthStats;
|
|
18408
18613
|
|
|
18409
|
-
},{}],
|
|
18614
|
+
},{}],97:[function(require,module,exports){
|
|
18410
18615
|
'use strict';
|
|
18411
18616
|
/**
|
|
18412
18617
|
* Fraction lost network quality statistics.
|
|
@@ -18435,7 +18640,7 @@ var NetworkQualityFractionLostStats = /** @class */ (function () {
|
|
|
18435
18640
|
}());
|
|
18436
18641
|
module.exports = NetworkQualityFractionLostStats;
|
|
18437
18642
|
|
|
18438
|
-
},{}],
|
|
18643
|
+
},{}],98:[function(require,module,exports){
|
|
18439
18644
|
'use strict';
|
|
18440
18645
|
/**
|
|
18441
18646
|
* Latency network quality statistics.
|
|
@@ -18469,7 +18674,7 @@ var NetworkQualityLatencyStats = /** @class */ (function () {
|
|
|
18469
18674
|
}());
|
|
18470
18675
|
module.exports = NetworkQualityLatencyStats;
|
|
18471
18676
|
|
|
18472
|
-
},{}],
|
|
18677
|
+
},{}],99:[function(require,module,exports){
|
|
18473
18678
|
'use strict';
|
|
18474
18679
|
var NetworkQualitySendStats = require('./networkqualitysendstats');
|
|
18475
18680
|
var NetworkQualityRecvStats = require('./networkqualityrecvstats');
|
|
@@ -18516,7 +18721,7 @@ var NetworkQualityMediaStats = /** @class */ (function () {
|
|
|
18516
18721
|
}());
|
|
18517
18722
|
module.exports = NetworkQualityMediaStats;
|
|
18518
18723
|
|
|
18519
|
-
},{"./networkqualityrecvstats":
|
|
18724
|
+
},{"./networkqualityrecvstats":100,"./networkqualitysendstats":102}],100:[function(require,module,exports){
|
|
18520
18725
|
'use strict';
|
|
18521
18726
|
var __extends = (this && this.__extends) || (function () {
|
|
18522
18727
|
var extendStatics = function (d, b) {
|
|
@@ -18551,7 +18756,7 @@ var NetworkQualityRecvStats = /** @class */ (function (_super) {
|
|
|
18551
18756
|
}(NetworkQualitySendOrRecvStats));
|
|
18552
18757
|
module.exports = NetworkQualityRecvStats;
|
|
18553
18758
|
|
|
18554
|
-
},{"./networkqualitysendorrecvstats":
|
|
18759
|
+
},{"./networkqualitysendorrecvstats":101}],101:[function(require,module,exports){
|
|
18555
18760
|
'use strict';
|
|
18556
18761
|
var NetworkQualityBandwidthStats = require('./networkqualitybandwidthstats');
|
|
18557
18762
|
var NetworkQualityFractionLostStats = require('./networkqualityfractionloststats');
|
|
@@ -18591,7 +18796,7 @@ var NetworkQualitySendOrRecvStats = /** @class */ (function () {
|
|
|
18591
18796
|
}());
|
|
18592
18797
|
module.exports = NetworkQualitySendOrRecvStats;
|
|
18593
18798
|
|
|
18594
|
-
},{"./networkqualitybandwidthstats":
|
|
18799
|
+
},{"./networkqualitybandwidthstats":96,"./networkqualityfractionloststats":97,"./networkqualitylatencystats":98}],102:[function(require,module,exports){
|
|
18595
18800
|
'use strict';
|
|
18596
18801
|
var __extends = (this && this.__extends) || (function () {
|
|
18597
18802
|
var extendStatics = function (d, b) {
|
|
@@ -18626,7 +18831,7 @@ var NetworkQualitySendStats = /** @class */ (function (_super) {
|
|
|
18626
18831
|
}(NetworkQualitySendOrRecvStats));
|
|
18627
18832
|
module.exports = NetworkQualitySendStats;
|
|
18628
18833
|
|
|
18629
|
-
},{"./networkqualitysendorrecvstats":
|
|
18834
|
+
},{"./networkqualitysendorrecvstats":101}],103:[function(require,module,exports){
|
|
18630
18835
|
'use strict';
|
|
18631
18836
|
var NetworkQualityAudioStats = require('./networkqualityaudiostats');
|
|
18632
18837
|
var NetworkQualityVideoStats = require('./networkqualityvideostats');
|
|
@@ -18666,7 +18871,7 @@ var NetworkQualityStats = /** @class */ (function () {
|
|
|
18666
18871
|
}());
|
|
18667
18872
|
module.exports = NetworkQualityStats;
|
|
18668
18873
|
|
|
18669
|
-
},{"./networkqualityaudiostats":
|
|
18874
|
+
},{"./networkqualityaudiostats":95,"./networkqualityvideostats":104}],104:[function(require,module,exports){
|
|
18670
18875
|
'use strict';
|
|
18671
18876
|
var __extends = (this && this.__extends) || (function () {
|
|
18672
18877
|
var extendStatics = function (d, b) {
|
|
@@ -18700,7 +18905,7 @@ var NetworkQualityVideoStats = /** @class */ (function (_super) {
|
|
|
18700
18905
|
}(NetworkQualityMediaStats));
|
|
18701
18906
|
module.exports = NetworkQualityVideoStats;
|
|
18702
18907
|
|
|
18703
|
-
},{"./networkqualitymediastats":
|
|
18908
|
+
},{"./networkqualitymediastats":99}],105:[function(require,module,exports){
|
|
18704
18909
|
'use strict';
|
|
18705
18910
|
var ReceiverReport = require('./receiverreport');
|
|
18706
18911
|
var SenderReport = require('./senderreport');
|
|
@@ -18778,7 +18983,7 @@ var PeerConnectionReport = /** @class */ (function () {
|
|
|
18778
18983
|
}());
|
|
18779
18984
|
module.exports = PeerConnectionReport;
|
|
18780
18985
|
|
|
18781
|
-
},{"./receiverreport":
|
|
18986
|
+
},{"./receiverreport":107,"./senderreport":114}],106:[function(require,module,exports){
|
|
18782
18987
|
'use strict';
|
|
18783
18988
|
var __read = (this && this.__read) || function (o, n) {
|
|
18784
18989
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -19208,7 +19413,7 @@ function updateChrome(factory) {
|
|
|
19208
19413
|
}
|
|
19209
19414
|
module.exports = PeerConnectionReportFactory;
|
|
19210
19415
|
|
|
19211
|
-
},{"../webrtc/util":170,"./icereportfactory":
|
|
19416
|
+
},{"../webrtc/util":170,"./icereportfactory":91,"./peerconnectionreport":105,"./receiverreportfactory":108,"./senderreportfactory":115}],107:[function(require,module,exports){
|
|
19212
19417
|
'use strict';
|
|
19213
19418
|
var __extends = (this && this.__extends) || (function () {
|
|
19214
19419
|
var extendStatics = function (d, b) {
|
|
@@ -19334,7 +19539,7 @@ var ReceiverReport = /** @class */ (function (_super) {
|
|
|
19334
19539
|
}(SenderOrReceiverReport));
|
|
19335
19540
|
module.exports = ReceiverReport;
|
|
19336
19541
|
|
|
19337
|
-
},{"./average":
|
|
19542
|
+
},{"./average":89,"./senderorreceiverreport":112,"./sum":117}],108:[function(require,module,exports){
|
|
19338
19543
|
'use strict';
|
|
19339
19544
|
var __extends = (this && this.__extends) || (function () {
|
|
19340
19545
|
var extendStatics = function (d, b) {
|
|
@@ -19393,7 +19598,7 @@ var ReceiverReportFactory = /** @class */ (function (_super) {
|
|
|
19393
19598
|
}(SenderOrReceiverReportFactory));
|
|
19394
19599
|
module.exports = ReceiverReportFactory;
|
|
19395
19600
|
|
|
19396
|
-
},{"./receiverreport":
|
|
19601
|
+
},{"./receiverreport":107,"./senderorreceiverreportfactory":113}],109:[function(require,module,exports){
|
|
19397
19602
|
'use strict';
|
|
19398
19603
|
var __extends = (this && this.__extends) || (function () {
|
|
19399
19604
|
var extendStatics = function (d, b) {
|
|
@@ -19445,7 +19650,7 @@ var RemoteAudioTrackStats = /** @class */ (function (_super) {
|
|
|
19445
19650
|
}(RemoteTrackStats));
|
|
19446
19651
|
module.exports = RemoteAudioTrackStats;
|
|
19447
19652
|
|
|
19448
|
-
},{"./remotetrackstats":
|
|
19653
|
+
},{"./remotetrackstats":110}],110:[function(require,module,exports){
|
|
19449
19654
|
'use strict';
|
|
19450
19655
|
var __extends = (this && this.__extends) || (function () {
|
|
19451
19656
|
var extendStatics = function (d, b) {
|
|
@@ -19497,7 +19702,7 @@ var RemoteTrackStats = /** @class */ (function (_super) {
|
|
|
19497
19702
|
}(TrackStats));
|
|
19498
19703
|
module.exports = RemoteTrackStats;
|
|
19499
19704
|
|
|
19500
|
-
},{"./trackstats":
|
|
19705
|
+
},{"./trackstats":118}],111:[function(require,module,exports){
|
|
19501
19706
|
'use strict';
|
|
19502
19707
|
var __extends = (this && this.__extends) || (function () {
|
|
19503
19708
|
var extendStatics = function (d, b) {
|
|
@@ -19562,7 +19767,7 @@ var RemoteVideoTrackStats = /** @class */ (function (_super) {
|
|
|
19562
19767
|
}(RemoteTrackStats));
|
|
19563
19768
|
module.exports = RemoteVideoTrackStats;
|
|
19564
19769
|
|
|
19565
|
-
},{"./remotetrackstats":
|
|
19770
|
+
},{"./remotetrackstats":110}],112:[function(require,module,exports){
|
|
19566
19771
|
'use strict';
|
|
19567
19772
|
/**
|
|
19568
19773
|
* @property {StatsId} id
|
|
@@ -19596,7 +19801,7 @@ var SenderOrReceiverReport = /** @class */ (function () {
|
|
|
19596
19801
|
}());
|
|
19597
19802
|
module.exports = SenderOrReceiverReport;
|
|
19598
19803
|
|
|
19599
|
-
},{}],
|
|
19804
|
+
},{}],113:[function(require,module,exports){
|
|
19600
19805
|
'use strict';
|
|
19601
19806
|
/**
|
|
19602
19807
|
* @property {StatsId} id
|
|
@@ -19632,7 +19837,7 @@ var SenderOrReceiverReportFactory = /** @class */ (function () {
|
|
|
19632
19837
|
}());
|
|
19633
19838
|
module.exports = SenderOrReceiverReportFactory;
|
|
19634
19839
|
|
|
19635
|
-
},{}],
|
|
19840
|
+
},{}],114:[function(require,module,exports){
|
|
19636
19841
|
/* eslint no-undefined:0 */
|
|
19637
19842
|
'use strict';
|
|
19638
19843
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -19720,7 +19925,7 @@ var SenderReport = /** @class */ (function (_super) {
|
|
|
19720
19925
|
}(SenderOrReceiverReport));
|
|
19721
19926
|
module.exports = SenderReport;
|
|
19722
19927
|
|
|
19723
|
-
},{"./average":
|
|
19928
|
+
},{"./average":89,"./senderorreceiverreport":112,"./sum":117}],115:[function(require,module,exports){
|
|
19724
19929
|
'use strict';
|
|
19725
19930
|
var __extends = (this && this.__extends) || (function () {
|
|
19726
19931
|
var extendStatics = function (d, b) {
|
|
@@ -19779,7 +19984,7 @@ var SenderReportFactory = /** @class */ (function (_super) {
|
|
|
19779
19984
|
}(SenderOrReceiverReportFactory));
|
|
19780
19985
|
module.exports = SenderReportFactory;
|
|
19781
19986
|
|
|
19782
|
-
},{"./senderorreceiverreportfactory":
|
|
19987
|
+
},{"./senderorreceiverreportfactory":113,"./senderreport":114}],116:[function(require,module,exports){
|
|
19783
19988
|
'use strict';
|
|
19784
19989
|
var LocalAudioTrackStats = require('./localaudiotrackstats');
|
|
19785
19990
|
var LocalVideoTrackStats = require('./localvideotrackstats');
|
|
@@ -19830,7 +20035,7 @@ var StatsReport = /** @class */ (function () {
|
|
|
19830
20035
|
}());
|
|
19831
20036
|
module.exports = StatsReport;
|
|
19832
20037
|
|
|
19833
|
-
},{"./localaudiotrackstats":
|
|
20038
|
+
},{"./localaudiotrackstats":92,"./localvideotrackstats":94,"./remoteaudiotrackstats":109,"./remotevideotrackstats":111}],117:[function(require,module,exports){
|
|
19834
20039
|
'use strict';
|
|
19835
20040
|
/**
|
|
19836
20041
|
* @param {Array<number|undefined>} xs
|
|
@@ -19841,7 +20046,7 @@ function sum(xs) {
|
|
|
19841
20046
|
}
|
|
19842
20047
|
module.exports = sum;
|
|
19843
20048
|
|
|
19844
|
-
},{}],
|
|
20049
|
+
},{}],118:[function(require,module,exports){
|
|
19845
20050
|
'use strict';
|
|
19846
20051
|
/**
|
|
19847
20052
|
* Statistics for a {@link Track}.
|
|
@@ -19900,7 +20105,7 @@ var TrackStats = /** @class */ (function () {
|
|
|
19900
20105
|
}());
|
|
19901
20106
|
module.exports = TrackStats;
|
|
19902
20107
|
|
|
19903
|
-
},{}],
|
|
20108
|
+
},{}],119:[function(require,module,exports){
|
|
19904
20109
|
'use strict';
|
|
19905
20110
|
var __extends = (this && this.__extends) || (function () {
|
|
19906
20111
|
var extendStatics = function (d, b) {
|
|
@@ -19917,11 +20122,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
19917
20122
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19918
20123
|
};
|
|
19919
20124
|
})();
|
|
19920
|
-
var
|
|
20125
|
+
var QueueingEventEmitter = require('./queueingeventemitter');
|
|
19921
20126
|
/**
|
|
19922
20127
|
* A {@link TrackTransceiver} represents either one or more local RTCRtpSenders
|
|
19923
20128
|
* or RTCDataChannels, or a single RTCRtpReceiver or remote RTCDataChannel.
|
|
19924
|
-
* @extends
|
|
20129
|
+
* @extends QueueingEventEmitter
|
|
19925
20130
|
* @property {Track.ID} id
|
|
19926
20131
|
* @property {Track.kind} kind
|
|
19927
20132
|
*/
|
|
@@ -19955,14 +20160,14 @@ var TrackTransceiver = /** @class */ (function (_super) {
|
|
|
19955
20160
|
this.emit('stopped');
|
|
19956
20161
|
};
|
|
19957
20162
|
return TrackTransceiver;
|
|
19958
|
-
}(
|
|
20163
|
+
}(QueueingEventEmitter));
|
|
19959
20164
|
/**
|
|
19960
20165
|
* The {@link TrackTransceiver} was stopped.
|
|
19961
20166
|
* @event TrackTransceiver#stopped
|
|
19962
20167
|
*/
|
|
19963
20168
|
module.exports = TrackTransceiver;
|
|
19964
20169
|
|
|
19965
|
-
},{"
|
|
20170
|
+
},{"./queueingeventemitter":55}],120:[function(require,module,exports){
|
|
19966
20171
|
'use strict';
|
|
19967
20172
|
var __extends = (this && this.__extends) || (function () {
|
|
19968
20173
|
var extendStatics = function (d, b) {
|
|
@@ -20615,7 +20820,7 @@ TwilioConnection.CloseReason = CloseReason;
|
|
|
20615
20820
|
*/
|
|
20616
20821
|
module.exports = TwilioConnection;
|
|
20617
20822
|
|
|
20618
|
-
},{"./statemachine":
|
|
20823
|
+
},{"./statemachine":88,"./util":132,"./util/log":136,"./util/networkmonitor":138,"./util/timeout":146,"ws":175}],121:[function(require,module,exports){
|
|
20619
20824
|
'use strict';
|
|
20620
20825
|
var defer = require('./').defer;
|
|
20621
20826
|
/**
|
|
@@ -20680,7 +20885,7 @@ var AsyncVar = /** @class */ (function () {
|
|
|
20680
20885
|
}());
|
|
20681
20886
|
module.exports = AsyncVar;
|
|
20682
20887
|
|
|
20683
|
-
},{"./":
|
|
20888
|
+
},{"./":132}],122:[function(require,module,exports){
|
|
20684
20889
|
/**
|
|
20685
20890
|
* Expose `Backoff`.
|
|
20686
20891
|
*/
|
|
@@ -20764,7 +20969,7 @@ var Backoff = /** @class */ (function () {
|
|
|
20764
20969
|
}());
|
|
20765
20970
|
module.exports = Backoff;
|
|
20766
20971
|
|
|
20767
|
-
},{}],
|
|
20972
|
+
},{}],123:[function(require,module,exports){
|
|
20768
20973
|
/* globals chrome, navigator */
|
|
20769
20974
|
'use strict';
|
|
20770
20975
|
var __read = (this && this.__read) || function (o, n) {
|
|
@@ -20922,7 +21127,7 @@ module.exports = {
|
|
|
20922
21127
|
rebrandedChromeBrowser: rebrandedChromeBrowser
|
|
20923
21128
|
};
|
|
20924
21129
|
|
|
20925
|
-
},{}],
|
|
21130
|
+
},{}],124:[function(require,module,exports){
|
|
20926
21131
|
'use strict';
|
|
20927
21132
|
var __read = (this && this.__read) || function (o, n) {
|
|
20928
21133
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -21065,7 +21270,7 @@ var CancelablePromise = /** @class */ (function () {
|
|
|
21065
21270
|
}());
|
|
21066
21271
|
module.exports = CancelablePromise;
|
|
21067
21272
|
|
|
21068
|
-
},{}],
|
|
21273
|
+
},{}],125:[function(require,module,exports){
|
|
21069
21274
|
'use strict';
|
|
21070
21275
|
/* eslint-disable camelcase */
|
|
21071
21276
|
var packageInfo = require('../../package.json');
|
|
@@ -21167,7 +21372,7 @@ module.exports.videoContentPreferencesMode = {
|
|
|
21167
21372
|
MODE_MANUAL: 'manual'
|
|
21168
21373
|
};
|
|
21169
21374
|
|
|
21170
|
-
},{"../../package.json":174}],
|
|
21375
|
+
},{"../../package.json":174}],126:[function(require,module,exports){
|
|
21171
21376
|
'use strict';
|
|
21172
21377
|
var detectSilence = require('../webaudio/detectsilence');
|
|
21173
21378
|
var N_ATTEMPTS = 3;
|
|
@@ -21208,7 +21413,7 @@ function detectSilentAudio(el) {
|
|
|
21208
21413
|
}
|
|
21209
21414
|
module.exports = detectSilentAudio;
|
|
21210
21415
|
|
|
21211
|
-
},{"../webaudio/audiocontext":
|
|
21416
|
+
},{"../webaudio/audiocontext":153,"../webaudio/detectsilence":154}],127:[function(require,module,exports){
|
|
21212
21417
|
'use strict';
|
|
21213
21418
|
// Cached copy of the <canvas> used to check silent video frames.
|
|
21214
21419
|
var canvas = null;
|
|
@@ -21267,7 +21472,7 @@ function detectSilentVideo(el) {
|
|
|
21267
21472
|
}
|
|
21268
21473
|
module.exports = detectSilentVideo;
|
|
21269
21474
|
|
|
21270
|
-
},{}],
|
|
21475
|
+
},{}],128:[function(require,module,exports){
|
|
21271
21476
|
'use strict';
|
|
21272
21477
|
/**
|
|
21273
21478
|
* The {@link DocumentVisibilityMonitor} monitors the visibility state of the DOM
|
|
@@ -21389,7 +21594,7 @@ var DocumentVisibilityMonitor = /** @class */ (function () {
|
|
|
21389
21594
|
}());
|
|
21390
21595
|
module.exports = new DocumentVisibilityMonitor(2);
|
|
21391
21596
|
|
|
21392
|
-
},{}],
|
|
21597
|
+
},{}],129:[function(require,module,exports){
|
|
21393
21598
|
'use strict';
|
|
21394
21599
|
module.exports = (function (scope) {
|
|
21395
21600
|
var location = scope.location, URL = scope.URL;
|
|
@@ -21412,7 +21617,7 @@ module.exports = (function (scope) {
|
|
|
21412
21617
|
};
|
|
21413
21618
|
}(globalThis));
|
|
21414
21619
|
|
|
21415
|
-
},{}],
|
|
21620
|
+
},{}],130:[function(require,module,exports){
|
|
21416
21621
|
/* eslint-disable no-console */
|
|
21417
21622
|
'use strict';
|
|
21418
21623
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -21510,7 +21715,7 @@ var EventObserver = /** @class */ (function (_super) {
|
|
|
21510
21715
|
*/
|
|
21511
21716
|
module.exports = EventObserver;
|
|
21512
21717
|
|
|
21513
|
-
},{"events":173}],
|
|
21718
|
+
},{"events":173}],131:[function(require,module,exports){
|
|
21514
21719
|
'use strict';
|
|
21515
21720
|
var Filter = /** @class */ (function () {
|
|
21516
21721
|
function Filter(options) {
|
|
@@ -21554,7 +21759,7 @@ var Filter = /** @class */ (function () {
|
|
|
21554
21759
|
}());
|
|
21555
21760
|
module.exports = Filter;
|
|
21556
21761
|
|
|
21557
|
-
},{}],
|
|
21762
|
+
},{}],132:[function(require,module,exports){
|
|
21558
21763
|
'use strict';
|
|
21559
21764
|
var __extends = (this && this.__extends) || (function () {
|
|
21560
21765
|
var extendStatics = function (d, b) {
|
|
@@ -22451,7 +22656,7 @@ exports.isUserMediaTrack = isUserMediaTrack;
|
|
|
22451
22656
|
exports.waitForSometime = waitForSometime;
|
|
22452
22657
|
exports.waitForEvent = waitForEvent;
|
|
22453
22658
|
|
|
22454
|
-
},{"../webrtc/util":170,"./constants":
|
|
22659
|
+
},{"../webrtc/util":170,"./constants":125,"./sid":144,"./twiliowarning":149}],133:[function(require,module,exports){
|
|
22455
22660
|
/* eslint-disable camelcase */
|
|
22456
22661
|
'use strict';
|
|
22457
22662
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -22746,7 +22951,7 @@ function reconnect(publisher, token, sdkName, sdkVersion, roomSid, participantSi
|
|
|
22746
22951
|
*/
|
|
22747
22952
|
module.exports = InsightsPublisher;
|
|
22748
22953
|
|
|
22749
|
-
},{"..":
|
|
22954
|
+
},{"..":132,"../../util":132,"../browserdetection":123,"../constants":125,"events":173,"ws":175}],134:[function(require,module,exports){
|
|
22750
22955
|
// eslint-disable-next-line no-warning-comments
|
|
22751
22956
|
// TODO(mroberts): This should be described as implementing some
|
|
22752
22957
|
// InsightsPublisher interface.
|
|
@@ -22791,7 +22996,7 @@ var InsightsPublisher = /** @class */ (function () {
|
|
|
22791
22996
|
}());
|
|
22792
22997
|
module.exports = InsightsPublisher;
|
|
22793
22998
|
|
|
22794
|
-
},{}],
|
|
22999
|
+
},{}],135:[function(require,module,exports){
|
|
22795
23000
|
'use strict';
|
|
22796
23001
|
var defer = require('./').defer;
|
|
22797
23002
|
/**
|
|
@@ -22853,7 +23058,7 @@ var LocalMediaRestartDeferreds = /** @class */ (function () {
|
|
|
22853
23058
|
}());
|
|
22854
23059
|
module.exports = new LocalMediaRestartDeferreds();
|
|
22855
23060
|
|
|
22856
|
-
},{"./":
|
|
23061
|
+
},{"./":132}],136:[function(require,module,exports){
|
|
22857
23062
|
/* eslint new-cap:0 */
|
|
22858
23063
|
'use strict';
|
|
22859
23064
|
var __read = (this && this.__read) || function (o, n) {
|
|
@@ -23140,7 +23345,7 @@ function validateLogLevels(levels) {
|
|
|
23140
23345
|
}
|
|
23141
23346
|
module.exports = Log;
|
|
23142
23347
|
|
|
23143
|
-
},{"../vendor/loglevel":
|
|
23348
|
+
},{"../vendor/loglevel":152,"./constants":125}],137:[function(require,module,exports){
|
|
23144
23349
|
'use strict';
|
|
23145
23350
|
/**
|
|
23146
23351
|
* Calculates the moving average delta for the given pair ofsamples. A sample (S)
|
|
@@ -23187,7 +23392,7 @@ var MovingAverageDelta = /** @class */ (function () {
|
|
|
23187
23392
|
}());
|
|
23188
23393
|
module.exports = MovingAverageDelta;
|
|
23189
23394
|
|
|
23190
|
-
},{}],
|
|
23395
|
+
},{}],138:[function(require,module,exports){
|
|
23191
23396
|
'use strict';
|
|
23192
23397
|
/**
|
|
23193
23398
|
* Monitor the network connection status to detect interruptions and handoffs.
|
|
@@ -23276,7 +23481,7 @@ var NetworkMonitor = /** @class */ (function () {
|
|
|
23276
23481
|
}());
|
|
23277
23482
|
module.exports = NetworkMonitor;
|
|
23278
23483
|
|
|
23279
|
-
},{}],
|
|
23484
|
+
},{}],139:[function(require,module,exports){
|
|
23280
23485
|
/* eslint-disable no-console */
|
|
23281
23486
|
'use strict';
|
|
23282
23487
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -23339,7 +23544,7 @@ var NullResizeObserver = /** @class */ (function (_super) {
|
|
|
23339
23544
|
}(NullObserver));
|
|
23340
23545
|
module.exports = { NullIntersectionObserver: NullIntersectionObserver, NullResizeObserver: NullResizeObserver, NullObserver: NullObserver };
|
|
23341
23546
|
|
|
23342
|
-
},{}],
|
|
23547
|
+
},{}],140:[function(require,module,exports){
|
|
23343
23548
|
'use strict';
|
|
23344
23549
|
var __read = (this && this.__read) || function (o, n) {
|
|
23345
23550
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -23877,7 +24082,7 @@ exports.revertSimulcast = revertSimulcast;
|
|
|
23877
24082
|
exports.setCodecPreferences = setCodecPreferences;
|
|
23878
24083
|
exports.setSimulcast = setSimulcast;
|
|
23879
24084
|
|
|
23880
|
-
},{"../":
|
|
24085
|
+
},{"../":132,"./simulcast":142}],141:[function(require,module,exports){
|
|
23881
24086
|
'use strict';
|
|
23882
24087
|
var RTCSessionDescription = require('../../webrtc').RTCSessionDescription;
|
|
23883
24088
|
var _a = require('./'), createPtToCodecName = _a.createPtToCodecName, getMediaSections = _a.getMediaSections;
|
|
@@ -24070,7 +24275,7 @@ function addFmtpAttributeForRtxPt(mediaSection, rtxPt, pt) {
|
|
|
24070
24275
|
}
|
|
24071
24276
|
module.exports = workaround;
|
|
24072
24277
|
|
|
24073
|
-
},{"../../webrtc":
|
|
24278
|
+
},{"../../webrtc":158,"./":140}],142:[function(require,module,exports){
|
|
24074
24279
|
'use strict';
|
|
24075
24280
|
var __read = (this && this.__read) || function (o, n) {
|
|
24076
24281
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -24333,7 +24538,7 @@ function setSimulcastInMediaSection(section, trackIdsToAttributes) {
|
|
|
24333
24538
|
*/
|
|
24334
24539
|
module.exports = setSimulcastInMediaSection;
|
|
24335
24540
|
|
|
24336
|
-
},{"../":
|
|
24541
|
+
},{"../":132}],143:[function(require,module,exports){
|
|
24337
24542
|
'use strict';
|
|
24338
24543
|
var getMediaSections = require('./').getMediaSections;
|
|
24339
24544
|
/**
|
|
@@ -24378,7 +24583,7 @@ var TrackMatcher = /** @class */ (function () {
|
|
|
24378
24583
|
}());
|
|
24379
24584
|
module.exports = TrackMatcher;
|
|
24380
24585
|
|
|
24381
|
-
},{"./":
|
|
24586
|
+
},{"./":140}],144:[function(require,module,exports){
|
|
24382
24587
|
var SID_CHARS = '1234567890abcdef';
|
|
24383
24588
|
var SID_CHAR_LENGTH = 32;
|
|
24384
24589
|
// copied from: https://code.hq.twilio.com/flex/monkey/blob/0fdce2b6c52d6be0b17a5cdb92f0c54f119b8ea8/src/client/lib/sid.ts#L39
|
|
@@ -24397,7 +24602,7 @@ function createSID(prefix) {
|
|
|
24397
24602
|
exports.sessionSID = createSID('SS');
|
|
24398
24603
|
exports.createSID = createSID;
|
|
24399
24604
|
|
|
24400
|
-
},{}],
|
|
24605
|
+
},{}],145:[function(require,module,exports){
|
|
24401
24606
|
'use strict';
|
|
24402
24607
|
var _a = require('../webrtc/util'), guessBrowser = _a.guessBrowser, isWebRTCSupported = _a.support;
|
|
24403
24608
|
var getSdpFormat = require('../webrtc/util/sdp').getSdpFormat;
|
|
@@ -24444,7 +24649,7 @@ function isSupported() {
|
|
|
24444
24649
|
}
|
|
24445
24650
|
module.exports = isSupported;
|
|
24446
24651
|
|
|
24447
|
-
},{"../webrtc/util":170,"../webrtc/util/sdp":172,"./browserdetection":
|
|
24652
|
+
},{"../webrtc/util":170,"../webrtc/util/sdp":172,"./browserdetection":123}],146:[function(require,module,exports){
|
|
24448
24653
|
'use strict';
|
|
24449
24654
|
/**
|
|
24450
24655
|
* A {@link Timeout} represents a resettable and clearable timeout.
|
|
@@ -24539,7 +24744,7 @@ var Timeout = /** @class */ (function () {
|
|
|
24539
24744
|
}());
|
|
24540
24745
|
module.exports = Timeout;
|
|
24541
24746
|
|
|
24542
|
-
},{}],
|
|
24747
|
+
},{}],147:[function(require,module,exports){
|
|
24543
24748
|
// NOTE: Do not edit this file. This code is auto-generated. Contact the
|
|
24544
24749
|
// Twilio SDK Team for more information.
|
|
24545
24750
|
'use strict';
|
|
@@ -25563,7 +25768,7 @@ var ConfigurationAcquireTurnFailedError = /** @class */ (function (_super) {
|
|
|
25563
25768
|
exports.ConfigurationAcquireTurnFailedError = ConfigurationAcquireTurnFailedError;
|
|
25564
25769
|
Object.defineProperty(TwilioErrorByCode, 53501, { value: ConfigurationAcquireTurnFailedError });
|
|
25565
25770
|
|
|
25566
|
-
},{"./twilioerror":
|
|
25771
|
+
},{"./twilioerror":148}],148:[function(require,module,exports){
|
|
25567
25772
|
'use strict';
|
|
25568
25773
|
var __extends = (this && this.__extends) || (function () {
|
|
25569
25774
|
var extendStatics = function (d, b) {
|
|
@@ -25645,7 +25850,7 @@ var TwilioError = /** @class */ (function (_super) {
|
|
|
25645
25850
|
}(Error));
|
|
25646
25851
|
module.exports = TwilioError;
|
|
25647
25852
|
|
|
25648
|
-
},{}],
|
|
25853
|
+
},{}],149:[function(require,module,exports){
|
|
25649
25854
|
'use strict';
|
|
25650
25855
|
/**
|
|
25651
25856
|
* @private
|
|
@@ -25658,7 +25863,7 @@ var TwilioWarning = {
|
|
|
25658
25863
|
};
|
|
25659
25864
|
module.exports = TwilioWarning;
|
|
25660
25865
|
|
|
25661
|
-
},{}],
|
|
25866
|
+
},{}],150:[function(require,module,exports){
|
|
25662
25867
|
'use strict';
|
|
25663
25868
|
var isNonArrayObject = require('./').isNonArrayObject;
|
|
25664
25869
|
var _a = require('./constants'), E = _a.typeErrors, clientTrackSwitchOffControl = _a.clientTrackSwitchOffControl, videoContentPreferencesMode = _a.videoContentPreferencesMode, subscriptionMode = _a.subscriptionMode, trackPriority = _a.trackPriority, trackSwitchOffMode = _a.trackSwitchOffMode;
|
|
@@ -25775,7 +25980,7 @@ exports.validateBandwidthProfile = validateBandwidthProfile;
|
|
|
25775
25980
|
exports.validateLocalTrack = validateLocalTrack;
|
|
25776
25981
|
exports.validateObject = validateObject;
|
|
25777
25982
|
|
|
25778
|
-
},{"./":
|
|
25983
|
+
},{"./":132,"./constants":125}],151:[function(require,module,exports){
|
|
25779
25984
|
/**
|
|
25780
25985
|
* Copyright (c) 2011-2022 Isaac Z. Schlueter
|
|
25781
25986
|
* Licensed under the ISC License.
|
|
@@ -25810,7 +26015,7 @@ module.exports = function inherits(ctor, superCtor) {
|
|
|
25810
26015
|
}
|
|
25811
26016
|
};
|
|
25812
26017
|
|
|
25813
|
-
},{}],
|
|
26018
|
+
},{}],152:[function(require,module,exports){
|
|
25814
26019
|
/**
|
|
25815
26020
|
* Copyright (c) 2013 Tim Perry
|
|
25816
26021
|
* Licensed under the MIT license.
|
|
@@ -26050,7 +26255,7 @@ defaultLogger.getLoggers = function getLoggers() {
|
|
|
26050
26255
|
defaultLogger['default'] = defaultLogger;
|
|
26051
26256
|
module.exports = defaultLogger;
|
|
26052
26257
|
|
|
26053
|
-
},{}],
|
|
26258
|
+
},{}],153:[function(require,module,exports){
|
|
26054
26259
|
/* globals webkitAudioContext, AudioContext */
|
|
26055
26260
|
'use strict';
|
|
26056
26261
|
var NativeAudioContext = typeof AudioContext !== 'undefined'
|
|
@@ -26133,7 +26338,7 @@ var AudioContextFactory = /** @class */ (function () {
|
|
|
26133
26338
|
}());
|
|
26134
26339
|
module.exports = new AudioContextFactory();
|
|
26135
26340
|
|
|
26136
|
-
},{}],
|
|
26341
|
+
},{}],154:[function(require,module,exports){
|
|
26137
26342
|
'use strict';
|
|
26138
26343
|
/**
|
|
26139
26344
|
* Return a Promise that resolves after `timeout` milliseconds.
|
|
@@ -26186,7 +26391,7 @@ function detectSilence(audioContext, stream, timeout) {
|
|
|
26186
26391
|
}
|
|
26187
26392
|
module.exports = detectSilence;
|
|
26188
26393
|
|
|
26189
|
-
},{}],
|
|
26394
|
+
},{}],155:[function(require,module,exports){
|
|
26190
26395
|
'use strict';
|
|
26191
26396
|
var detectSilence = require('./detectsilence');
|
|
26192
26397
|
/**
|
|
@@ -26256,11 +26461,25 @@ to get a new one, but we\'ve run out of retries; returning it anyway.');
|
|
|
26256
26461
|
}
|
|
26257
26462
|
module.exports = workaround;
|
|
26258
26463
|
|
|
26259
|
-
},{"./audiocontext":
|
|
26464
|
+
},{"./audiocontext":153,"./detectsilence":154}],156:[function(require,module,exports){
|
|
26260
26465
|
'use strict';
|
|
26261
|
-
var
|
|
26262
|
-
var
|
|
26263
|
-
|
|
26466
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26467
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26468
|
+
if (!m) return o;
|
|
26469
|
+
var i = m.call(o), r, ar = [], e;
|
|
26470
|
+
try {
|
|
26471
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
26472
|
+
}
|
|
26473
|
+
catch (error) { e = { error: error }; }
|
|
26474
|
+
finally {
|
|
26475
|
+
try {
|
|
26476
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
26477
|
+
}
|
|
26478
|
+
finally { if (e) throw e.error; }
|
|
26479
|
+
}
|
|
26480
|
+
return ar;
|
|
26481
|
+
};
|
|
26482
|
+
var _a = require('./util'), flatMap = _a.flatMap, guessBrowser = _a.guessBrowser, guessBrowserVersion = _a.guessBrowserVersion;
|
|
26264
26483
|
var getSdpFormat = require('./util/sdp').getSdpFormat;
|
|
26265
26484
|
var guess = guessBrowser();
|
|
26266
26485
|
var guessVersion = guessBrowserVersion();
|
|
@@ -26304,10 +26523,8 @@ function _getStats(peerConnection, options) {
|
|
|
26304
26523
|
[localVideoTracks, 'localVideoTrackStats', false],
|
|
26305
26524
|
[remoteAudioTracks, 'remoteAudioTrackStats', true],
|
|
26306
26525
|
[remoteVideoTracks, 'remoteVideoTrackStats', true]
|
|
26307
|
-
], function (
|
|
26308
|
-
var tracks =
|
|
26309
|
-
var statsArrayName = triple[1];
|
|
26310
|
-
var isRemote = triple[2];
|
|
26526
|
+
], function (_a) {
|
|
26527
|
+
var _b = __read(_a, 3), tracks = _b[0], statsArrayName = _b[1], isRemote = _b[2];
|
|
26311
26528
|
return tracks.map(function (track) {
|
|
26312
26529
|
return getTrackStats(peerConnection, track, Object.assign({
|
|
26313
26530
|
isRemote: isRemote
|
|
@@ -26334,7 +26551,7 @@ function _getStats(peerConnection, options) {
|
|
|
26334
26551
|
* @returns {Promise<StandardizedActiveIceCandidatePairStatsReport>}
|
|
26335
26552
|
*/
|
|
26336
26553
|
function getActiveIceCandidatePairStats(peerConnection, options) {
|
|
26337
|
-
options
|
|
26554
|
+
if (options === void 0) { options = {}; }
|
|
26338
26555
|
if (typeof options.testForChrome !== 'undefined' || isChrome
|
|
26339
26556
|
|| typeof options.testForSafari !== 'undefined' || isSafari) {
|
|
26340
26557
|
return peerConnection.getStats().then(standardizeChromeOrSafariActiveIceCandidatePairStats);
|
|
@@ -26350,8 +26567,9 @@ function getActiveIceCandidatePairStats(peerConnection, options) {
|
|
|
26350
26567
|
* @returns {?StandardizedActiveIceCandidatePairStatsReport}
|
|
26351
26568
|
*/
|
|
26352
26569
|
function standardizeChromeOrSafariActiveIceCandidatePairStats(stats) {
|
|
26353
|
-
var activeCandidatePairStats = Array.from(stats.values()).find(function (
|
|
26354
|
-
|
|
26570
|
+
var activeCandidatePairStats = Array.from(stats.values()).find(function (_a) {
|
|
26571
|
+
var nominated = _a.nominated, type = _a.type;
|
|
26572
|
+
return type === 'candidate-pair' && nominated;
|
|
26355
26573
|
});
|
|
26356
26574
|
if (!activeCandidatePairStats) {
|
|
26357
26575
|
return null;
|
|
@@ -26371,17 +26589,19 @@ function standardizeChromeOrSafariActiveIceCandidatePairStats(stats) {
|
|
|
26371
26589
|
{ key: 'relayProtocol', type: 'string' }
|
|
26372
26590
|
]);
|
|
26373
26591
|
var standatdizedLocalCandidateStatsReport = activeLocalCandidateStats
|
|
26374
|
-
? standardizedLocalCandidateStatsKeys.reduce(function (report,
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
|
|
26592
|
+
? standardizedLocalCandidateStatsKeys.reduce(function (report, _a) {
|
|
26593
|
+
var key = _a.key, type = _a.type;
|
|
26594
|
+
report[key] = typeof activeLocalCandidateStats[key] === type
|
|
26595
|
+
? activeLocalCandidateStats[key]
|
|
26596
|
+
: key === 'deleted' ? false : null;
|
|
26378
26597
|
return report;
|
|
26379
26598
|
}, {})
|
|
26380
26599
|
: null;
|
|
26381
26600
|
var standardizedRemoteCandidateStatsReport = activeRemoteCandidateStats
|
|
26382
|
-
? standardizedCandidateStatsKeys.reduce(function (report,
|
|
26383
|
-
|
|
26384
|
-
|
|
26601
|
+
? standardizedCandidateStatsKeys.reduce(function (report, _a) {
|
|
26602
|
+
var key = _a.key, type = _a.type;
|
|
26603
|
+
report[key] = typeof activeRemoteCandidateStats[key] === type
|
|
26604
|
+
? activeRemoteCandidateStats[key]
|
|
26385
26605
|
: null;
|
|
26386
26606
|
return report;
|
|
26387
26607
|
}, {})
|
|
@@ -26408,9 +26628,10 @@ function standardizeChromeOrSafariActiveIceCandidatePairStats(stats) {
|
|
|
26408
26628
|
{ key: 'totalRoundTripTime', type: 'number' },
|
|
26409
26629
|
{ key: 'transportId', type: 'string' },
|
|
26410
26630
|
{ key: 'writable', type: 'boolean' }
|
|
26411
|
-
].reduce(function (report,
|
|
26412
|
-
|
|
26413
|
-
|
|
26631
|
+
].reduce(function (report, _a) {
|
|
26632
|
+
var key = _a.key, type = _a.type, fixup = _a.fixup;
|
|
26633
|
+
report[key] = typeof activeCandidatePairStats[key] === type
|
|
26634
|
+
? (fixup ? fixup(activeCandidatePairStats[key]) : activeCandidatePairStats[key])
|
|
26414
26635
|
: null;
|
|
26415
26636
|
return report;
|
|
26416
26637
|
}, {
|
|
@@ -26424,8 +26645,9 @@ function standardizeChromeOrSafariActiveIceCandidatePairStats(stats) {
|
|
|
26424
26645
|
* @returns {?StandardizedActiveIceCandidatePairStatsReport}
|
|
26425
26646
|
*/
|
|
26426
26647
|
function standardizeFirefoxActiveIceCandidatePairStats(stats) {
|
|
26427
|
-
var activeCandidatePairStats = Array.from(stats.values()).find(function (
|
|
26428
|
-
|
|
26648
|
+
var activeCandidatePairStats = Array.from(stats.values()).find(function (_a) {
|
|
26649
|
+
var nominated = _a.nominated, type = _a.type;
|
|
26650
|
+
return type === 'candidate-pair' && nominated;
|
|
26429
26651
|
});
|
|
26430
26652
|
if (!activeCandidatePairStats) {
|
|
26431
26653
|
return null;
|
|
@@ -26451,27 +26673,25 @@ function standardizeFirefoxActiveIceCandidatePairStats(stats) {
|
|
|
26451
26673
|
serverreflexive: 'srflx'
|
|
26452
26674
|
};
|
|
26453
26675
|
var standatdizedLocalCandidateStatsReport = activeLocalCandidateStats
|
|
26454
|
-
? standardizedLocalCandidateStatsKeys.reduce(function (report,
|
|
26455
|
-
var
|
|
26456
|
-
|
|
26457
|
-
|
|
26458
|
-
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
|
|
26462
|
-
: key === 'deleted' ? false : null;
|
|
26676
|
+
? standardizedLocalCandidateStatsKeys.reduce(function (report, _a) {
|
|
26677
|
+
var ffKeys = _a.ffKeys, key = _a.key, type = _a.type;
|
|
26678
|
+
var localStatKey = ffKeys && ffKeys.find(function (key) { return key in activeLocalCandidateStats; }) || key;
|
|
26679
|
+
report[key] = typeof activeLocalCandidateStats[localStatKey] === type
|
|
26680
|
+
? localStatKey === 'candidateType'
|
|
26681
|
+
? candidateTypes[activeLocalCandidateStats[localStatKey]] || activeLocalCandidateStats[localStatKey]
|
|
26682
|
+
: activeLocalCandidateStats[localStatKey]
|
|
26683
|
+
: localStatKey === 'deleted' ? false : null;
|
|
26463
26684
|
return report;
|
|
26464
26685
|
}, {})
|
|
26465
26686
|
: null;
|
|
26466
26687
|
var standardizedRemoteCandidateStatsReport = activeRemoteCandidateStats
|
|
26467
|
-
? standardizedCandidateStatsKeys.reduce(function (report,
|
|
26468
|
-
var
|
|
26469
|
-
|
|
26470
|
-
|
|
26471
|
-
|
|
26472
|
-
|
|
26473
|
-
|
|
26474
|
-
: activeRemoteCandidateStats[key]
|
|
26688
|
+
? standardizedCandidateStatsKeys.reduce(function (report, _a) {
|
|
26689
|
+
var ffKeys = _a.ffKeys, key = _a.key, type = _a.type;
|
|
26690
|
+
var remoteStatKey = ffKeys && ffKeys.find(function (key) { return key in activeRemoteCandidateStats; }) || key;
|
|
26691
|
+
report[key] = typeof activeRemoteCandidateStats[remoteStatKey] === type
|
|
26692
|
+
? remoteStatKey === 'candidateType'
|
|
26693
|
+
? candidateTypes[activeRemoteCandidateStats[remoteStatKey]] || activeRemoteCandidateStats[remoteStatKey]
|
|
26694
|
+
: activeRemoteCandidateStats[remoteStatKey]
|
|
26475
26695
|
: null;
|
|
26476
26696
|
return report;
|
|
26477
26697
|
}, {})
|
|
@@ -26498,9 +26718,10 @@ function standardizeFirefoxActiveIceCandidatePairStats(stats) {
|
|
|
26498
26718
|
{ key: 'totalRoundTripTime', type: 'number' },
|
|
26499
26719
|
{ key: 'transportId', type: 'string' },
|
|
26500
26720
|
{ key: 'writable', type: 'boolean' }
|
|
26501
|
-
].reduce(function (report,
|
|
26502
|
-
|
|
26503
|
-
|
|
26721
|
+
].reduce(function (report, _a) {
|
|
26722
|
+
var key = _a.key, type = _a.type;
|
|
26723
|
+
report[key] = typeof activeCandidatePairStats[key] === type
|
|
26724
|
+
? activeCandidatePairStats[key]
|
|
26504
26725
|
: null;
|
|
26505
26726
|
return report;
|
|
26506
26727
|
}, {
|
|
@@ -26518,17 +26739,16 @@ function standardizeFirefoxActiveIceCandidatePairStats(stats) {
|
|
|
26518
26739
|
function getTracks(peerConnection, kind, localOrRemote) {
|
|
26519
26740
|
var getSendersOrReceivers = localOrRemote === 'local' ? 'getSenders' : 'getReceivers';
|
|
26520
26741
|
if (peerConnection[getSendersOrReceivers]) {
|
|
26521
|
-
return peerConnection[getSendersOrReceivers]()
|
|
26522
|
-
|
|
26523
|
-
|
|
26524
|
-
return track
|
|
26525
|
-
})
|
|
26742
|
+
return peerConnection[getSendersOrReceivers]()
|
|
26743
|
+
.map(function (_a) {
|
|
26744
|
+
var track = _a.track;
|
|
26745
|
+
return track;
|
|
26746
|
+
})
|
|
26747
|
+
.filter(function (track) { return track && track.kind === kind; });
|
|
26526
26748
|
}
|
|
26527
26749
|
var getStreams = localOrRemote === 'local' ? 'getLocalStreams' : 'getRemoteStreams';
|
|
26528
|
-
|
|
26529
|
-
|
|
26530
|
-
return stream[getTracks]();
|
|
26531
|
-
});
|
|
26750
|
+
var getTracks = kind === 'audio' ? 'getAudioTracks' : 'getVideoTracks';
|
|
26751
|
+
return flatMap(peerConnection[getStreams](), function (stream) { return stream[getTracks](); });
|
|
26532
26752
|
}
|
|
26533
26753
|
/**
|
|
26534
26754
|
* Get the standardized statistics for a particular MediaStreamTrack.
|
|
@@ -26538,7 +26758,7 @@ function getTracks(peerConnection, kind, localOrRemote) {
|
|
|
26538
26758
|
* @returns {Promise.<Array<StandardizedTrackStatsReport>>}
|
|
26539
26759
|
*/
|
|
26540
26760
|
function getTrackStats(peerConnection, track, options) {
|
|
26541
|
-
options
|
|
26761
|
+
if (options === void 0) { options = {}; }
|
|
26542
26762
|
if (typeof options.testForChrome !== 'undefined' || isChrome) {
|
|
26543
26763
|
return chromeOrSafariGetTrackStats(peerConnection, track);
|
|
26544
26764
|
}
|
|
@@ -26677,7 +26897,8 @@ function standardizeChromeOrSafariStats(response) {
|
|
|
26677
26897
|
var codec = null;
|
|
26678
26898
|
var localMedia = null;
|
|
26679
26899
|
response.forEach(function (stat) {
|
|
26680
|
-
|
|
26900
|
+
var type = stat.type;
|
|
26901
|
+
switch (type) {
|
|
26681
26902
|
case 'inbound-rtp':
|
|
26682
26903
|
inbound = stat;
|
|
26683
26904
|
break;
|
|
@@ -26842,7 +27063,7 @@ function standardizeFirefoxStats(response, isRemote) {
|
|
|
26842
27063
|
//
|
|
26843
27064
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1377225
|
|
26844
27065
|
//
|
|
26845
|
-
response
|
|
27066
|
+
if (response === void 0) { response = new Map(); }
|
|
26846
27067
|
var inbound = null;
|
|
26847
27068
|
var outbound = null;
|
|
26848
27069
|
// NOTE(mmalavalli): Starting from Firefox 63, RTC{Inbound, Outbound}RTPStreamStats.isRemote
|
|
@@ -26855,17 +27076,18 @@ function standardizeFirefoxStats(response, isRemote) {
|
|
|
26855
27076
|
// Source: https://blog.mozilla.org/webrtc/getstats-isremote-65/
|
|
26856
27077
|
//
|
|
26857
27078
|
response.forEach(function (stat) {
|
|
26858
|
-
|
|
27079
|
+
var isRemote = stat.isRemote, remoteId = stat.remoteId, type = stat.type;
|
|
27080
|
+
if (isRemote) {
|
|
26859
27081
|
return;
|
|
26860
27082
|
}
|
|
26861
|
-
switch (
|
|
27083
|
+
switch (type) {
|
|
26862
27084
|
case 'inbound-rtp':
|
|
26863
27085
|
inbound = stat;
|
|
26864
|
-
outbound = response.get(
|
|
27086
|
+
outbound = response.get(remoteId);
|
|
26865
27087
|
break;
|
|
26866
27088
|
case 'outbound-rtp':
|
|
26867
27089
|
outbound = stat;
|
|
26868
|
-
inbound = response.get(
|
|
27090
|
+
inbound = response.get(remoteId);
|
|
26869
27091
|
break;
|
|
26870
27092
|
}
|
|
26871
27093
|
});
|
|
@@ -27050,7 +27272,7 @@ function standardizeFirefoxStats(response, isRemote) {
|
|
|
27050
27272
|
*/
|
|
27051
27273
|
module.exports = getStats;
|
|
27052
27274
|
|
|
27053
|
-
},{"./util":170,"./util/sdp":172}],
|
|
27275
|
+
},{"./util":170,"./util/sdp":172}],157:[function(require,module,exports){
|
|
27054
27276
|
/* globals navigator */
|
|
27055
27277
|
'use strict';
|
|
27056
27278
|
/**
|
|
@@ -27064,17 +27286,17 @@ module.exports = getStats;
|
|
|
27064
27286
|
* @returns Promise<MediaStream>
|
|
27065
27287
|
*/
|
|
27066
27288
|
function getUserMedia(constraints) {
|
|
27289
|
+
if (constraints === void 0) { constraints = { audio: true, video: true }; }
|
|
27067
27290
|
if (typeof navigator === 'object'
|
|
27068
27291
|
&& typeof navigator.mediaDevices === 'object'
|
|
27069
27292
|
&& typeof navigator.mediaDevices.getUserMedia === 'function') {
|
|
27070
|
-
constraints = constraints || { audio: true, video: true };
|
|
27071
27293
|
return navigator.mediaDevices.getUserMedia(constraints);
|
|
27072
27294
|
}
|
|
27073
27295
|
return Promise.reject(new Error('getUserMedia is not supported'));
|
|
27074
27296
|
}
|
|
27075
27297
|
module.exports = getUserMedia;
|
|
27076
27298
|
|
|
27077
|
-
},{}],
|
|
27299
|
+
},{}],158:[function(require,module,exports){
|
|
27078
27300
|
'use strict';
|
|
27079
27301
|
var WebRTC = {};
|
|
27080
27302
|
Object.defineProperties(WebRTC, {
|
|
@@ -27109,7 +27331,7 @@ Object.defineProperties(WebRTC, {
|
|
|
27109
27331
|
});
|
|
27110
27332
|
module.exports = WebRTC;
|
|
27111
27333
|
|
|
27112
|
-
},{"./getstats":
|
|
27334
|
+
},{"./getstats":156,"./getusermedia":157,"./mediastream":159,"./mediastreamtrack":160,"./rtcicecandidate":161,"./rtcpeerconnection":164,"./rtcsessiondescription":169}],159:[function(require,module,exports){
|
|
27113
27335
|
/* globals MediaStream */
|
|
27114
27336
|
'use strict';
|
|
27115
27337
|
if (typeof MediaStream === 'function') {
|
|
@@ -27121,7 +27343,7 @@ else {
|
|
|
27121
27343
|
};
|
|
27122
27344
|
}
|
|
27123
27345
|
|
|
27124
|
-
},{}],
|
|
27346
|
+
},{}],160:[function(require,module,exports){
|
|
27125
27347
|
/* global MediaStreamTrack */
|
|
27126
27348
|
'use strict';
|
|
27127
27349
|
if (typeof MediaStreamTrack === 'function') {
|
|
@@ -27133,7 +27355,7 @@ else {
|
|
|
27133
27355
|
};
|
|
27134
27356
|
}
|
|
27135
27357
|
|
|
27136
|
-
},{}],
|
|
27358
|
+
},{}],161:[function(require,module,exports){
|
|
27137
27359
|
/* global RTCIceCandidate */
|
|
27138
27360
|
'use strict';
|
|
27139
27361
|
if (typeof RTCIceCandidate === 'function') {
|
|
@@ -27145,19 +27367,53 @@ else {
|
|
|
27145
27367
|
};
|
|
27146
27368
|
}
|
|
27147
27369
|
|
|
27148
|
-
},{}],
|
|
27370
|
+
},{}],162:[function(require,module,exports){
|
|
27149
27371
|
/* globals RTCDataChannel, RTCPeerConnection, RTCSessionDescription */
|
|
27150
27372
|
'use strict';
|
|
27373
|
+
var __extends = (this && this.__extends) || (function () {
|
|
27374
|
+
var extendStatics = function (d, b) {
|
|
27375
|
+
extendStatics = Object.setPrototypeOf ||
|
|
27376
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
27377
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27378
|
+
return extendStatics(d, b);
|
|
27379
|
+
};
|
|
27380
|
+
return function (d, b) {
|
|
27381
|
+
if (typeof b !== "function" && b !== null)
|
|
27382
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
27383
|
+
extendStatics(d, b);
|
|
27384
|
+
function __() { this.constructor = d; }
|
|
27385
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
27386
|
+
};
|
|
27387
|
+
})();
|
|
27388
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
27389
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27390
|
+
if (!m) return o;
|
|
27391
|
+
var i = m.call(o), r, ar = [], e;
|
|
27392
|
+
try {
|
|
27393
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27394
|
+
}
|
|
27395
|
+
catch (error) { e = { error: error }; }
|
|
27396
|
+
finally {
|
|
27397
|
+
try {
|
|
27398
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
27399
|
+
}
|
|
27400
|
+
finally { if (e) throw e.error; }
|
|
27401
|
+
}
|
|
27402
|
+
return ar;
|
|
27403
|
+
};
|
|
27404
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
27405
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
27406
|
+
to[j] = from[i];
|
|
27407
|
+
return to;
|
|
27408
|
+
};
|
|
27151
27409
|
var ChromeRTCSessionDescription = require('../rtcsessiondescription/chrome');
|
|
27152
|
-
var EventTarget = require('
|
|
27153
|
-
var inherits = require('../../vendor/inherits');
|
|
27410
|
+
var EventTarget = require('../../eventtarget');
|
|
27154
27411
|
var Latch = require('../util/latch');
|
|
27155
27412
|
var MediaStream = require('../mediastream');
|
|
27156
27413
|
var RTCRtpSenderShim = require('../rtcrtpsender');
|
|
27157
|
-
var
|
|
27158
|
-
var
|
|
27159
|
-
var
|
|
27160
|
-
var isUnifiedPlan = sdpUtils.getSdpFormat() === 'unified';
|
|
27414
|
+
var _a = require('../util/sdp'), getSdpFormat = _a.getSdpFormat, updatePlanBTrackIdsToSSRCs = _a.updatePlanBTrackIdsToSSRCs, updateUnifiedPlanTrackIdsToSSRCs = _a.updateUnifiedPlanTrackIdsToSSRCs;
|
|
27415
|
+
var _b = require('../util'), delegateMethods = _b.delegateMethods, interceptEvent = _b.interceptEvent, isIOSChrome = _b.isIOSChrome, legacyPromise = _b.legacyPromise, proxyProperties = _b.proxyProperties;
|
|
27416
|
+
var isUnifiedPlan = getSdpFormat() === 'unified';
|
|
27161
27417
|
// NOTE(mroberts): This class wraps Chrome's RTCPeerConnection implementation.
|
|
27162
27418
|
// It provides some functionality not currently present in Chrome, namely the
|
|
27163
27419
|
// abilities to
|
|
@@ -27169,119 +27425,127 @@ var isUnifiedPlan = sdpUtils.getSdpFormat() === 'unified';
|
|
|
27169
27425
|
//
|
|
27170
27426
|
// 3. Set iceTransportPolicy.
|
|
27171
27427
|
//
|
|
27172
|
-
|
|
27173
|
-
|
|
27174
|
-
|
|
27175
|
-
|
|
27176
|
-
|
|
27177
|
-
|
|
27178
|
-
|
|
27179
|
-
|
|
27180
|
-
|
|
27181
|
-
|
|
27182
|
-
|
|
27183
|
-
|
|
27184
|
-
|
|
27185
|
-
|
|
27186
|
-
|
|
27187
|
-
|
|
27188
|
-
|
|
27189
|
-
|
|
27190
|
-
|
|
27191
|
-
|
|
27192
|
-
|
|
27193
|
-
|
|
27194
|
-
|
|
27195
|
-
|
|
27196
|
-
|
|
27197
|
-
|
|
27198
|
-
|
|
27199
|
-
|
|
27200
|
-
|
|
27201
|
-
|
|
27202
|
-
|
|
27203
|
-
|
|
27204
|
-
|
|
27205
|
-
|
|
27206
|
-
|
|
27207
|
-
|
|
27208
|
-
|
|
27209
|
-
|
|
27210
|
-
|
|
27211
|
-
|
|
27212
|
-
|
|
27213
|
-
|
|
27214
|
-
|
|
27215
|
-
|
|
27216
|
-
|
|
27217
|
-
|
|
27218
|
-
|
|
27219
|
-
writable: true
|
|
27220
|
-
},
|
|
27221
|
-
localDescription: {
|
|
27222
|
-
enumerable: true,
|
|
27223
|
-
get: function () {
|
|
27224
|
-
return this._pendingLocalOffer ? this._pendingLocalOffer : peerConnection.localDescription;
|
|
27428
|
+
var ChromeRTCPeerConnection = /** @class */ (function (_super) {
|
|
27429
|
+
__extends(ChromeRTCPeerConnection, _super);
|
|
27430
|
+
function ChromeRTCPeerConnection(configuration, constraints) {
|
|
27431
|
+
if (configuration === void 0) { configuration = {}; }
|
|
27432
|
+
var _this = _super.call(this) || this;
|
|
27433
|
+
var newConfiguration = Object.assign(configuration.iceTransportPolicy
|
|
27434
|
+
? { iceTransports: configuration.iceTransportPolicy }
|
|
27435
|
+
: {}, configuration);
|
|
27436
|
+
interceptEvent(_this, 'datachannel');
|
|
27437
|
+
interceptEvent(_this, 'signalingstatechange');
|
|
27438
|
+
var sdpFormat = getSdpFormat(newConfiguration.sdpSemantics);
|
|
27439
|
+
var peerConnection = new RTCPeerConnection(newConfiguration, constraints);
|
|
27440
|
+
Object.defineProperties(_this, {
|
|
27441
|
+
_appliedTracksToSSRCs: {
|
|
27442
|
+
value: new Map(),
|
|
27443
|
+
writable: true
|
|
27444
|
+
},
|
|
27445
|
+
_localStream: {
|
|
27446
|
+
value: new MediaStream()
|
|
27447
|
+
},
|
|
27448
|
+
_peerConnection: {
|
|
27449
|
+
value: peerConnection
|
|
27450
|
+
},
|
|
27451
|
+
_pendingLocalOffer: {
|
|
27452
|
+
value: null,
|
|
27453
|
+
writable: true
|
|
27454
|
+
},
|
|
27455
|
+
_pendingRemoteOffer: {
|
|
27456
|
+
value: null,
|
|
27457
|
+
writable: true
|
|
27458
|
+
},
|
|
27459
|
+
_rolledBackTracksToSSRCs: {
|
|
27460
|
+
value: new Map(),
|
|
27461
|
+
writable: true
|
|
27462
|
+
},
|
|
27463
|
+
_sdpFormat: {
|
|
27464
|
+
value: sdpFormat
|
|
27465
|
+
},
|
|
27466
|
+
_senders: {
|
|
27467
|
+
value: new Map()
|
|
27468
|
+
},
|
|
27469
|
+
_signalingStateLatch: {
|
|
27470
|
+
value: new Latch()
|
|
27471
|
+
},
|
|
27472
|
+
_tracksToSSRCs: {
|
|
27473
|
+
value: new Map(),
|
|
27474
|
+
writable: true
|
|
27225
27475
|
}
|
|
27226
|
-
}
|
|
27227
|
-
|
|
27228
|
-
|
|
27229
|
-
|
|
27230
|
-
|
|
27476
|
+
});
|
|
27477
|
+
peerConnection.addEventListener('datachannel', function (event) {
|
|
27478
|
+
shimDataChannel(event.channel);
|
|
27479
|
+
_this.dispatchEvent(event);
|
|
27480
|
+
});
|
|
27481
|
+
peerConnection.addEventListener('signalingstatechange', function () {
|
|
27482
|
+
var args = [];
|
|
27483
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27484
|
+
args[_i] = arguments[_i];
|
|
27231
27485
|
}
|
|
27232
|
-
|
|
27233
|
-
|
|
27234
|
-
enumerable: true,
|
|
27235
|
-
get: function () {
|
|
27236
|
-
if (this._pendingLocalOffer) {
|
|
27237
|
-
return 'have-local-offer';
|
|
27238
|
-
}
|
|
27239
|
-
else if (this._pendingRemoteOffer) {
|
|
27240
|
-
return 'have-remote-offer';
|
|
27241
|
-
}
|
|
27242
|
-
return peerConnection.signalingState;
|
|
27486
|
+
if (peerConnection.signalingState === 'stable') {
|
|
27487
|
+
_this._appliedTracksToSSRCs = new Map(_this._tracksToSSRCs);
|
|
27243
27488
|
}
|
|
27489
|
+
if (!_this._pendingLocalOffer && !_this._pendingRemoteOffer) {
|
|
27490
|
+
_this.dispatchEvent.apply(_this, __spreadArray([], __read(args)));
|
|
27491
|
+
}
|
|
27492
|
+
});
|
|
27493
|
+
peerConnection.ontrack = function () {
|
|
27494
|
+
// NOTE(mroberts): adapter.js's "track" event shim only kicks off if we set
|
|
27495
|
+
// the ontrack property of the RTCPeerConnection.
|
|
27496
|
+
};
|
|
27497
|
+
if (typeof peerConnection.addTrack !== 'function') {
|
|
27498
|
+
peerConnection.addStream(_this._localStream);
|
|
27244
27499
|
}
|
|
27500
|
+
proxyProperties(RTCPeerConnection.prototype, _this, peerConnection);
|
|
27501
|
+
return _this;
|
|
27502
|
+
}
|
|
27503
|
+
Object.defineProperty(ChromeRTCPeerConnection.prototype, "localDescription", {
|
|
27504
|
+
get: function () {
|
|
27505
|
+
return this._pendingLocalOffer ? this._pendingLocalOffer : this._peerConnection.localDescription;
|
|
27506
|
+
},
|
|
27507
|
+
enumerable: false,
|
|
27508
|
+
configurable: true
|
|
27245
27509
|
});
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
27249
|
-
|
|
27510
|
+
Object.defineProperty(ChromeRTCPeerConnection.prototype, "remoteDescription", {
|
|
27511
|
+
get: function () {
|
|
27512
|
+
return this._pendingRemoteOffer ? this._pendingRemoteOffer : this._peerConnection.remoteDescription;
|
|
27513
|
+
},
|
|
27514
|
+
enumerable: false,
|
|
27515
|
+
configurable: true
|
|
27250
27516
|
});
|
|
27251
|
-
|
|
27252
|
-
|
|
27253
|
-
|
|
27254
|
-
|
|
27255
|
-
|
|
27256
|
-
|
|
27257
|
-
|
|
27517
|
+
Object.defineProperty(ChromeRTCPeerConnection.prototype, "signalingState", {
|
|
27518
|
+
get: function () {
|
|
27519
|
+
if (this._pendingLocalOffer) {
|
|
27520
|
+
return 'have-local-offer';
|
|
27521
|
+
}
|
|
27522
|
+
else if (this._pendingRemoteOffer) {
|
|
27523
|
+
return 'have-remote-offer';
|
|
27524
|
+
}
|
|
27525
|
+
return this._peerConnection.signalingState;
|
|
27526
|
+
},
|
|
27527
|
+
enumerable: false,
|
|
27528
|
+
configurable: true
|
|
27258
27529
|
});
|
|
27259
|
-
peerConnection.ontrack = function ontrack() {
|
|
27260
|
-
// NOTE(mroberts): adapter.js's "track" event shim only kicks off if we set
|
|
27261
|
-
// the ontrack property of the RTCPeerConnection.
|
|
27262
|
-
};
|
|
27263
|
-
if (typeof RTCPeerConnection.prototype.addTrack !== 'function') {
|
|
27264
|
-
peerConnection.addStream(this._localStream);
|
|
27265
|
-
}
|
|
27266
|
-
util.proxyProperties(RTCPeerConnection.prototype, this, peerConnection);
|
|
27267
|
-
}
|
|
27268
|
-
inherits(ChromeRTCPeerConnection, EventTarget);
|
|
27269
|
-
if (typeof RTCPeerConnection.prototype.addTrack !== 'function') {
|
|
27270
27530
|
// NOTE(mmalavalli): This shim supports our limited case of adding
|
|
27271
27531
|
// all MediaStreamTracks to one MediaStream. It has been implemented this
|
|
27272
27532
|
// keeping in mind that this is to be maintained only until "addTrack" is
|
|
27273
27533
|
// supported natively in Chrome.
|
|
27274
|
-
ChromeRTCPeerConnection.prototype.addTrack = function
|
|
27275
|
-
var
|
|
27276
|
-
var
|
|
27534
|
+
ChromeRTCPeerConnection.prototype.addTrack = function (track) {
|
|
27535
|
+
var _a;
|
|
27536
|
+
var rest = [];
|
|
27537
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
27538
|
+
rest[_i - 1] = arguments[_i];
|
|
27539
|
+
}
|
|
27540
|
+
if (typeof this._peerConnection.addTrack === 'function') {
|
|
27541
|
+
return (_a = this._peerConnection).addTrack.apply(_a, __spreadArray([track], __read(rest)));
|
|
27542
|
+
}
|
|
27277
27543
|
if (this._peerConnection.signalingState === 'closed') {
|
|
27278
|
-
throw new Error(
|
|
27279
|
-
+ track.kind + ']: RTCPeerConnection is closed');
|
|
27544
|
+
throw new Error("Cannot add MediaStreamTrack [" + track.id + ", \n " + track.kind + "]: RTCPeerConnection is closed");
|
|
27280
27545
|
}
|
|
27281
27546
|
var sender = this._senders.get(track);
|
|
27282
27547
|
if (sender && sender.track) {
|
|
27283
|
-
throw new Error(
|
|
27284
|
-
+ track.kind + ']: RTCPeerConnection already has it');
|
|
27548
|
+
throw new Error("Cannot add MediaStreamTrack ['" + track.id + ", \n " + track.kind + "]: RTCPeerConnection already has it");
|
|
27285
27549
|
}
|
|
27286
27550
|
this._peerConnection.removeStream(this._localStream);
|
|
27287
27551
|
this._localStream.addTrack(track);
|
|
@@ -27294,192 +27558,207 @@ if (typeof RTCPeerConnection.prototype.addTrack !== 'function') {
|
|
|
27294
27558
|
// MediaStreamTracks from one MediaStream. It has been implemented this
|
|
27295
27559
|
// keeping in mind that this is to be maintained only until "removeTrack" is
|
|
27296
27560
|
// supported natively in Chrome.
|
|
27297
|
-
ChromeRTCPeerConnection.prototype.removeTrack = function
|
|
27561
|
+
ChromeRTCPeerConnection.prototype.removeTrack = function (sender) {
|
|
27298
27562
|
if (this._peerConnection.signalingState === 'closed') {
|
|
27299
27563
|
throw new Error('Cannot remove MediaStreamTrack: RTCPeerConnection is closed');
|
|
27300
27564
|
}
|
|
27301
|
-
|
|
27302
|
-
|
|
27303
|
-
|
|
27565
|
+
if (typeof this._peerConnection.addTrack === 'function') {
|
|
27566
|
+
try {
|
|
27567
|
+
return this._peerConnection.removeTrack(sender);
|
|
27568
|
+
}
|
|
27569
|
+
catch (e) {
|
|
27570
|
+
// NOTE(mhuynh): Do nothing. In Chrome, will throw if a 'sender was not
|
|
27571
|
+
// created by this peer connection'. This behavior does not seem to be
|
|
27572
|
+
// spec compliant, so a temporary shim is introduced. A bug has been filed,
|
|
27573
|
+
// and is tracked here:
|
|
27574
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=860853
|
|
27575
|
+
}
|
|
27304
27576
|
}
|
|
27305
|
-
|
|
27306
|
-
|
|
27307
|
-
|
|
27308
|
-
|
|
27309
|
-
|
|
27310
|
-
this.
|
|
27577
|
+
else {
|
|
27578
|
+
var track = sender.track;
|
|
27579
|
+
if (!track) {
|
|
27580
|
+
return;
|
|
27581
|
+
}
|
|
27582
|
+
sender = this._senders.get(track);
|
|
27583
|
+
if (sender && sender.track) {
|
|
27584
|
+
sender.track = null;
|
|
27585
|
+
this._peerConnection.removeStream(this._localStream);
|
|
27586
|
+
this._localStream.removeTrack(track);
|
|
27587
|
+
this._peerConnection.addStream(this._localStream);
|
|
27588
|
+
}
|
|
27311
27589
|
}
|
|
27312
27590
|
};
|
|
27313
|
-
ChromeRTCPeerConnection.prototype.getSenders = function
|
|
27591
|
+
ChromeRTCPeerConnection.prototype.getSenders = function () {
|
|
27592
|
+
if (typeof this._peerConnection.addTrack === 'function') {
|
|
27593
|
+
return this._peerConnection.getSenders();
|
|
27594
|
+
}
|
|
27314
27595
|
return Array.from(this._senders.values());
|
|
27315
27596
|
};
|
|
27316
|
-
|
|
27317
|
-
|
|
27318
|
-
|
|
27319
|
-
|
|
27320
|
-
|
|
27321
|
-
}
|
|
27322
|
-
|
|
27323
|
-
|
|
27597
|
+
ChromeRTCPeerConnection.prototype.addIceCandidate = function (candidate) {
|
|
27598
|
+
var _this = this;
|
|
27599
|
+
var rest = [];
|
|
27600
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
27601
|
+
rest[_i - 1] = arguments[_i];
|
|
27602
|
+
}
|
|
27603
|
+
var promise;
|
|
27604
|
+
if (this.signalingState === 'have-remote-offer') {
|
|
27605
|
+
// NOTE(mroberts): Because the ChromeRTCPeerConnection simulates the
|
|
27606
|
+
// "have-remote-offer" signalingStates, we only want to invoke the true
|
|
27607
|
+
// addIceCandidates method when the remote description has been applied.
|
|
27608
|
+
promise = this._signalingStateLatch.when('low').then(function () {
|
|
27609
|
+
return _this._peerConnection.addIceCandidate(candidate);
|
|
27610
|
+
});
|
|
27324
27611
|
}
|
|
27325
|
-
|
|
27326
|
-
|
|
27327
|
-
|
|
27328
|
-
|
|
27329
|
-
|
|
27330
|
-
|
|
27612
|
+
else {
|
|
27613
|
+
promise = this._peerConnection.addIceCandidate(candidate);
|
|
27614
|
+
}
|
|
27615
|
+
return rest.length > 0
|
|
27616
|
+
? legacyPromise.apply(void 0, __spreadArray([promise], __read(rest))) : promise;
|
|
27617
|
+
};
|
|
27618
|
+
// NOTE(mroberts): The WebRTC spec does not specify that close should throw an
|
|
27619
|
+
// Error; however, in Chrome it does. We workaround this by checking the
|
|
27620
|
+
// signalingState manually.
|
|
27621
|
+
ChromeRTCPeerConnection.prototype.close = function () {
|
|
27622
|
+
if (this.signalingState !== 'closed') {
|
|
27623
|
+
this._pendingLocalOffer = null;
|
|
27624
|
+
this._pendingRemoteOffer = null;
|
|
27625
|
+
this._peerConnection.close();
|
|
27331
27626
|
}
|
|
27332
27627
|
};
|
|
27333
|
-
|
|
27334
|
-
|
|
27335
|
-
|
|
27336
|
-
|
|
27337
|
-
|
|
27338
|
-
|
|
27339
|
-
|
|
27340
|
-
|
|
27341
|
-
|
|
27342
|
-
|
|
27343
|
-
|
|
27344
|
-
}
|
|
27345
|
-
|
|
27346
|
-
|
|
27347
|
-
|
|
27348
|
-
|
|
27349
|
-
|
|
27350
|
-
|
|
27351
|
-
|
|
27352
|
-
|
|
27353
|
-
|
|
27354
|
-
|
|
27355
|
-
//
|
|
27356
|
-
|
|
27357
|
-
|
|
27358
|
-
|
|
27359
|
-
|
|
27360
|
-
|
|
27361
|
-
|
|
27362
|
-
}
|
|
27363
|
-
|
|
27364
|
-
|
|
27365
|
-
// apply the remote description. This means, once you call createAnswer, you
|
|
27366
|
-
// can no longer rollback. This is acceptable for our use case because we will
|
|
27367
|
-
// apply the newly-created answer almost immediately; however, this may be
|
|
27368
|
-
// unacceptable for other use cases.
|
|
27369
|
-
ChromeRTCPeerConnection.prototype.createAnswer = function createAnswer() {
|
|
27370
|
-
var args = [].slice.call(arguments);
|
|
27371
|
-
var promise;
|
|
27372
|
-
var self = this;
|
|
27373
|
-
if (this._pendingRemoteOffer) {
|
|
27374
|
-
promise = this._peerConnection.setRemoteDescription(this._pendingRemoteOffer).then(function setRemoteDescriptionSucceeded() {
|
|
27375
|
-
// NOTE(mroberts): The signalingStates between the ChromeRTCPeerConnection
|
|
27376
|
-
// and the underlying RTCPeerConnection implementation have converged. We
|
|
27377
|
-
// can unblock any pending calls to addIceCandidate now.
|
|
27378
|
-
self._signalingStateLatch.lower();
|
|
27379
|
-
return self._peerConnection.createAnswer();
|
|
27380
|
-
}).then(function createAnswerSucceeded(answer) {
|
|
27381
|
-
self._pendingRemoteOffer = null;
|
|
27382
|
-
// NOTE(mmalavalli): If createAnswer() is called immediately after rolling back, then we no
|
|
27383
|
-
// longer need to retain the rolled back tracks to SSRCs Map.
|
|
27384
|
-
self._rolledBackTracksToSSRCs.clear();
|
|
27385
|
-
return new ChromeRTCSessionDescription({
|
|
27386
|
-
type: 'answer',
|
|
27387
|
-
sdp: updateTrackIdsToSSRCs(self._sdpFormat, self._tracksToSSRCs, answer.sdp)
|
|
27628
|
+
// NOTE(mroberts): Because we workaround Chrome's lack of rollback support by
|
|
27629
|
+
// "faking" setRemoteDescription, we cannot create an answer until we actually
|
|
27630
|
+
// apply the remote description. This means, once you call createAnswer, you
|
|
27631
|
+
// can no longer rollback. This is acceptable for our use case because we will
|
|
27632
|
+
// apply the newly-created answer almost immediately; however, this may be
|
|
27633
|
+
// unacceptable for other use cases.
|
|
27634
|
+
ChromeRTCPeerConnection.prototype.createAnswer = function () {
|
|
27635
|
+
var _this = this;
|
|
27636
|
+
var args = [];
|
|
27637
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27638
|
+
args[_i] = arguments[_i];
|
|
27639
|
+
}
|
|
27640
|
+
var promise;
|
|
27641
|
+
if (this._pendingRemoteOffer) {
|
|
27642
|
+
promise = this._peerConnection.setRemoteDescription(this._pendingRemoteOffer).then(function () {
|
|
27643
|
+
// NOTE(mroberts): The signalingStates between the ChromeRTCPeerConnection
|
|
27644
|
+
// and the underlying RTCPeerConnection implementation have converged. We
|
|
27645
|
+
// can unblock any pending calls to addIceCandidate now.
|
|
27646
|
+
_this._signalingStateLatch.lower();
|
|
27647
|
+
return _this._peerConnection.createAnswer();
|
|
27648
|
+
}).then(function (answer) {
|
|
27649
|
+
_this._pendingRemoteOffer = null;
|
|
27650
|
+
// NOTE(mmalavalli): If createAnswer() is called immediately after rolling back, then we no
|
|
27651
|
+
// longer need to retain the rolled back tracks to SSRCs Map.
|
|
27652
|
+
_this._rolledBackTracksToSSRCs.clear();
|
|
27653
|
+
return new ChromeRTCSessionDescription({
|
|
27654
|
+
type: 'answer',
|
|
27655
|
+
sdp: updateTrackIdsToSSRCs(_this._sdpFormat, _this._tracksToSSRCs, answer.sdp)
|
|
27656
|
+
});
|
|
27657
|
+
}, function (error) {
|
|
27658
|
+
_this._pendingRemoteOffer = null;
|
|
27659
|
+
throw error;
|
|
27388
27660
|
});
|
|
27389
|
-
}
|
|
27390
|
-
|
|
27391
|
-
|
|
27392
|
-
|
|
27393
|
-
|
|
27394
|
-
|
|
27395
|
-
|
|
27396
|
-
|
|
27397
|
-
|
|
27398
|
-
|
|
27399
|
-
return new ChromeRTCSessionDescription({
|
|
27400
|
-
type: 'answer',
|
|
27401
|
-
sdp: updateTrackIdsToSSRCs(self._sdpFormat, self._tracksToSSRCs, answer.sdp)
|
|
27661
|
+
}
|
|
27662
|
+
else {
|
|
27663
|
+
promise = this._peerConnection.createAnswer().then(function (answer) {
|
|
27664
|
+
// NOTE(mmalavalli): If createAnswer() is called immediately after rolling back, then we no
|
|
27665
|
+
// longer need to retain the rolled back tracks to SSRCs Map.
|
|
27666
|
+
_this._rolledBackTracksToSSRCs.clear();
|
|
27667
|
+
return new ChromeRTCSessionDescription({
|
|
27668
|
+
type: 'answer',
|
|
27669
|
+
sdp: updateTrackIdsToSSRCs(_this._sdpFormat, _this._tracksToSSRCs, answer.sdp)
|
|
27670
|
+
});
|
|
27402
27671
|
});
|
|
27403
|
-
});
|
|
27404
|
-
}
|
|
27405
|
-
return args.length > 1
|
|
27406
|
-
? util.legacyPromise(promise, args[0], args[1])
|
|
27407
|
-
: promise;
|
|
27408
|
-
};
|
|
27409
|
-
ChromeRTCPeerConnection.prototype.createOffer = function createOffer() {
|
|
27410
|
-
var args = [].slice.call(arguments);
|
|
27411
|
-
var options = (args.length > 1 ? args[2] : args[0]) || {};
|
|
27412
|
-
var self = this;
|
|
27413
|
-
if (isIOSChrome()) {
|
|
27414
|
-
// NOTE (joma): From SafariRTCPeerConnection in order to support iOS Chrome.
|
|
27415
|
-
if (options.offerToReceiveVideo && !this._audioTransceiver && !(isUnifiedPlan && hasReceiversForTracksOfKind(this, 'audio'))) {
|
|
27416
|
-
delete options.offerToReceiveAudio;
|
|
27417
|
-
try {
|
|
27418
|
-
this._audioTransceiver = isUnifiedPlan
|
|
27419
|
-
? this.addTransceiver('audio', { direction: 'recvonly' })
|
|
27420
|
-
: this.addTransceiver('audio');
|
|
27421
|
-
}
|
|
27422
|
-
catch (e) {
|
|
27423
|
-
return Promise.reject(e);
|
|
27424
|
-
}
|
|
27425
27672
|
}
|
|
27426
|
-
|
|
27427
|
-
|
|
27428
|
-
|
|
27429
|
-
|
|
27430
|
-
|
|
27431
|
-
|
|
27673
|
+
return args.length > 1
|
|
27674
|
+
? legacyPromise.apply(void 0, __spreadArray([promise], __read(args))) : promise;
|
|
27675
|
+
};
|
|
27676
|
+
ChromeRTCPeerConnection.prototype.createOffer = function () {
|
|
27677
|
+
var _this = this;
|
|
27678
|
+
var args = [];
|
|
27679
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27680
|
+
args[_i] = arguments[_i];
|
|
27681
|
+
}
|
|
27682
|
+
var _a = __read(args, 3), arg1 = _a[0], arg2 = _a[1], arg3 = _a[2];
|
|
27683
|
+
var options = arg3 || arg1 || {};
|
|
27684
|
+
if (isIOSChrome()) {
|
|
27685
|
+
// NOTE (joma): From SafariRTCPeerConnection in order to support iOS Chrome.
|
|
27686
|
+
if (options.offerToReceiveVideo && !this._audioTransceiver && !(isUnifiedPlan && hasReceiversForTracksOfKind(this, 'audio'))) {
|
|
27687
|
+
delete options.offerToReceiveAudio;
|
|
27688
|
+
try {
|
|
27689
|
+
this._audioTransceiver = isUnifiedPlan
|
|
27690
|
+
? this.addTransceiver('audio', { direction: 'recvonly' })
|
|
27691
|
+
: this.addTransceiver('audio');
|
|
27692
|
+
}
|
|
27693
|
+
catch (e) {
|
|
27694
|
+
return Promise.reject(e);
|
|
27695
|
+
}
|
|
27432
27696
|
}
|
|
27433
|
-
|
|
27434
|
-
|
|
27697
|
+
if (options.offerToReceiveVideo && !this._videoTransceiver && !(isUnifiedPlan && hasReceiversForTracksOfKind(this, 'video'))) {
|
|
27698
|
+
delete options.offerToReceiveVideo;
|
|
27699
|
+
try {
|
|
27700
|
+
this._videoTransceiver = isUnifiedPlan
|
|
27701
|
+
? this.addTransceiver('video', { direction: 'recvonly' })
|
|
27702
|
+
: this.addTransceiver('video');
|
|
27703
|
+
}
|
|
27704
|
+
catch (e) {
|
|
27705
|
+
return Promise.reject(e);
|
|
27706
|
+
}
|
|
27435
27707
|
}
|
|
27436
27708
|
}
|
|
27437
|
-
|
|
27438
|
-
|
|
27439
|
-
|
|
27440
|
-
|
|
27441
|
-
|
|
27442
|
-
|
|
27443
|
-
|
|
27444
|
-
|
|
27709
|
+
var promise = this._peerConnection.createOffer(options).then(function (offer) {
|
|
27710
|
+
// NOTE(mmalavalli): If createOffer() is called immediately after rolling back, then we no
|
|
27711
|
+
// longer need to retain the rolled back tracks to SSRCs Map.
|
|
27712
|
+
_this._rolledBackTracksToSSRCs.clear();
|
|
27713
|
+
return new ChromeRTCSessionDescription({
|
|
27714
|
+
type: offer.type,
|
|
27715
|
+
sdp: updateTrackIdsToSSRCs(_this._sdpFormat, _this._tracksToSSRCs, offer.sdp)
|
|
27716
|
+
});
|
|
27445
27717
|
});
|
|
27446
|
-
|
|
27447
|
-
|
|
27448
|
-
|
|
27449
|
-
|
|
27450
|
-
|
|
27451
|
-
|
|
27452
|
-
|
|
27453
|
-
|
|
27454
|
-
|
|
27455
|
-
|
|
27456
|
-
|
|
27457
|
-
|
|
27458
|
-
|
|
27459
|
-
|
|
27460
|
-
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27718
|
+
return args.length > 1
|
|
27719
|
+
? legacyPromise(promise, arg1, arg2)
|
|
27720
|
+
: promise;
|
|
27721
|
+
};
|
|
27722
|
+
ChromeRTCPeerConnection.prototype.createDataChannel = function (label, dataChannelDict) {
|
|
27723
|
+
dataChannelDict = shimDataChannelInit(dataChannelDict);
|
|
27724
|
+
var dataChannel = this._peerConnection.createDataChannel(label, dataChannelDict);
|
|
27725
|
+
shimDataChannel(dataChannel);
|
|
27726
|
+
return dataChannel;
|
|
27727
|
+
};
|
|
27728
|
+
ChromeRTCPeerConnection.prototype.setLocalDescription = function () {
|
|
27729
|
+
var args = [];
|
|
27730
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27731
|
+
args[_i] = arguments[_i];
|
|
27732
|
+
}
|
|
27733
|
+
var _a = __read(args, 3), description = _a[0], arg1 = _a[1], arg2 = _a[2];
|
|
27734
|
+
// NOTE(mmalavalli): If setLocalDescription() is called immediately after rolling back,
|
|
27735
|
+
// then we need to restore the rolled back tracks to SSRCs Map.
|
|
27736
|
+
if (this._rolledBackTracksToSSRCs.size > 0) {
|
|
27737
|
+
this._tracksToSSRCs = new Map(this._rolledBackTracksToSSRCs);
|
|
27738
|
+
this._rolledBackTracksToSSRCs.clear();
|
|
27739
|
+
}
|
|
27740
|
+
var promise = setDescription(this, true, description);
|
|
27741
|
+
return args.length > 1
|
|
27742
|
+
? legacyPromise(promise, arg1, arg2)
|
|
27743
|
+
: promise;
|
|
27744
|
+
};
|
|
27745
|
+
ChromeRTCPeerConnection.prototype.setRemoteDescription = function () {
|
|
27746
|
+
var args = [];
|
|
27747
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27748
|
+
args[_i] = arguments[_i];
|
|
27749
|
+
}
|
|
27750
|
+
var _a = __read(args, 3), description = _a[0], arg1 = _a[1], arg2 = _a[2];
|
|
27751
|
+
// NOTE(mmalavalli): If setRemoteDescription() is called immediately after rolling back,
|
|
27752
|
+
// then we no longer need to retain the rolled back tracks to SSRCs Map.
|
|
27464
27753
|
this._rolledBackTracksToSSRCs.clear();
|
|
27465
|
-
|
|
27466
|
-
|
|
27467
|
-
|
|
27468
|
-
|
|
27469
|
-
|
|
27470
|
-
|
|
27471
|
-
|
|
27472
|
-
|
|
27473
|
-
var description = args[0];
|
|
27474
|
-
// NOTE(mmalavalli): If setRemoteDescription() is called immediately after rolling back,
|
|
27475
|
-
// then we no longer need to retain the rolled back tracks to SSRCs Map.
|
|
27476
|
-
this._rolledBackTracksToSSRCs.clear();
|
|
27477
|
-
var promise = setDescription(this, false, description);
|
|
27478
|
-
return args.length > 1
|
|
27479
|
-
? util.legacyPromise(promise, args[1], args[2])
|
|
27480
|
-
: promise;
|
|
27481
|
-
};
|
|
27482
|
-
util.delegateMethods(RTCPeerConnection.prototype, ChromeRTCPeerConnection.prototype, '_peerConnection');
|
|
27754
|
+
var promise = setDescription(this, false, description);
|
|
27755
|
+
return args.length > 1
|
|
27756
|
+
? legacyPromise(promise, arg1, arg2)
|
|
27757
|
+
: promise;
|
|
27758
|
+
};
|
|
27759
|
+
return ChromeRTCPeerConnection;
|
|
27760
|
+
}(EventTarget));
|
|
27761
|
+
delegateMethods(RTCPeerConnection.prototype, ChromeRTCPeerConnection.prototype, '_peerConnection');
|
|
27483
27762
|
// NOTE(mroberts): We workaround Chrome's lack of rollback support, per the
|
|
27484
27763
|
// workaround suggested here: https://bugs.chromium.org/p/webrtc/issues/detail?id=5738#c3
|
|
27485
27764
|
// Namely, we "fake" setting the local or remote description and instead buffer
|
|
@@ -27514,8 +27793,7 @@ function setDescription(peerConnection, local, description) {
|
|
|
27514
27793
|
else if (description.type === 'offer') {
|
|
27515
27794
|
if (peerConnection.signalingState !== intermediateState && peerConnection.signalingState !== 'stable') {
|
|
27516
27795
|
// NOTE(mroberts): Error message copied from Firefox.
|
|
27517
|
-
return Promise.reject(new Error(
|
|
27518
|
-
' offer in state ' + peerConnection.signalingState));
|
|
27796
|
+
return Promise.reject(new Error("Cannot set " + (local ? 'local' : 'remote') + " offer in state " + peerConnection.signalingState));
|
|
27519
27797
|
}
|
|
27520
27798
|
// We need to save this local offer in case of a rollback. We also need to
|
|
27521
27799
|
// check to see if the signalingState between the ChromeRTCPeerConnection
|
|
@@ -27529,16 +27807,13 @@ function setDescription(peerConnection, local, description) {
|
|
|
27529
27807
|
promise = Promise.resolve();
|
|
27530
27808
|
// Only dispatch a signalingstatechange event if we transitioned.
|
|
27531
27809
|
if (peerConnection.signalingState !== previousSignalingState) {
|
|
27532
|
-
promise.then(function
|
|
27533
|
-
peerConnection.dispatchEvent(new Event('signalingstatechange'));
|
|
27534
|
-
});
|
|
27810
|
+
promise.then(function () { return peerConnection.dispatchEvent(new Event('signalingstatechange')); });
|
|
27535
27811
|
}
|
|
27536
27812
|
}
|
|
27537
27813
|
else if (description.type === 'rollback') {
|
|
27538
27814
|
if (peerConnection.signalingState !== intermediateState) {
|
|
27539
27815
|
// NOTE(mroberts): Error message copied from Firefox.
|
|
27540
|
-
promise = Promise.reject(new Error(
|
|
27541
|
-
(local ? 'local' : 'remote') + ' description in ' + peerConnection.signalingState));
|
|
27816
|
+
promise = Promise.reject(new Error("Cannot rollback " + (local ? 'local' : 'remote') + " description in " + peerConnection.signalingState));
|
|
27542
27817
|
}
|
|
27543
27818
|
else {
|
|
27544
27819
|
// Reset the pending offer.
|
|
@@ -27550,9 +27825,7 @@ function setDescription(peerConnection, local, description) {
|
|
|
27550
27825
|
peerConnection._rolledBackTracksToSSRCs = new Map(peerConnection._tracksToSSRCs);
|
|
27551
27826
|
peerConnection._tracksToSSRCs = new Map(peerConnection._appliedTracksToSSRCs);
|
|
27552
27827
|
promise = Promise.resolve();
|
|
27553
|
-
promise.then(function
|
|
27554
|
-
peerConnection.dispatchEvent(new Event('signalingstatechange'));
|
|
27555
|
-
});
|
|
27828
|
+
promise.then(function () { return peerConnection.dispatchEvent(new Event('signalingstatechange')); });
|
|
27556
27829
|
}
|
|
27557
27830
|
}
|
|
27558
27831
|
return promise || peerConnection._peerConnection[setLocalDescription](unwrap(description));
|
|
@@ -27560,10 +27833,10 @@ function setDescription(peerConnection, local, description) {
|
|
|
27560
27833
|
function setRemoteAnswer(peerConnection, answer) {
|
|
27561
27834
|
// Apply the pending local offer.
|
|
27562
27835
|
var pendingLocalOffer = peerConnection._pendingLocalOffer;
|
|
27563
|
-
return peerConnection._peerConnection.setLocalDescription(pendingLocalOffer).then(function
|
|
27836
|
+
return peerConnection._peerConnection.setLocalDescription(pendingLocalOffer).then(function () {
|
|
27564
27837
|
peerConnection._pendingLocalOffer = null;
|
|
27565
27838
|
return peerConnection.setRemoteDescription(answer);
|
|
27566
|
-
}).then(function
|
|
27839
|
+
}).then(function () {
|
|
27567
27840
|
// NOTE(mroberts): The signalingStates between the ChromeRTCPeerConnection
|
|
27568
27841
|
// and the underlying RTCPeerConnection implementation have converged. We
|
|
27569
27842
|
// can unblock any pending calls to addIceCandidate now.
|
|
@@ -27578,8 +27851,10 @@ function setRemoteAnswer(peerConnection, answer) {
|
|
|
27578
27851
|
* @returns {boolean}
|
|
27579
27852
|
*/
|
|
27580
27853
|
function hasReceiversForTracksOfKind(peerConnection, kind) {
|
|
27581
|
-
return !!peerConnection.getTransceivers().find(function (
|
|
27582
|
-
|
|
27854
|
+
return !!peerConnection.getTransceivers().find(function (_a) {
|
|
27855
|
+
var _b = _a.receiver, receiver = _b === void 0 ? {} : _b;
|
|
27856
|
+
var _c = receiver.track, track = _c === void 0 ? {} : _c;
|
|
27857
|
+
return track.kind === kind;
|
|
27583
27858
|
});
|
|
27584
27859
|
}
|
|
27585
27860
|
function unwrap(description) {
|
|
@@ -27651,19 +27926,54 @@ function shimDataChannel(dataChannel) {
|
|
|
27651
27926
|
*/
|
|
27652
27927
|
function updateTrackIdsToSSRCs(sdpFormat, tracksToSSRCs, sdp) {
|
|
27653
27928
|
return sdpFormat === 'unified'
|
|
27654
|
-
?
|
|
27655
|
-
:
|
|
27929
|
+
? updateUnifiedPlanTrackIdsToSSRCs(tracksToSSRCs, sdp)
|
|
27930
|
+
: updatePlanBTrackIdsToSSRCs(tracksToSSRCs, sdp);
|
|
27656
27931
|
}
|
|
27657
27932
|
module.exports = ChromeRTCPeerConnection;
|
|
27658
27933
|
|
|
27659
|
-
},{"../../
|
|
27934
|
+
},{"../../eventtarget":11,"../mediastream":159,"../rtcrtpsender":166,"../rtcsessiondescription/chrome":167,"../util":170,"../util/latch":171,"../util/sdp":172}],163:[function(require,module,exports){
|
|
27660
27935
|
/* globals RTCPeerConnection */
|
|
27661
27936
|
'use strict';
|
|
27662
|
-
var
|
|
27937
|
+
var __extends = (this && this.__extends) || (function () {
|
|
27938
|
+
var extendStatics = function (d, b) {
|
|
27939
|
+
extendStatics = Object.setPrototypeOf ||
|
|
27940
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
27941
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27942
|
+
return extendStatics(d, b);
|
|
27943
|
+
};
|
|
27944
|
+
return function (d, b) {
|
|
27945
|
+
if (typeof b !== "function" && b !== null)
|
|
27946
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
27947
|
+
extendStatics(d, b);
|
|
27948
|
+
function __() { this.constructor = d; }
|
|
27949
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
27950
|
+
};
|
|
27951
|
+
})();
|
|
27952
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
27953
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27954
|
+
if (!m) return o;
|
|
27955
|
+
var i = m.call(o), r, ar = [], e;
|
|
27956
|
+
try {
|
|
27957
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27958
|
+
}
|
|
27959
|
+
catch (error) { e = { error: error }; }
|
|
27960
|
+
finally {
|
|
27961
|
+
try {
|
|
27962
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
27963
|
+
}
|
|
27964
|
+
finally { if (e) throw e.error; }
|
|
27965
|
+
}
|
|
27966
|
+
return ar;
|
|
27967
|
+
};
|
|
27968
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
27969
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
27970
|
+
to[j] = from[i];
|
|
27971
|
+
return to;
|
|
27972
|
+
};
|
|
27973
|
+
var EventTarget = require('../../eventtarget');
|
|
27663
27974
|
var FirefoxRTCSessionDescription = require('../rtcsessiondescription/firefox');
|
|
27664
|
-
var inherits = require('../../vendor/inherits');
|
|
27665
27975
|
var updateTracksToSSRCs = require('../util/sdp').updateUnifiedPlanTrackIdsToSSRCs;
|
|
27666
|
-
var
|
|
27976
|
+
var _a = require('../util'), delegateMethods = _a.delegateMethods, interceptEvent = _a.interceptEvent, legacyPromise = _a.legacyPromise, proxyProperties = _a.proxyProperties;
|
|
27667
27977
|
// NOTE(mroberts): This class wraps Firefox's RTCPeerConnection implementation.
|
|
27668
27978
|
// It provides some functionality not currently present in Firefox, namely the
|
|
27669
27979
|
// abilities to
|
|
@@ -27684,201 +27994,212 @@ var util = require('../util');
|
|
|
27684
27994
|
//
|
|
27685
27995
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1240897
|
|
27686
27996
|
//
|
|
27687
|
-
|
|
27688
|
-
|
|
27689
|
-
|
|
27690
|
-
|
|
27691
|
-
|
|
27692
|
-
|
|
27693
|
-
|
|
27694
|
-
|
|
27695
|
-
|
|
27696
|
-
|
|
27697
|
-
|
|
27698
|
-
|
|
27699
|
-
|
|
27700
|
-
|
|
27701
|
-
|
|
27702
|
-
|
|
27703
|
-
|
|
27704
|
-
|
|
27705
|
-
|
|
27706
|
-
|
|
27707
|
-
|
|
27708
|
-
|
|
27709
|
-
|
|
27710
|
-
|
|
27711
|
-
|
|
27712
|
-
|
|
27713
|
-
|
|
27714
|
-
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27997
|
+
var FirefoxRTCPeerConnection = /** @class */ (function (_super) {
|
|
27998
|
+
__extends(FirefoxRTCPeerConnection, _super);
|
|
27999
|
+
function FirefoxRTCPeerConnection(configuration) {
|
|
28000
|
+
var _this = _super.call(this) || this;
|
|
28001
|
+
interceptEvent(_this, 'signalingstatechange');
|
|
28002
|
+
/* eslint new-cap:0 */
|
|
28003
|
+
var peerConnection = new RTCPeerConnection(configuration);
|
|
28004
|
+
Object.defineProperties(_this, {
|
|
28005
|
+
_initiallyNegotiatedDtlsRole: {
|
|
28006
|
+
value: null,
|
|
28007
|
+
writable: true
|
|
28008
|
+
},
|
|
28009
|
+
_isClosed: {
|
|
28010
|
+
value: false,
|
|
28011
|
+
writable: true
|
|
28012
|
+
},
|
|
28013
|
+
_peerConnection: {
|
|
28014
|
+
value: peerConnection
|
|
28015
|
+
},
|
|
28016
|
+
_rollingBack: {
|
|
28017
|
+
value: false,
|
|
28018
|
+
writable: true
|
|
28019
|
+
},
|
|
28020
|
+
_tracksToSSRCs: {
|
|
28021
|
+
value: new Map()
|
|
28022
|
+
},
|
|
28023
|
+
// NOTE(mmalavalli): Firefox throws a TypeError when the PeerConnection's
|
|
28024
|
+
// prototype's "peerIdentity" property is accessed. In order to overcome
|
|
28025
|
+
// this, we ignore this property while delegating methods.
|
|
28026
|
+
// Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=1363815
|
|
28027
|
+
peerIdentity: {
|
|
28028
|
+
enumerable: true,
|
|
28029
|
+
value: Promise.resolve({
|
|
28030
|
+
idp: '',
|
|
28031
|
+
name: ''
|
|
28032
|
+
})
|
|
27718
28033
|
}
|
|
27719
|
-
}
|
|
27720
|
-
|
|
27721
|
-
|
|
27722
|
-
|
|
27723
|
-
|
|
28034
|
+
});
|
|
28035
|
+
var previousSignalingState;
|
|
28036
|
+
peerConnection.addEventListener('signalingstatechange', function () {
|
|
28037
|
+
var args = [];
|
|
28038
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28039
|
+
args[_i] = arguments[_i];
|
|
27724
28040
|
}
|
|
27725
|
-
|
|
27726
|
-
|
|
27727
|
-
|
|
27728
|
-
|
|
27729
|
-
|
|
28041
|
+
if (!_this._rollingBack && _this.signalingState !== previousSignalingState) {
|
|
28042
|
+
previousSignalingState = _this.signalingState;
|
|
28043
|
+
// NOTE(mmalavalli): In Firefox, 'signalingstatechange' event is
|
|
28044
|
+
// triggered synchronously in the same tick after
|
|
28045
|
+
// RTCPeerConnection#close() is called. So we mimic Chrome's behavior
|
|
28046
|
+
// by triggering 'signalingstatechange' on the next tick.
|
|
28047
|
+
if (_this._isClosed) {
|
|
28048
|
+
setTimeout(function () { return _this.dispatchEvent.apply(_this, __spreadArray([], __read(args))); });
|
|
28049
|
+
}
|
|
28050
|
+
else {
|
|
28051
|
+
_this.dispatchEvent.apply(_this, __spreadArray([], __read(args)));
|
|
28052
|
+
}
|
|
27730
28053
|
}
|
|
27731
|
-
}
|
|
28054
|
+
});
|
|
28055
|
+
proxyProperties(RTCPeerConnection.prototype, _this, peerConnection);
|
|
28056
|
+
return _this;
|
|
28057
|
+
}
|
|
28058
|
+
Object.defineProperty(FirefoxRTCPeerConnection.prototype, "iceGatheringState", {
|
|
28059
|
+
get: function () {
|
|
28060
|
+
return this._isClosed ? 'complete' : this._peerConnection.iceGatheringState;
|
|
28061
|
+
},
|
|
28062
|
+
enumerable: false,
|
|
28063
|
+
configurable: true
|
|
27732
28064
|
});
|
|
27733
|
-
|
|
27734
|
-
|
|
27735
|
-
|
|
27736
|
-
|
|
27737
|
-
|
|
27738
|
-
|
|
27739
|
-
// triggered synchronously in the same tick after
|
|
27740
|
-
// RTCPeerConnection#close() is called. So we mimic Chrome's behavior
|
|
27741
|
-
// by triggering 'signalingstatechange' on the next tick.
|
|
27742
|
-
var dispatchEventToSelf = self.dispatchEvent.apply.bind(self.dispatchEvent, self, arguments);
|
|
27743
|
-
if (self._isClosed) {
|
|
27744
|
-
setTimeout(dispatchEventToSelf);
|
|
27745
|
-
}
|
|
27746
|
-
else {
|
|
27747
|
-
dispatchEventToSelf();
|
|
27748
|
-
}
|
|
27749
|
-
}
|
|
28065
|
+
Object.defineProperty(FirefoxRTCPeerConnection.prototype, "localDescription", {
|
|
28066
|
+
get: function () {
|
|
28067
|
+
return overwriteWithInitiallyNegotiatedDtlsRole(this._peerConnection.localDescription, this._initiallyNegotiatedDtlsRole);
|
|
28068
|
+
},
|
|
28069
|
+
enumerable: false,
|
|
28070
|
+
configurable: true
|
|
27750
28071
|
});
|
|
27751
|
-
|
|
27752
|
-
|
|
27753
|
-
|
|
27754
|
-
|
|
27755
|
-
|
|
27756
|
-
|
|
27757
|
-
// Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=1363815
|
|
27758
|
-
Object.defineProperty(FirefoxRTCPeerConnection.prototype, 'peerIdentity', {
|
|
27759
|
-
enumerable: true,
|
|
27760
|
-
value: Promise.resolve({
|
|
27761
|
-
idp: '',
|
|
27762
|
-
name: ''
|
|
27763
|
-
})
|
|
27764
|
-
});
|
|
27765
|
-
FirefoxRTCPeerConnection.prototype.createAnswer = function createAnswer() {
|
|
27766
|
-
var args = [].slice.call(arguments);
|
|
27767
|
-
var promise;
|
|
27768
|
-
var self = this;
|
|
27769
|
-
promise = this._peerConnection.createAnswer().then(function createAnswerSucceeded(answer) {
|
|
27770
|
-
saveInitiallyNegotiatedDtlsRole(self, answer);
|
|
27771
|
-
return overwriteWithInitiallyNegotiatedDtlsRole(answer, self._initiallyNegotiatedDtlsRole);
|
|
28072
|
+
Object.defineProperty(FirefoxRTCPeerConnection.prototype, "signalingState", {
|
|
28073
|
+
get: function () {
|
|
28074
|
+
return this._isClosed ? 'closed' : this._peerConnection.signalingState;
|
|
28075
|
+
},
|
|
28076
|
+
enumerable: false,
|
|
28077
|
+
configurable: true
|
|
27772
28078
|
});
|
|
27773
|
-
|
|
27774
|
-
|
|
27775
|
-
|
|
27776
|
-
|
|
27777
|
-
|
|
27778
|
-
|
|
27779
|
-
|
|
27780
|
-
|
|
27781
|
-
|
|
27782
|
-
|
|
27783
|
-
|
|
27784
|
-
|
|
27785
|
-
|
|
27786
|
-
|
|
27787
|
-
|
|
27788
|
-
|
|
27789
|
-
|
|
27790
|
-
|
|
27791
|
-
|
|
27792
|
-
|
|
27793
|
-
|
|
27794
|
-
|
|
27795
|
-
|
|
27796
|
-
|
|
27797
|
-
|
|
27798
|
-
|
|
27799
|
-
|
|
27800
|
-
|
|
27801
|
-
|
|
27802
|
-
|
|
28079
|
+
FirefoxRTCPeerConnection.prototype.createAnswer = function () {
|
|
28080
|
+
var _this = this;
|
|
28081
|
+
var args = [];
|
|
28082
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28083
|
+
args[_i] = arguments[_i];
|
|
28084
|
+
}
|
|
28085
|
+
var promise;
|
|
28086
|
+
promise = this._peerConnection.createAnswer().then(function (answer) {
|
|
28087
|
+
saveInitiallyNegotiatedDtlsRole(_this, answer);
|
|
28088
|
+
return overwriteWithInitiallyNegotiatedDtlsRole(answer, _this._initiallyNegotiatedDtlsRole);
|
|
28089
|
+
});
|
|
28090
|
+
return typeof args[0] === 'function'
|
|
28091
|
+
? legacyPromise.apply(void 0, __spreadArray([promise], __read(args))) : promise;
|
|
28092
|
+
};
|
|
28093
|
+
// NOTE(mroberts): The WebRTC spec allows you to call createOffer from any
|
|
28094
|
+
// signalingState other than "closed"; however, Firefox has not yet implemented
|
|
28095
|
+
// this (https://bugzilla.mozilla.org/show_bug.cgi?id=1072388). We workaround
|
|
28096
|
+
// this by rolling back if we are in state "have-local-offer" or
|
|
28097
|
+
// "have-remote-offer". This is acceptable for our use case because we will
|
|
28098
|
+
// apply the newly-created offer almost immediately; however, this may be
|
|
28099
|
+
// unacceptable for other use cases.
|
|
28100
|
+
FirefoxRTCPeerConnection.prototype.createOffer = function () {
|
|
28101
|
+
var _this = this;
|
|
28102
|
+
var args = [];
|
|
28103
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28104
|
+
args[_i] = arguments[_i];
|
|
28105
|
+
}
|
|
28106
|
+
var _a = __read(args, 3), arg1 = _a[0], arg2 = _a[1], arg3 = _a[2];
|
|
28107
|
+
var options = arg3 || arg1 || {};
|
|
28108
|
+
var promise;
|
|
28109
|
+
if (this.signalingState === 'have-local-offer' ||
|
|
28110
|
+
this.signalingState === 'have-remote-offer') {
|
|
28111
|
+
var local = this.signalingState === 'have-local-offer';
|
|
28112
|
+
promise = rollback(this, local, function () { return _this.createOffer(options); });
|
|
28113
|
+
}
|
|
28114
|
+
else {
|
|
28115
|
+
promise = this._peerConnection.createOffer(options);
|
|
28116
|
+
}
|
|
28117
|
+
promise = promise.then(function (offer) {
|
|
28118
|
+
return new FirefoxRTCSessionDescription({
|
|
28119
|
+
type: offer.type,
|
|
28120
|
+
sdp: updateTracksToSSRCs(_this._tracksToSSRCs, offer.sdp)
|
|
28121
|
+
});
|
|
27803
28122
|
});
|
|
27804
|
-
});
|
|
27805
|
-
return args.length > 1
|
|
27806
|
-
? util.legacyPromise(promise, args[0], args[1])
|
|
27807
|
-
: promise;
|
|
27808
|
-
};
|
|
27809
|
-
// NOTE(mroberts): While Firefox will reject the Promise returned by
|
|
27810
|
-
// setLocalDescription when called from signalingState "have-local-offer" with
|
|
27811
|
-
// an answer, it still updates the .localDescription property. We workaround
|
|
27812
|
-
// this by explicitly handling this case.
|
|
27813
|
-
FirefoxRTCPeerConnection.prototype.setLocalDescription = function setLocalDescription() {
|
|
27814
|
-
var args = [].slice.call(arguments);
|
|
27815
|
-
var description = args[0];
|
|
27816
|
-
var promise;
|
|
27817
|
-
if (description && description.type === 'answer' && this.signalingState === 'have-local-offer') {
|
|
27818
|
-
promise = Promise.reject(new Error('Cannot set local answer in state have-local-offer'));
|
|
27819
|
-
}
|
|
27820
|
-
if (promise) {
|
|
27821
28123
|
return args.length > 1
|
|
27822
|
-
?
|
|
28124
|
+
? legacyPromise(promise, arg1, arg2)
|
|
27823
28125
|
: promise;
|
|
27824
|
-
}
|
|
27825
|
-
|
|
27826
|
-
|
|
27827
|
-
//
|
|
27828
|
-
//
|
|
27829
|
-
|
|
27830
|
-
|
|
27831
|
-
|
|
27832
|
-
|
|
27833
|
-
|
|
27834
|
-
// While Firefox will reject the Promise returned by setRemoteDescription when
|
|
27835
|
-
// called from signalingState "have-remote-offer" with an answer, it sill
|
|
27836
|
-
// updates the .remoteDescription property. We workaround this by explicitly
|
|
27837
|
-
// handling this case.
|
|
27838
|
-
FirefoxRTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() {
|
|
27839
|
-
var args = [].slice.call(arguments);
|
|
27840
|
-
var description = args[0];
|
|
27841
|
-
var promise;
|
|
27842
|
-
var self = this;
|
|
27843
|
-
if (description && this.signalingState === 'have-remote-offer') {
|
|
27844
|
-
if (description.type === 'answer') {
|
|
27845
|
-
promise = Promise.reject(new Error('Cannot set remote answer in state have-remote-offer'));
|
|
28126
|
+
};
|
|
28127
|
+
// NOTE(mroberts): While Firefox will reject the Promise returned by
|
|
28128
|
+
// setLocalDescription when called from signalingState "have-local-offer" with
|
|
28129
|
+
// an answer, it still updates the .localDescription property. We workaround
|
|
28130
|
+
// this by explicitly handling this case.
|
|
28131
|
+
FirefoxRTCPeerConnection.prototype.setLocalDescription = function () {
|
|
28132
|
+
var _a;
|
|
28133
|
+
var args = [];
|
|
28134
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28135
|
+
args[_i] = arguments[_i];
|
|
27846
28136
|
}
|
|
27847
|
-
|
|
27848
|
-
|
|
27849
|
-
|
|
27850
|
-
|
|
28137
|
+
var _b = __read(args), description = _b[0], rest = _b.slice(1);
|
|
28138
|
+
var promise;
|
|
28139
|
+
if (description && description.type === 'answer' && this.signalingState === 'have-local-offer') {
|
|
28140
|
+
promise = Promise.reject(new Error('Cannot set local answer in state have-local-offer'));
|
|
27851
28141
|
}
|
|
27852
|
-
|
|
27853
|
-
|
|
27854
|
-
|
|
27855
|
-
|
|
27856
|
-
|
|
27857
|
-
|
|
27858
|
-
|
|
27859
|
-
|
|
27860
|
-
|
|
27861
|
-
|
|
27862
|
-
|
|
27863
|
-
//
|
|
27864
|
-
//
|
|
27865
|
-
//
|
|
27866
|
-
|
|
27867
|
-
|
|
27868
|
-
|
|
27869
|
-
|
|
27870
|
-
|
|
27871
|
-
|
|
27872
|
-
|
|
28142
|
+
if (promise) {
|
|
28143
|
+
return args.length > 1
|
|
28144
|
+
? legacyPromise.apply(void 0, __spreadArray([promise], __read(rest))) : promise;
|
|
28145
|
+
}
|
|
28146
|
+
return (_a = this._peerConnection).setLocalDescription.apply(_a, __spreadArray([], __read(args)));
|
|
28147
|
+
};
|
|
28148
|
+
// NOTE(mroberts): The WebRTC spec allows you to call setRemoteDescription with
|
|
28149
|
+
// an offer multiple times in signalingState "have-remote-offer"; however,
|
|
28150
|
+
// Firefox has not yet implemented this (https://bugzilla.mozilla.org/show_bug.cgi?id=1072388).
|
|
28151
|
+
// We workaround this by rolling back if we are in state "have-remote-offer".
|
|
28152
|
+
// This is acceptable for our use case; however, this may be unacceptable for
|
|
28153
|
+
// other use cases.
|
|
28154
|
+
//
|
|
28155
|
+
// While Firefox will reject the Promise returned by setRemoteDescription when
|
|
28156
|
+
// called from signalingState "have-remote-offer" with an answer, it sill
|
|
28157
|
+
// updates the .remoteDescription property. We workaround this by explicitly
|
|
28158
|
+
// handling this case.
|
|
28159
|
+
FirefoxRTCPeerConnection.prototype.setRemoteDescription = function () {
|
|
28160
|
+
var _this = this;
|
|
28161
|
+
var args = [];
|
|
28162
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28163
|
+
args[_i] = arguments[_i];
|
|
28164
|
+
}
|
|
28165
|
+
var _a = __read(args), description = _a[0], rest = _a.slice(1);
|
|
28166
|
+
var promise;
|
|
28167
|
+
if (description && this.signalingState === 'have-remote-offer') {
|
|
28168
|
+
if (description.type === 'answer') {
|
|
28169
|
+
promise = Promise.reject(new Error('Cannot set remote answer in state have-remote-offer'));
|
|
28170
|
+
}
|
|
28171
|
+
else if (description.type === 'offer') {
|
|
28172
|
+
promise = rollback(this, false, function () { return _this._peerConnection.setRemoteDescription(description); });
|
|
28173
|
+
}
|
|
28174
|
+
}
|
|
28175
|
+
if (!promise) {
|
|
28176
|
+
promise = this._peerConnection.setRemoteDescription(description);
|
|
28177
|
+
}
|
|
28178
|
+
promise = promise.then(function () { return saveInitiallyNegotiatedDtlsRole(_this, description, true); });
|
|
28179
|
+
return args.length > 1
|
|
28180
|
+
? legacyPromise.apply(void 0, __spreadArray([promise], __read(rest))) : promise;
|
|
28181
|
+
};
|
|
28182
|
+
// NOTE(mroberts): The WebRTC spec specifies that the PeerConnection's internal
|
|
28183
|
+
// isClosed slot should immediately be set to true; however, in Firefox it
|
|
28184
|
+
// occurs in the next tick. We workaround this by tracking isClosed manually.
|
|
28185
|
+
FirefoxRTCPeerConnection.prototype.close = function () {
|
|
28186
|
+
if (this.signalingState !== 'closed') {
|
|
28187
|
+
this._isClosed = true;
|
|
28188
|
+
this._peerConnection.close();
|
|
28189
|
+
}
|
|
28190
|
+
};
|
|
28191
|
+
return FirefoxRTCPeerConnection;
|
|
28192
|
+
}(EventTarget));
|
|
28193
|
+
delegateMethods(RTCPeerConnection.prototype, FirefoxRTCPeerConnection.prototype, '_peerConnection');
|
|
27873
28194
|
function rollback(peerConnection, local, onceRolledBack) {
|
|
27874
28195
|
var setLocalDescription = local ? 'setLocalDescription' : 'setRemoteDescription';
|
|
27875
28196
|
peerConnection._rollingBack = true;
|
|
27876
28197
|
return peerConnection._peerConnection[setLocalDescription](new FirefoxRTCSessionDescription({
|
|
27877
28198
|
type: 'rollback'
|
|
27878
|
-
})).then(onceRolledBack).then(function
|
|
28199
|
+
})).then(onceRolledBack).then(function (result) {
|
|
27879
28200
|
peerConnection._rollingBack = false;
|
|
27880
28201
|
return result;
|
|
27881
|
-
}, function
|
|
28202
|
+
}, function (error) {
|
|
27882
28203
|
peerConnection._rollingBack = false;
|
|
27883
28204
|
throw error;
|
|
27884
28205
|
});
|
|
@@ -27937,7 +28258,7 @@ function overwriteWithInitiallyNegotiatedDtlsRole(description, dtlsRole) {
|
|
|
27937
28258
|
}
|
|
27938
28259
|
module.exports = FirefoxRTCPeerConnection;
|
|
27939
28260
|
|
|
27940
|
-
},{"../../
|
|
28261
|
+
},{"../../eventtarget":11,"../rtcsessiondescription/firefox":168,"../util":170,"../util/sdp":172}],164:[function(require,module,exports){
|
|
27941
28262
|
'use strict';
|
|
27942
28263
|
if (typeof RTCPeerConnection === 'function') {
|
|
27943
28264
|
var guessBrowser = require('../util').guessBrowser;
|
|
@@ -27962,253 +28283,299 @@ else {
|
|
|
27962
28283
|
};
|
|
27963
28284
|
}
|
|
27964
28285
|
|
|
27965
|
-
},{"../util":170,"./chrome":
|
|
28286
|
+
},{"../util":170,"./chrome":162,"./firefox":163,"./safari":165}],165:[function(require,module,exports){
|
|
27966
28287
|
/* globals RTCPeerConnection, RTCSessionDescription */
|
|
27967
28288
|
'use strict';
|
|
27968
|
-
var
|
|
27969
|
-
var
|
|
28289
|
+
var __extends = (this && this.__extends) || (function () {
|
|
28290
|
+
var extendStatics = function (d, b) {
|
|
28291
|
+
extendStatics = Object.setPrototypeOf ||
|
|
28292
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
28293
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
28294
|
+
return extendStatics(d, b);
|
|
28295
|
+
};
|
|
28296
|
+
return function (d, b) {
|
|
28297
|
+
if (typeof b !== "function" && b !== null)
|
|
28298
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
28299
|
+
extendStatics(d, b);
|
|
28300
|
+
function __() { this.constructor = d; }
|
|
28301
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28302
|
+
};
|
|
28303
|
+
})();
|
|
28304
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
28305
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
28306
|
+
if (!m) return o;
|
|
28307
|
+
var i = m.call(o), r, ar = [], e;
|
|
28308
|
+
try {
|
|
28309
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
28310
|
+
}
|
|
28311
|
+
catch (error) { e = { error: error }; }
|
|
28312
|
+
finally {
|
|
28313
|
+
try {
|
|
28314
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28315
|
+
}
|
|
28316
|
+
finally { if (e) throw e.error; }
|
|
28317
|
+
}
|
|
28318
|
+
return ar;
|
|
28319
|
+
};
|
|
28320
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
28321
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
28322
|
+
to[j] = from[i];
|
|
28323
|
+
return to;
|
|
28324
|
+
};
|
|
28325
|
+
var EventTarget = require('../../eventtarget');
|
|
27970
28326
|
var Latch = require('../util/latch');
|
|
27971
|
-
var
|
|
27972
|
-
var
|
|
27973
|
-
var isUnifiedPlan =
|
|
28327
|
+
var _a = require('../util/sdp'), getSdpFormat = _a.getSdpFormat, updatePlanBTrackIdsToSSRCs = _a.updatePlanBTrackIdsToSSRCs, updateUnifiedPlanTrackIdsToSSRCs = _a.updateUnifiedPlanTrackIdsToSSRCs;
|
|
28328
|
+
var _b = require('../util'), delegateMethods = _b.delegateMethods, interceptEvent = _b.interceptEvent, proxyProperties = _b.proxyProperties;
|
|
28329
|
+
var isUnifiedPlan = getSdpFormat() === 'unified';
|
|
27974
28330
|
var updateTrackIdsToSSRCs = isUnifiedPlan
|
|
27975
|
-
?
|
|
27976
|
-
:
|
|
27977
|
-
|
|
27978
|
-
|
|
27979
|
-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
27984
|
-
|
|
27985
|
-
|
|
27986
|
-
|
|
27987
|
-
|
|
27988
|
-
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
-
|
|
27994
|
-
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
|
|
27998
|
-
|
|
27999
|
-
|
|
28000
|
-
|
|
28001
|
-
|
|
28002
|
-
|
|
28003
|
-
|
|
28004
|
-
|
|
28005
|
-
|
|
28006
|
-
|
|
28007
|
-
|
|
28008
|
-
|
|
28009
|
-
|
|
28010
|
-
|
|
28011
|
-
|
|
28012
|
-
|
|
28013
|
-
|
|
28014
|
-
|
|
28015
|
-
|
|
28016
|
-
|
|
28331
|
+
? updateUnifiedPlanTrackIdsToSSRCs
|
|
28332
|
+
: updatePlanBTrackIdsToSSRCs;
|
|
28333
|
+
var SafariRTCPeerConnection = /** @class */ (function (_super) {
|
|
28334
|
+
__extends(SafariRTCPeerConnection, _super);
|
|
28335
|
+
function SafariRTCPeerConnection(configuration) {
|
|
28336
|
+
var _this = _super.call(this) || this;
|
|
28337
|
+
interceptEvent(_this, 'datachannel');
|
|
28338
|
+
interceptEvent(_this, 'iceconnectionstatechange');
|
|
28339
|
+
interceptEvent(_this, 'signalingstatechange');
|
|
28340
|
+
interceptEvent(_this, 'track');
|
|
28341
|
+
var peerConnection = new RTCPeerConnection(configuration);
|
|
28342
|
+
Object.defineProperties(_this, {
|
|
28343
|
+
_appliedTracksToSSRCs: {
|
|
28344
|
+
value: new Map(),
|
|
28345
|
+
writable: true
|
|
28346
|
+
},
|
|
28347
|
+
_audioTransceiver: {
|
|
28348
|
+
value: null,
|
|
28349
|
+
writable: true
|
|
28350
|
+
},
|
|
28351
|
+
_isClosed: {
|
|
28352
|
+
value: false,
|
|
28353
|
+
writable: true
|
|
28354
|
+
},
|
|
28355
|
+
_peerConnection: {
|
|
28356
|
+
value: peerConnection
|
|
28357
|
+
},
|
|
28358
|
+
_pendingLocalOffer: {
|
|
28359
|
+
value: null,
|
|
28360
|
+
writable: true
|
|
28361
|
+
},
|
|
28362
|
+
_pendingRemoteOffer: {
|
|
28363
|
+
value: null,
|
|
28364
|
+
writable: true
|
|
28365
|
+
},
|
|
28366
|
+
_rolledBackTracksToSSRCs: {
|
|
28367
|
+
value: new Map(),
|
|
28368
|
+
writable: true
|
|
28369
|
+
},
|
|
28370
|
+
_signalingStateLatch: {
|
|
28371
|
+
value: new Latch()
|
|
28372
|
+
},
|
|
28373
|
+
_tracksToSSRCs: {
|
|
28374
|
+
value: new Map(),
|
|
28375
|
+
writable: true
|
|
28376
|
+
},
|
|
28377
|
+
_videoTransceiver: {
|
|
28378
|
+
value: null,
|
|
28379
|
+
writable: true
|
|
28380
|
+
}
|
|
28381
|
+
});
|
|
28382
|
+
peerConnection.addEventListener('datachannel', function (event) {
|
|
28383
|
+
shimDataChannel(event.channel);
|
|
28384
|
+
_this.dispatchEvent(event);
|
|
28385
|
+
});
|
|
28386
|
+
peerConnection.addEventListener('iceconnectionstatechange', function () {
|
|
28387
|
+
var args = [];
|
|
28388
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28389
|
+
args[_i] = arguments[_i];
|
|
28390
|
+
}
|
|
28391
|
+
if (_this._isClosed) {
|
|
28392
|
+
return;
|
|
28393
|
+
}
|
|
28394
|
+
_this.dispatchEvent.apply(_this, __spreadArray([], __read(args)));
|
|
28395
|
+
});
|
|
28396
|
+
peerConnection.addEventListener('signalingstatechange', function () {
|
|
28397
|
+
var args = [];
|
|
28398
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
28399
|
+
args[_i] = arguments[_i];
|
|
28400
|
+
}
|
|
28401
|
+
if (_this._isClosed) {
|
|
28402
|
+
return;
|
|
28403
|
+
}
|
|
28404
|
+
if (peerConnection.signalingState === 'stable') {
|
|
28405
|
+
_this._appliedTracksToSSRCs = new Map(_this._tracksToSSRCs);
|
|
28406
|
+
}
|
|
28407
|
+
if (!_this._pendingLocalOffer && !_this._pendingRemoteOffer) {
|
|
28408
|
+
_this.dispatchEvent.apply(_this, __spreadArray([], __read(args)));
|
|
28409
|
+
}
|
|
28410
|
+
});
|
|
28411
|
+
// NOTE(syerrapragada): This ensures that SafariRTCPeerConnection's "remoteDescription", when accessed
|
|
28412
|
+
// in an RTCTrackEvent listener, will point to the underlying RTCPeerConnection's
|
|
28413
|
+
// "remoteDescription". Before this fix, this was still pointing to "_pendingRemoteOffer"
|
|
28414
|
+
// even though a new remote RTCSessionDescription had already been applied.
|
|
28415
|
+
peerConnection.addEventListener('track', function (event) {
|
|
28416
|
+
_this._pendingRemoteOffer = null;
|
|
28417
|
+
_this.dispatchEvent(event);
|
|
28418
|
+
});
|
|
28419
|
+
proxyProperties(RTCPeerConnection.prototype, _this, peerConnection);
|
|
28420
|
+
return _this;
|
|
28421
|
+
}
|
|
28422
|
+
Object.defineProperty(SafariRTCPeerConnection.prototype, "localDescription", {
|
|
28423
|
+
get: function () {
|
|
28424
|
+
return this._pendingLocalOffer || this._peerConnection.localDescription;
|
|
28017
28425
|
},
|
|
28018
|
-
|
|
28019
|
-
|
|
28020
|
-
|
|
28426
|
+
enumerable: false,
|
|
28427
|
+
configurable: true
|
|
28428
|
+
});
|
|
28429
|
+
Object.defineProperty(SafariRTCPeerConnection.prototype, "iceConnectionState", {
|
|
28430
|
+
get: function () {
|
|
28431
|
+
return this._isClosed ? 'closed' : this._peerConnection.iceConnectionState;
|
|
28021
28432
|
},
|
|
28022
|
-
|
|
28023
|
-
|
|
28024
|
-
|
|
28433
|
+
enumerable: false,
|
|
28434
|
+
configurable: true
|
|
28435
|
+
});
|
|
28436
|
+
Object.defineProperty(SafariRTCPeerConnection.prototype, "iceGatheringState", {
|
|
28437
|
+
get: function () {
|
|
28438
|
+
return this._isClosed ? 'complete' : this._peerConnection.iceGatheringState;
|
|
28025
28439
|
},
|
|
28026
|
-
|
|
28027
|
-
|
|
28028
|
-
|
|
28029
|
-
|
|
28030
|
-
|
|
28440
|
+
enumerable: false,
|
|
28441
|
+
configurable: true
|
|
28442
|
+
});
|
|
28443
|
+
Object.defineProperty(SafariRTCPeerConnection.prototype, "remoteDescription", {
|
|
28444
|
+
get: function () {
|
|
28445
|
+
return this._pendingRemoteOffer || this._peerConnection.remoteDescription;
|
|
28031
28446
|
},
|
|
28032
|
-
|
|
28033
|
-
|
|
28034
|
-
|
|
28035
|
-
|
|
28447
|
+
enumerable: false,
|
|
28448
|
+
configurable: true
|
|
28449
|
+
});
|
|
28450
|
+
Object.defineProperty(SafariRTCPeerConnection.prototype, "signalingState", {
|
|
28451
|
+
get: function () {
|
|
28452
|
+
if (this._isClosed) {
|
|
28453
|
+
return 'closed';
|
|
28036
28454
|
}
|
|
28037
|
-
|
|
28038
|
-
|
|
28039
|
-
enumerable: true,
|
|
28040
|
-
get: function () {
|
|
28041
|
-
return this._isClosed ? 'complete' : this._peerConnection.iceGatheringState;
|
|
28455
|
+
else if (this._pendingLocalOffer) {
|
|
28456
|
+
return 'have-local-offer';
|
|
28042
28457
|
}
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
enumerable: true,
|
|
28046
|
-
get: function () {
|
|
28047
|
-
return this._pendingRemoteOffer || this._peerConnection.remoteDescription;
|
|
28458
|
+
else if (this._pendingRemoteOffer) {
|
|
28459
|
+
return 'have-remote-offer';
|
|
28048
28460
|
}
|
|
28461
|
+
return this._peerConnection.signalingState;
|
|
28049
28462
|
},
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
get: function () {
|
|
28053
|
-
if (this._isClosed) {
|
|
28054
|
-
return 'closed';
|
|
28055
|
-
}
|
|
28056
|
-
else if (this._pendingLocalOffer) {
|
|
28057
|
-
return 'have-local-offer';
|
|
28058
|
-
}
|
|
28059
|
-
else if (this._pendingRemoteOffer) {
|
|
28060
|
-
return 'have-remote-offer';
|
|
28061
|
-
}
|
|
28062
|
-
return this._peerConnection.signalingState;
|
|
28063
|
-
}
|
|
28064
|
-
}
|
|
28065
|
-
});
|
|
28066
|
-
var self = this;
|
|
28067
|
-
peerConnection.addEventListener('datachannel', function ondatachannel(event) {
|
|
28068
|
-
shimDataChannel(event.channel);
|
|
28069
|
-
self.dispatchEvent(event);
|
|
28070
|
-
});
|
|
28071
|
-
peerConnection.addEventListener('iceconnectionstatechange', function oniceconnectionstatechange() {
|
|
28072
|
-
if (self._isClosed) {
|
|
28073
|
-
return;
|
|
28074
|
-
}
|
|
28075
|
-
self.dispatchEvent.apply(self, arguments);
|
|
28463
|
+
enumerable: false,
|
|
28464
|
+
configurable: true
|
|
28076
28465
|
});
|
|
28077
|
-
|
|
28078
|
-
|
|
28079
|
-
|
|
28466
|
+
SafariRTCPeerConnection.prototype.addIceCandidate = function (candidate) {
|
|
28467
|
+
var _this = this;
|
|
28468
|
+
if (this.signalingState === 'have-remote-offer') {
|
|
28469
|
+
return this._signalingStateLatch.when('low').then(function () { return _this._peerConnection.addIceCandidate(candidate); });
|
|
28080
28470
|
}
|
|
28081
|
-
|
|
28082
|
-
|
|
28471
|
+
return this._peerConnection.addIceCandidate(candidate);
|
|
28472
|
+
};
|
|
28473
|
+
SafariRTCPeerConnection.prototype.createOffer = function (options) {
|
|
28474
|
+
var _this = this;
|
|
28475
|
+
options = Object.assign({}, options);
|
|
28476
|
+
// NOTE(mroberts): In general, this is not the way to do this; however, it's
|
|
28477
|
+
// good enough for our application.
|
|
28478
|
+
if (options.offerToReceiveVideo && !this._audioTransceiver && !(isUnifiedPlan && hasReceiversForTracksOfKind(this, 'audio'))) {
|
|
28479
|
+
delete options.offerToReceiveAudio;
|
|
28480
|
+
try {
|
|
28481
|
+
this._audioTransceiver = isUnifiedPlan
|
|
28482
|
+
? this.addTransceiver('audio', { direction: 'recvonly' })
|
|
28483
|
+
: this.addTransceiver('audio');
|
|
28484
|
+
}
|
|
28485
|
+
catch (e) {
|
|
28486
|
+
return Promise.reject(e);
|
|
28487
|
+
}
|
|
28083
28488
|
}
|
|
28084
|
-
if (!
|
|
28085
|
-
|
|
28489
|
+
if (options.offerToReceiveVideo && !this._videoTransceiver && !(isUnifiedPlan && hasReceiversForTracksOfKind(this, 'video'))) {
|
|
28490
|
+
delete options.offerToReceiveVideo;
|
|
28491
|
+
try {
|
|
28492
|
+
this._videoTransceiver = isUnifiedPlan
|
|
28493
|
+
? this.addTransceiver('video', { direction: 'recvonly' })
|
|
28494
|
+
: this.addTransceiver('video');
|
|
28495
|
+
}
|
|
28496
|
+
catch (e) {
|
|
28497
|
+
return Promise.reject(e);
|
|
28498
|
+
}
|
|
28086
28499
|
}
|
|
28087
|
-
|
|
28088
|
-
|
|
28089
|
-
|
|
28090
|
-
|
|
28091
|
-
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
|
|
28095
|
-
});
|
|
28096
|
-
util.proxyProperties(RTCPeerConnection.prototype, this, peerConnection);
|
|
28097
|
-
}
|
|
28098
|
-
inherits(SafariRTCPeerConnection, EventTarget);
|
|
28099
|
-
SafariRTCPeerConnection.prototype.addIceCandidate = function addIceCandidate(candidate) {
|
|
28100
|
-
var self = this;
|
|
28101
|
-
if (this.signalingState === 'have-remote-offer') {
|
|
28102
|
-
return this._signalingStateLatch.when('low').then(function signalingStatesResolved() {
|
|
28103
|
-
return self._peerConnection.addIceCandidate(candidate);
|
|
28500
|
+
return this._peerConnection.createOffer(options).then(function (offer) {
|
|
28501
|
+
// NOTE(mmalavalli): If createOffer() is called immediately after rolling back,
|
|
28502
|
+
// then we no longer need to retain the rolled back tracks to SSRCs Map.
|
|
28503
|
+
_this._rolledBackTracksToSSRCs.clear();
|
|
28504
|
+
return new RTCSessionDescription({
|
|
28505
|
+
type: offer.type,
|
|
28506
|
+
sdp: updateTrackIdsToSSRCs(_this._tracksToSSRCs, offer.sdp)
|
|
28507
|
+
});
|
|
28104
28508
|
});
|
|
28105
|
-
}
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28114
|
-
|
|
28115
|
-
|
|
28116
|
-
|
|
28117
|
-
?
|
|
28118
|
-
|
|
28119
|
-
|
|
28120
|
-
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
28125
|
-
delete options.offerToReceiveVideo;
|
|
28126
|
-
try {
|
|
28127
|
-
this._videoTransceiver = isUnifiedPlan
|
|
28128
|
-
? this.addTransceiver('video', { direction: 'recvonly' })
|
|
28129
|
-
: this.addTransceiver('video');
|
|
28130
|
-
}
|
|
28131
|
-
catch (e) {
|
|
28132
|
-
return Promise.reject(e);
|
|
28509
|
+
};
|
|
28510
|
+
SafariRTCPeerConnection.prototype.createAnswer = function (options) {
|
|
28511
|
+
var _this = this;
|
|
28512
|
+
if (this._pendingRemoteOffer) {
|
|
28513
|
+
return this._peerConnection.setRemoteDescription(this._pendingRemoteOffer).then(function () {
|
|
28514
|
+
_this._signalingStateLatch.lower();
|
|
28515
|
+
return _this._peerConnection.createAnswer();
|
|
28516
|
+
}).then(function (answer) {
|
|
28517
|
+
_this._pendingRemoteOffer = null;
|
|
28518
|
+
// NOTE(mmalavalli): If createAnswer() is called immediately after rolling back, then we no
|
|
28519
|
+
// longer need to retain the rolled back tracks to SSRCs Map.
|
|
28520
|
+
_this._rolledBackTracksToSSRCs.clear();
|
|
28521
|
+
return isUnifiedPlan ? new RTCSessionDescription({
|
|
28522
|
+
type: answer.type,
|
|
28523
|
+
sdp: updateTrackIdsToSSRCs(_this._tracksToSSRCs, answer.sdp)
|
|
28524
|
+
}) : answer;
|
|
28525
|
+
}, function (error) {
|
|
28526
|
+
_this._pendingRemoteOffer = null;
|
|
28527
|
+
throw error;
|
|
28528
|
+
});
|
|
28133
28529
|
}
|
|
28134
|
-
|
|
28135
|
-
return this._peerConnection.createOffer(options).then(function (offer) {
|
|
28136
|
-
// NOTE(mmalavalli): If createOffer() is called immediately after rolling back,
|
|
28137
|
-
// then we no longer need to retain the rolled back tracks to SSRCs Map.
|
|
28138
|
-
self._rolledBackTracksToSSRCs.clear();
|
|
28139
|
-
return new RTCSessionDescription({
|
|
28140
|
-
type: offer.type,
|
|
28141
|
-
sdp: updateTrackIdsToSSRCs(self._tracksToSSRCs, offer.sdp)
|
|
28142
|
-
});
|
|
28143
|
-
});
|
|
28144
|
-
};
|
|
28145
|
-
SafariRTCPeerConnection.prototype.createAnswer = function createAnswer(options) {
|
|
28146
|
-
var self = this;
|
|
28147
|
-
if (this._pendingRemoteOffer) {
|
|
28148
|
-
return this._peerConnection.setRemoteDescription(this._pendingRemoteOffer).then(function setRemoteDescriptionSucceeded() {
|
|
28149
|
-
self._signalingStateLatch.lower();
|
|
28150
|
-
return self._peerConnection.createAnswer();
|
|
28151
|
-
}).then(function createAnswerSucceeded(answer) {
|
|
28152
|
-
self._pendingRemoteOffer = null;
|
|
28530
|
+
return this._peerConnection.createAnswer(options).then(function (answer) {
|
|
28153
28531
|
// NOTE(mmalavalli): If createAnswer() is called immediately after rolling back, then we no
|
|
28154
28532
|
// longer need to retain the rolled back tracks to SSRCs Map.
|
|
28155
|
-
|
|
28533
|
+
_this._rolledBackTracksToSSRCs.clear();
|
|
28156
28534
|
return isUnifiedPlan ? new RTCSessionDescription({
|
|
28157
28535
|
type: answer.type,
|
|
28158
|
-
sdp: updateTrackIdsToSSRCs(
|
|
28536
|
+
sdp: updateTrackIdsToSSRCs(_this._tracksToSSRCs, answer.sdp)
|
|
28159
28537
|
}) : answer;
|
|
28160
|
-
}, function setRemoteDescriptionOrCreateAnswerFailed(error) {
|
|
28161
|
-
self._pendingRemoteOffer = null;
|
|
28162
|
-
throw error;
|
|
28163
28538
|
});
|
|
28164
|
-
}
|
|
28165
|
-
|
|
28166
|
-
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28172
|
-
|
|
28173
|
-
}
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
|
|
28183
|
-
|
|
28184
|
-
|
|
28185
|
-
|
|
28186
|
-
// then we need to restore the rolled back tracks to SSRCs Map.
|
|
28187
|
-
if (this._rolledBackTracksToSSRCs.size > 0) {
|
|
28188
|
-
this._tracksToSSRCs = new Map(this._rolledBackTracksToSSRCs);
|
|
28539
|
+
};
|
|
28540
|
+
SafariRTCPeerConnection.prototype.createDataChannel = function (label, dataChannelDict) {
|
|
28541
|
+
var dataChannel = this._peerConnection.createDataChannel(label, dataChannelDict);
|
|
28542
|
+
shimDataChannel(dataChannel);
|
|
28543
|
+
return dataChannel;
|
|
28544
|
+
};
|
|
28545
|
+
SafariRTCPeerConnection.prototype.removeTrack = function (sender) {
|
|
28546
|
+
sender.replaceTrack(null);
|
|
28547
|
+
this._peerConnection.removeTrack(sender);
|
|
28548
|
+
};
|
|
28549
|
+
SafariRTCPeerConnection.prototype.setLocalDescription = function (description) {
|
|
28550
|
+
// NOTE(mmalavalli): If setLocalDescription() is called immediately after rolling back,
|
|
28551
|
+
// then we need to restore the rolled back tracks to SSRCs Map.
|
|
28552
|
+
if (this._rolledBackTracksToSSRCs.size > 0) {
|
|
28553
|
+
this._tracksToSSRCs = new Map(this._rolledBackTracksToSSRCs);
|
|
28554
|
+
this._rolledBackTracksToSSRCs.clear();
|
|
28555
|
+
}
|
|
28556
|
+
return setDescription(this, true, description);
|
|
28557
|
+
};
|
|
28558
|
+
SafariRTCPeerConnection.prototype.setRemoteDescription = function (description) {
|
|
28559
|
+
// NOTE(mmalavalli): If setRemoteDescription() is called immediately after rolling back,
|
|
28560
|
+
// then we no longer need to retain the rolled back tracks to SSRCs Map.
|
|
28189
28561
|
this._rolledBackTracksToSSRCs.clear();
|
|
28190
|
-
|
|
28191
|
-
|
|
28192
|
-
|
|
28193
|
-
|
|
28194
|
-
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
self.dispatchEvent(new Event('iceconnectionstatechange'));
|
|
28208
|
-
self.dispatchEvent(new Event('signalingstatechange'));
|
|
28209
|
-
});
|
|
28210
|
-
};
|
|
28211
|
-
util.delegateMethods(RTCPeerConnection.prototype, SafariRTCPeerConnection.prototype, '_peerConnection');
|
|
28562
|
+
return setDescription(this, false, description);
|
|
28563
|
+
};
|
|
28564
|
+
SafariRTCPeerConnection.prototype.close = function () {
|
|
28565
|
+
var _this = this;
|
|
28566
|
+
if (this._isClosed) {
|
|
28567
|
+
return;
|
|
28568
|
+
}
|
|
28569
|
+
this._isClosed = true;
|
|
28570
|
+
this._peerConnection.close();
|
|
28571
|
+
setTimeout(function () {
|
|
28572
|
+
_this.dispatchEvent(new Event('iceconnectionstatechange'));
|
|
28573
|
+
_this.dispatchEvent(new Event('signalingstatechange'));
|
|
28574
|
+
});
|
|
28575
|
+
};
|
|
28576
|
+
return SafariRTCPeerConnection;
|
|
28577
|
+
}(EventTarget));
|
|
28578
|
+
delegateMethods(RTCPeerConnection.prototype, SafariRTCPeerConnection.prototype, '_peerConnection');
|
|
28212
28579
|
function setDescription(peerConnection, local, description) {
|
|
28213
28580
|
function setPendingLocalOffer(offer) {
|
|
28214
28581
|
if (local) {
|
|
@@ -28235,8 +28602,7 @@ function setDescription(peerConnection, local, description) {
|
|
|
28235
28602
|
}
|
|
28236
28603
|
else if (description.type === 'offer') {
|
|
28237
28604
|
if (peerConnection.signalingState !== intermediateState && peerConnection.signalingState !== 'stable') {
|
|
28238
|
-
return Promise.reject(new Error(
|
|
28239
|
-
' offer in state ' + peerConnection.signalingState));
|
|
28605
|
+
return Promise.reject(new Error("Cannot set " + (local ? 'local' : 'remote') + "\n offer in state " + peerConnection.signalingState));
|
|
28240
28606
|
}
|
|
28241
28607
|
if (!pendingLocalOffer && peerConnection._signalingStateLatch.state === 'low') {
|
|
28242
28608
|
peerConnection._signalingStateLatch.raise();
|
|
@@ -28245,16 +28611,13 @@ function setDescription(peerConnection, local, description) {
|
|
|
28245
28611
|
setPendingLocalOffer(description);
|
|
28246
28612
|
// Only dispatch a signalingstatechange event if we transitioned.
|
|
28247
28613
|
if (peerConnection.signalingState !== previousSignalingState) {
|
|
28248
|
-
return Promise.resolve().then(function
|
|
28249
|
-
peerConnection.dispatchEvent(new Event('signalingstatechange'));
|
|
28250
|
-
});
|
|
28614
|
+
return Promise.resolve().then(function () { return peerConnection.dispatchEvent(new Event('signalingstatechange')); });
|
|
28251
28615
|
}
|
|
28252
28616
|
return Promise.resolve();
|
|
28253
28617
|
}
|
|
28254
28618
|
else if (description.type === 'rollback') {
|
|
28255
28619
|
if (peerConnection.signalingState !== intermediateState) {
|
|
28256
|
-
return Promise.reject(new Error(
|
|
28257
|
-
(local ? 'local' : 'remote') + ' description in ' + peerConnection.signalingState));
|
|
28620
|
+
return Promise.reject(new Error("Cannot rollback \n " + (local ? 'local' : 'remote') + " description in " + peerConnection.signalingState));
|
|
28258
28621
|
}
|
|
28259
28622
|
clearPendingLocalOffer();
|
|
28260
28623
|
// NOTE(mmalavalli): We store the rolled back tracks to SSRCs Map here in case
|
|
@@ -28263,20 +28626,16 @@ function setDescription(peerConnection, local, description) {
|
|
|
28263
28626
|
// a glare scenario and this Map should be restored.
|
|
28264
28627
|
peerConnection._rolledBackTracksToSSRCs = new Map(peerConnection._tracksToSSRCs);
|
|
28265
28628
|
peerConnection._tracksToSSRCs = new Map(peerConnection._appliedTracksToSSRCs);
|
|
28266
|
-
return Promise.resolve().then(function
|
|
28267
|
-
peerConnection.dispatchEvent(new Event('signalingstatechange'));
|
|
28268
|
-
});
|
|
28629
|
+
return Promise.resolve().then(function () { return peerConnection.dispatchEvent(new Event('signalingstatechange')); });
|
|
28269
28630
|
}
|
|
28270
28631
|
return peerConnection._peerConnection[setLocalDescription](description);
|
|
28271
28632
|
}
|
|
28272
28633
|
function setRemoteAnswer(peerConnection, answer) {
|
|
28273
28634
|
var pendingLocalOffer = peerConnection._pendingLocalOffer;
|
|
28274
|
-
return peerConnection._peerConnection.setLocalDescription(pendingLocalOffer).then(function
|
|
28635
|
+
return peerConnection._peerConnection.setLocalDescription(pendingLocalOffer).then(function () {
|
|
28275
28636
|
peerConnection._pendingLocalOffer = null;
|
|
28276
28637
|
return peerConnection.setRemoteDescription(answer);
|
|
28277
|
-
}).then(function
|
|
28278
|
-
peerConnection._signalingStateLatch.lower();
|
|
28279
|
-
});
|
|
28638
|
+
}).then(function () { return peerConnection._signalingStateLatch.lower(); });
|
|
28280
28639
|
}
|
|
28281
28640
|
/**
|
|
28282
28641
|
* Whether a SafariRTCPeerConnection has any RTCRtpReceivers(s) for the given
|
|
@@ -28286,8 +28645,10 @@ function setRemoteAnswer(peerConnection, answer) {
|
|
|
28286
28645
|
* @returns {boolean}
|
|
28287
28646
|
*/
|
|
28288
28647
|
function hasReceiversForTracksOfKind(peerConnection, kind) {
|
|
28289
|
-
return !!peerConnection.getTransceivers().find(function (
|
|
28290
|
-
|
|
28648
|
+
return !!peerConnection.getTransceivers().find(function (_a) {
|
|
28649
|
+
var _b = _a.receiver, receiver = _b === void 0 ? {} : _b;
|
|
28650
|
+
var _c = receiver.track, track = _c === void 0 ? {} : _c;
|
|
28651
|
+
return track.kind === kind;
|
|
28291
28652
|
});
|
|
28292
28653
|
}
|
|
28293
28654
|
/**
|
|
@@ -28311,22 +28672,25 @@ function shimDataChannel(dataChannel) {
|
|
|
28311
28672
|
}
|
|
28312
28673
|
module.exports = SafariRTCPeerConnection;
|
|
28313
28674
|
|
|
28314
|
-
},{"../../
|
|
28675
|
+
},{"../../eventtarget":11,"../util":170,"../util/latch":171,"../util/sdp":172}],166:[function(require,module,exports){
|
|
28315
28676
|
'use strict';
|
|
28316
28677
|
/**
|
|
28317
28678
|
* RTCRtpSender shim.
|
|
28318
28679
|
* @param {MediaStreamTrack} track
|
|
28319
28680
|
* @property {MediaStreamTrack} track
|
|
28320
28681
|
*/
|
|
28321
|
-
|
|
28322
|
-
|
|
28323
|
-
|
|
28324
|
-
|
|
28325
|
-
|
|
28326
|
-
|
|
28327
|
-
|
|
28328
|
-
|
|
28329
|
-
}
|
|
28682
|
+
var RTCRtpSenderShim = /** @class */ (function () {
|
|
28683
|
+
function RTCRtpSenderShim(track) {
|
|
28684
|
+
Object.defineProperties(this, {
|
|
28685
|
+
track: {
|
|
28686
|
+
enumerable: true,
|
|
28687
|
+
value: track,
|
|
28688
|
+
writable: true
|
|
28689
|
+
}
|
|
28690
|
+
});
|
|
28691
|
+
}
|
|
28692
|
+
return RTCRtpSenderShim;
|
|
28693
|
+
}());
|
|
28330
28694
|
// NOTE(mmalavalli): Because of the way we will be using this shim, there
|
|
28331
28695
|
// are a couple of use cases that will not be covered:
|
|
28332
28696
|
//
|
|
@@ -28349,7 +28713,7 @@ function RTCRtpSenderShim(track) {
|
|
|
28349
28713
|
// using the RTCRtpSender APIs.
|
|
28350
28714
|
module.exports = RTCRtpSenderShim;
|
|
28351
28715
|
|
|
28352
|
-
},{}],
|
|
28716
|
+
},{}],167:[function(require,module,exports){
|
|
28353
28717
|
/* globals RTCSessionDescription */
|
|
28354
28718
|
'use strict';
|
|
28355
28719
|
// This class wraps Chrome's RTCSessionDescription implementation. It provides
|
|
@@ -28358,40 +28722,47 @@ module.exports = RTCRtpSenderShim;
|
|
|
28358
28722
|
// 1. Rollback support
|
|
28359
28723
|
// https://bugs.chromium.org/p/webrtc/issues/detail?id=4676
|
|
28360
28724
|
//
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28725
|
+
var ChromeRTCSessionDescription = /** @class */ (function () {
|
|
28726
|
+
function ChromeRTCSessionDescription(descriptionInitDict) {
|
|
28727
|
+
this.descriptionInitDict = descriptionInitDict;
|
|
28728
|
+
// If this constructor is called with an object with a .type property set to
|
|
28729
|
+
// "rollback", we should not call Chrome's RTCSessionDescription constructor,
|
|
28730
|
+
// because this would throw an RTCSdpType error.
|
|
28731
|
+
var description = descriptionInitDict && descriptionInitDict.type === 'rollback'
|
|
28732
|
+
? null
|
|
28733
|
+
: new RTCSessionDescription(descriptionInitDict);
|
|
28734
|
+
Object.defineProperties(this, {
|
|
28735
|
+
_description: {
|
|
28736
|
+
get: function () {
|
|
28737
|
+
return description;
|
|
28738
|
+
}
|
|
28375
28739
|
}
|
|
28740
|
+
});
|
|
28741
|
+
}
|
|
28742
|
+
Object.defineProperty(ChromeRTCSessionDescription.prototype, "sdp", {
|
|
28743
|
+
get: function () {
|
|
28744
|
+
return this._description ? this._description.sdp : this.descriptionInitDict.sdp;
|
|
28376
28745
|
},
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
28746
|
+
enumerable: false,
|
|
28747
|
+
configurable: true
|
|
28748
|
+
});
|
|
28749
|
+
Object.defineProperty(ChromeRTCSessionDescription.prototype, "type", {
|
|
28750
|
+
get: function () {
|
|
28751
|
+
return this._description ? this._description.type : this.descriptionInitDict.type;
|
|
28380
28752
|
},
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
value: description ? description.type : descriptionInitDict.type
|
|
28384
|
-
}
|
|
28753
|
+
enumerable: false,
|
|
28754
|
+
configurable: true
|
|
28385
28755
|
});
|
|
28386
|
-
|
|
28756
|
+
return ChromeRTCSessionDescription;
|
|
28757
|
+
}());
|
|
28387
28758
|
module.exports = ChromeRTCSessionDescription;
|
|
28388
28759
|
|
|
28389
|
-
},{}],
|
|
28760
|
+
},{}],168:[function(require,module,exports){
|
|
28390
28761
|
/* globals RTCSessionDescription */
|
|
28391
28762
|
'use strict';
|
|
28392
28763
|
module.exports = RTCSessionDescription;
|
|
28393
28764
|
|
|
28394
|
-
},{}],
|
|
28765
|
+
},{}],169:[function(require,module,exports){
|
|
28395
28766
|
/* globals RTCSessionDescription */
|
|
28396
28767
|
'use strict';
|
|
28397
28768
|
if (typeof RTCSessionDescription === 'function') {
|
|
@@ -28414,43 +28785,29 @@ else {
|
|
|
28414
28785
|
};
|
|
28415
28786
|
}
|
|
28416
28787
|
|
|
28417
|
-
},{"../util":170,"./chrome":
|
|
28788
|
+
},{"../util":170,"./chrome":167,"./firefox":168}],170:[function(require,module,exports){
|
|
28418
28789
|
'use strict';
|
|
28419
|
-
var
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28790
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
28791
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
28792
|
+
if (!m) return o;
|
|
28793
|
+
var i = m.call(o), r, ar = [], e;
|
|
28794
|
+
try {
|
|
28795
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
28796
|
+
}
|
|
28797
|
+
catch (error) { e = { error: error }; }
|
|
28798
|
+
finally {
|
|
28799
|
+
try {
|
|
28800
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28428
28801
|
}
|
|
28429
|
-
|
|
28430
|
-
}
|
|
28431
|
-
|
|
28432
|
-
* Dispatch an Event to the {@link EventTarget}.
|
|
28433
|
-
* @param {Event} event
|
|
28434
|
-
*/
|
|
28435
|
-
EventTarget.prototype.dispatchEvent = function dispatchEvent(event) {
|
|
28436
|
-
return this._eventEmitter.emit(event.type, event);
|
|
28437
|
-
};
|
|
28438
|
-
/**
|
|
28439
|
-
* Add an Event listener to the {@link EventTarget}.
|
|
28440
|
-
*/
|
|
28441
|
-
EventTarget.prototype.addEventListener = function addEventListener() {
|
|
28442
|
-
return this._eventEmitter.addListener.apply(this._eventEmitter, arguments);
|
|
28802
|
+
finally { if (e) throw e.error; }
|
|
28803
|
+
}
|
|
28804
|
+
return ar;
|
|
28443
28805
|
};
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
|
|
28448
|
-
return this._eventEmitter.removeListener.apply(this._eventEmitter, arguments);
|
|
28806
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
28807
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
28808
|
+
to[j] = from[i];
|
|
28809
|
+
return to;
|
|
28449
28810
|
};
|
|
28450
|
-
module.exports = EventTarget;
|
|
28451
|
-
|
|
28452
|
-
},{"events":173}],170:[function(require,module,exports){
|
|
28453
|
-
'use strict';
|
|
28454
28811
|
/**
|
|
28455
28812
|
* Create a {@link Deferred}.
|
|
28456
28813
|
* @returns {Deferred}
|
|
@@ -28557,10 +28914,7 @@ function flatMap(list, mapFn) {
|
|
|
28557
28914
|
var listArray = list instanceof Map || list instanceof Set
|
|
28558
28915
|
? Array.from(list.values())
|
|
28559
28916
|
: list;
|
|
28560
|
-
return listArray.reduce(function (flattened, item) {
|
|
28561
|
-
var mapped = mapFn(item);
|
|
28562
|
-
return flattened.concat(mapped);
|
|
28563
|
-
}, []);
|
|
28917
|
+
return listArray.reduce(function (flattened, item) { return flattened.concat(mapFn(item)); }, []);
|
|
28564
28918
|
}
|
|
28565
28919
|
/**
|
|
28566
28920
|
* Get the browser's user agent, if available.
|
|
@@ -28608,8 +28962,8 @@ function guessBrowserVersion(userAgent) {
|
|
|
28608
28962
|
if (!prefix) {
|
|
28609
28963
|
return null;
|
|
28610
28964
|
}
|
|
28611
|
-
var regex = new RegExp(
|
|
28612
|
-
var
|
|
28965
|
+
var regex = new RegExp("(" + prefix + ")/([^\\s]+)");
|
|
28966
|
+
var _a = __read(userAgent.match(regex) || [], 3), match = _a[2];
|
|
28613
28967
|
if (!match) {
|
|
28614
28968
|
return null;
|
|
28615
28969
|
}
|
|
@@ -28665,14 +29019,9 @@ function interceptEvent(target, type) {
|
|
|
28665
29019
|
* @returns {Promise<undefined>}
|
|
28666
29020
|
*/
|
|
28667
29021
|
function legacyPromise(promise, onSuccess, onFailure) {
|
|
28668
|
-
|
|
28669
|
-
|
|
28670
|
-
|
|
28671
|
-
}, function (error) {
|
|
28672
|
-
onFailure(error);
|
|
28673
|
-
});
|
|
28674
|
-
}
|
|
28675
|
-
return promise;
|
|
29022
|
+
return onSuccess
|
|
29023
|
+
? promise.then(onSuccess, onFailure)
|
|
29024
|
+
: promise;
|
|
28676
29025
|
}
|
|
28677
29026
|
/**
|
|
28678
29027
|
* Make a unique ID.
|
|
@@ -28718,7 +29067,11 @@ function proxyProperty(source, wrapper, target, propertyName) {
|
|
|
28718
29067
|
writable: true
|
|
28719
29068
|
});
|
|
28720
29069
|
target.addEventListener(propertyName.slice(2), function () {
|
|
28721
|
-
|
|
29070
|
+
var args = [];
|
|
29071
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
29072
|
+
args[_i] = arguments[_i];
|
|
29073
|
+
}
|
|
29074
|
+
return wrapper.dispatchEvent.apply(wrapper, __spreadArray([], __read(args)));
|
|
28722
29075
|
});
|
|
28723
29076
|
return;
|
|
28724
29077
|
}
|
|
@@ -28772,103 +29125,103 @@ var states = {
|
|
|
28772
29125
|
* transitioning between them ({@link Latch#raise} and {@link Latch#lower}).
|
|
28773
29126
|
* @param {string} [initialState="low"] - either "high" or "low"
|
|
28774
29127
|
*/
|
|
28775
|
-
|
|
28776
|
-
|
|
28777
|
-
|
|
28778
|
-
|
|
28779
|
-
|
|
28780
|
-
|
|
28781
|
-
|
|
28782
|
-
|
|
28783
|
-
|
|
28784
|
-
|
|
28785
|
-
|
|
28786
|
-
|
|
28787
|
-
|
|
28788
|
-
}
|
|
28789
|
-
|
|
29128
|
+
var Latch = /** @class */ (function () {
|
|
29129
|
+
function Latch(initialState) {
|
|
29130
|
+
if (initialState === void 0) { initialState = 'low'; }
|
|
29131
|
+
var state = initialState;
|
|
29132
|
+
Object.defineProperties(this, {
|
|
29133
|
+
_state: {
|
|
29134
|
+
set: function (_state) {
|
|
29135
|
+
var _this = this;
|
|
29136
|
+
if (state !== _state) {
|
|
29137
|
+
state = _state;
|
|
29138
|
+
var whenDeferreds = this._whenDeferreds.get(state);
|
|
29139
|
+
whenDeferreds.forEach(function (deferred) { return deferred.resolve(_this); });
|
|
29140
|
+
whenDeferreds.clear();
|
|
29141
|
+
}
|
|
29142
|
+
},
|
|
29143
|
+
get: function () {
|
|
29144
|
+
return state;
|
|
28790
29145
|
}
|
|
28791
29146
|
},
|
|
28792
|
-
|
|
28793
|
-
|
|
29147
|
+
_whenDeferreds: {
|
|
29148
|
+
value: new Map([
|
|
29149
|
+
['high', new Set()],
|
|
29150
|
+
['low', new Set()]
|
|
29151
|
+
])
|
|
28794
29152
|
}
|
|
29153
|
+
});
|
|
29154
|
+
}
|
|
29155
|
+
Object.defineProperty(Latch.prototype, "state", {
|
|
29156
|
+
get: function () {
|
|
29157
|
+
return this._state;
|
|
28795
29158
|
},
|
|
28796
|
-
|
|
28797
|
-
|
|
28798
|
-
['high', new Set()],
|
|
28799
|
-
['low', new Set()]
|
|
28800
|
-
])
|
|
28801
|
-
},
|
|
28802
|
-
state: {
|
|
28803
|
-
enumerable: true,
|
|
28804
|
-
get: function () {
|
|
28805
|
-
return this._state;
|
|
28806
|
-
}
|
|
28807
|
-
}
|
|
29159
|
+
enumerable: false,
|
|
29160
|
+
configurable: true
|
|
28808
29161
|
});
|
|
28809
|
-
|
|
28810
|
-
|
|
28811
|
-
|
|
28812
|
-
|
|
28813
|
-
|
|
28814
|
-
|
|
28815
|
-
|
|
28816
|
-
|
|
28817
|
-
|
|
28818
|
-
|
|
28819
|
-
|
|
28820
|
-
|
|
28821
|
-
|
|
28822
|
-
|
|
28823
|
-
|
|
28824
|
-
|
|
28825
|
-
|
|
28826
|
-
|
|
28827
|
-
|
|
28828
|
-
|
|
28829
|
-
|
|
28830
|
-
|
|
28831
|
-
|
|
28832
|
-
|
|
28833
|
-
|
|
28834
|
-
|
|
28835
|
-
|
|
28836
|
-
|
|
28837
|
-
|
|
28838
|
-
|
|
28839
|
-
|
|
28840
|
-
|
|
28841
|
-
|
|
28842
|
-
|
|
28843
|
-
|
|
28844
|
-
|
|
28845
|
-
|
|
28846
|
-
|
|
28847
|
-
|
|
28848
|
-
|
|
28849
|
-
|
|
28850
|
-
|
|
28851
|
-
|
|
28852
|
-
|
|
28853
|
-
|
|
28854
|
-
|
|
28855
|
-
|
|
29162
|
+
/**
|
|
29163
|
+
* Transition to "low".
|
|
29164
|
+
* @returns {this}
|
|
29165
|
+
* @throws {Error}
|
|
29166
|
+
*/
|
|
29167
|
+
Latch.prototype.lower = function () {
|
|
29168
|
+
return this.transition('low');
|
|
29169
|
+
};
|
|
29170
|
+
/**
|
|
29171
|
+
* Transition to "high".
|
|
29172
|
+
* @returns {this}
|
|
29173
|
+
* @throws {Error}
|
|
29174
|
+
*/
|
|
29175
|
+
Latch.prototype.raise = function () {
|
|
29176
|
+
return this.transition('high');
|
|
29177
|
+
};
|
|
29178
|
+
/**
|
|
29179
|
+
* Transition to a new state.
|
|
29180
|
+
* @param {string} newState
|
|
29181
|
+
* @returns {this}
|
|
29182
|
+
* @throws {Error}
|
|
29183
|
+
*/
|
|
29184
|
+
Latch.prototype.transition = function (newState) {
|
|
29185
|
+
if (!states[this.state].has(newState)) {
|
|
29186
|
+
throw createUnreachableStateError(this.state, newState);
|
|
29187
|
+
}
|
|
29188
|
+
this._state = newState;
|
|
29189
|
+
return this;
|
|
29190
|
+
};
|
|
29191
|
+
/**
|
|
29192
|
+
* Return a Promise that resolves when the {@link Latch} transitions to
|
|
29193
|
+
* the specified state.
|
|
29194
|
+
* @param {string} state
|
|
29195
|
+
* @returns {Promise<this>}
|
|
29196
|
+
*/
|
|
29197
|
+
Latch.prototype.when = function (state) {
|
|
29198
|
+
if (this.state === state) {
|
|
29199
|
+
return Promise.resolve(this);
|
|
29200
|
+
}
|
|
29201
|
+
if (!states[this.state].has(state)) {
|
|
29202
|
+
return Promise.reject(createUnreachableStateError(this.state, state));
|
|
29203
|
+
}
|
|
29204
|
+
var deferred = defer();
|
|
29205
|
+
this._whenDeferreds.get(state).add(deferred);
|
|
29206
|
+
return deferred.promise;
|
|
29207
|
+
};
|
|
29208
|
+
return Latch;
|
|
29209
|
+
}());
|
|
28856
29210
|
/**
|
|
28857
|
-
|
|
28858
|
-
|
|
28859
|
-
|
|
28860
|
-
|
|
28861
|
-
|
|
29211
|
+
* Create an unreachable state Error.
|
|
29212
|
+
* @param {string} from - state to be transitioned from
|
|
29213
|
+
* @param {string} to - state to be transitioned to
|
|
29214
|
+
* @return {Error}
|
|
29215
|
+
*/
|
|
28862
29216
|
function createUnreachableStateError(from, to) {
|
|
28863
|
-
return new Error(
|
|
29217
|
+
return new Error("Cannot transition from \"" + from + "\" to \"" + to + "\"");
|
|
28864
29218
|
}
|
|
28865
29219
|
module.exports = Latch;
|
|
28866
29220
|
|
|
28867
29221
|
},{"./":170}],172:[function(require,module,exports){
|
|
28868
29222
|
/* globals RTCPeerConnection, RTCRtpTransceiver */
|
|
28869
29223
|
'use strict';
|
|
28870
|
-
var
|
|
28871
|
-
var guessBrowser = require('./').guessBrowser;
|
|
29224
|
+
var _a = require('./'), flatMap = _a.flatMap, guessBrowser = _a.guessBrowser;
|
|
28872
29225
|
// NOTE(mmalavalli): We cache Chrome's sdpSemantics support in order to prevent
|
|
28873
29226
|
// instantiation of more than one RTCPeerConnection.
|
|
28874
29227
|
var isSdpSemanticsSupported = null;
|
|
@@ -29009,7 +29362,7 @@ function getUnifiedPlanTrackIds(sdp) {
|
|
|
29009
29362
|
* @returns {Set<string>}
|
|
29010
29363
|
*/
|
|
29011
29364
|
function getPlanBSSRCs(sdp, trackId) {
|
|
29012
|
-
var pattern =
|
|
29365
|
+
var pattern = "^a=ssrc:([0-9]+) +msid:[^ ]+ +" + trackId + " *$";
|
|
29013
29366
|
return getMatches(pattern, sdp);
|
|
29014
29367
|
}
|
|
29015
29368
|
/**
|
|
@@ -29020,13 +29373,11 @@ function getPlanBSSRCs(sdp, trackId) {
|
|
|
29020
29373
|
* @returns {Array<string>} mediaSections
|
|
29021
29374
|
*/
|
|
29022
29375
|
function getMediaSections(sdp, kind, direction) {
|
|
29023
|
-
kind
|
|
29024
|
-
direction
|
|
29025
|
-
return sdp.split('\r\nm=').slice(1).map(function (mediaSection) {
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
var kindPattern = new RegExp('m=' + kind, 'gm');
|
|
29029
|
-
var directionPattern = new RegExp('a=' + direction, 'gm');
|
|
29376
|
+
if (kind === void 0) { kind = '.*'; }
|
|
29377
|
+
if (direction === void 0) { direction = '.*'; }
|
|
29378
|
+
return sdp.split('\r\nm=').slice(1).map(function (mediaSection) { return "m=" + mediaSection; }).filter(function (mediaSection) {
|
|
29379
|
+
var kindPattern = new RegExp("m=" + kind, 'gm');
|
|
29380
|
+
var directionPattern = new RegExp("a=" + direction, 'gm');
|
|
29030
29381
|
return kindPattern.test(mediaSection) && directionPattern.test(mediaSection);
|
|
29031
29382
|
});
|
|
29032
29383
|
}
|
|
@@ -29046,10 +29397,8 @@ function getMediaSectionSSRCs(mediaSection) {
|
|
|
29046
29397
|
*/
|
|
29047
29398
|
function getUnifiedPlanSSRCs(sdp, trackId) {
|
|
29048
29399
|
var mediaSections = getMediaSections(sdp);
|
|
29049
|
-
var msidAttrRegExp = new RegExp(
|
|
29050
|
-
var matchingMediaSections = mediaSections.filter(function (mediaSection) {
|
|
29051
|
-
return mediaSection.match(msidAttrRegExp);
|
|
29052
|
-
});
|
|
29400
|
+
var msidAttrRegExp = new RegExp("^a=msid:[^ ]+ +" + trackId + " *$", 'gm');
|
|
29401
|
+
var matchingMediaSections = mediaSections.filter(function (mediaSection) { return mediaSection.match(msidAttrRegExp); });
|
|
29053
29402
|
return new Set(flatMap(matchingMediaSections, getMediaSectionSSRCs));
|
|
29054
29403
|
}
|
|
29055
29404
|
/**
|
|
@@ -29060,9 +29409,7 @@ function getUnifiedPlanSSRCs(sdp, trackId) {
|
|
|
29060
29409
|
* @returns {Map<string, Set<string>>} trackIdsToSSRCs
|
|
29061
29410
|
*/
|
|
29062
29411
|
function getTrackIdsToSSRCs(getTrackIds, getSSRCs, sdp) {
|
|
29063
|
-
return new Map(Array.from(getTrackIds(sdp)).map(function (trackId) {
|
|
29064
|
-
return [trackId, getSSRCs(sdp, trackId)];
|
|
29065
|
-
}));
|
|
29412
|
+
return new Map(Array.from(getTrackIds(sdp)).map(function (trackId) { return [trackId, getSSRCs(sdp, trackId)]; }));
|
|
29066
29413
|
}
|
|
29067
29414
|
/**
|
|
29068
29415
|
* Get a Map from MediaStreamTrack IDs to SSRCs from a Plan B SDP.
|
|
@@ -29103,8 +29450,8 @@ function updateTrackIdsToSSRCs(getTrackIdsToSSRCs, trackIdsToSSRCs, sdp) {
|
|
|
29103
29450
|
oldSSRCs.forEach(function (oldSSRC, i) {
|
|
29104
29451
|
var newSSRC = newSSRCs[i];
|
|
29105
29452
|
newSSRCsToOldSSRCs.set(newSSRC, oldSSRC);
|
|
29106
|
-
var pattern =
|
|
29107
|
-
var replacement =
|
|
29453
|
+
var pattern = "^a=ssrc:" + newSSRC + " (.*)$";
|
|
29454
|
+
var replacement = "a=ssrc:" + oldSSRC + " $1";
|
|
29108
29455
|
sdp = sdp.replace(new RegExp(pattern, 'gm'), replacement);
|
|
29109
29456
|
});
|
|
29110
29457
|
});
|
|
@@ -29662,7 +30009,7 @@ module.exports={
|
|
|
29662
30009
|
"name": "twilio-video",
|
|
29663
30010
|
"title": "Twilio Video",
|
|
29664
30011
|
"description": "Twilio Video JavaScript Library",
|
|
29665
|
-
"version": "2.
|
|
30012
|
+
"version": "2.26.0",
|
|
29666
30013
|
"homepage": "https://twilio.com",
|
|
29667
30014
|
"author": "Mark Andrus Roberts <mroberts@twilio.com>",
|
|
29668
30015
|
"contributors": [
|
|
@@ -29713,7 +30060,7 @@ module.exports={
|
|
|
29713
30060
|
"jsdoc": "^3.5.5",
|
|
29714
30061
|
"jsdoc-babel": "^0.5.0",
|
|
29715
30062
|
"json-loader": "^0.5.7",
|
|
29716
|
-
"karma": "
|
|
30063
|
+
"karma": "6.4.1",
|
|
29717
30064
|
"karma-browserify": "^8.0.0",
|
|
29718
30065
|
"karma-chrome-launcher": "^2.0.0",
|
|
29719
30066
|
"karma-edgium-launcher": "^4.0.0-0",
|
|
@@ -29819,9 +30166,9 @@ module.exports={
|
|
|
29819
30166
|
},{}],175:[function(require,module,exports){
|
|
29820
30167
|
module.exports = WebSocket;
|
|
29821
30168
|
|
|
29822
|
-
},{}]},{},[
|
|
30169
|
+
},{}]},{},[12]);
|
|
29823
30170
|
;
|
|
29824
|
-
var Video = bundle(
|
|
30171
|
+
var Video = bundle(12);
|
|
29825
30172
|
/* globals define */
|
|
29826
30173
|
if (typeof define === 'function' && define.amd) {
|
|
29827
30174
|
define([], function() { return Video; });
|