twilio-video 2.21.3 → 2.22.2
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 +83 -1
- package/COMMON_ISSUES.md +34 -0
- package/README.md +1 -1
- package/dist/twilio-video.js +377 -116
- package/dist/twilio-video.min.js +20 -20
- package/es5/connect.js +9 -0
- package/es5/connect.js.map +1 -1
- package/es5/localparticipant.js +57 -33
- package/es5/localparticipant.js.map +1 -1
- package/es5/media/track/localtrackpublication.js +56 -4
- package/es5/media/track/localtrackpublication.js.map +1 -1
- package/es5/room.js +59 -0
- package/es5/room.js.map +1 -1
- package/es5/signaling/v2/cancelableroomsignalingpromise.js +2 -1
- package/es5/signaling/v2/cancelableroomsignalingpromise.js.map +1 -1
- package/es5/signaling/v2/localparticipant.js +13 -1
- package/es5/signaling/v2/localparticipant.js.map +1 -1
- package/es5/signaling/v2/localtrackpublication.js +38 -2
- package/es5/signaling/v2/localtrackpublication.js.map +1 -1
- package/es5/signaling/v2/peerconnection.js +23 -7
- package/es5/signaling/v2/peerconnection.js.map +1 -1
- package/es5/signaling/v2/room.js +9 -0
- package/es5/signaling/v2/room.js.map +1 -1
- package/es5/signaling/v2/twilioconnectiontransport.js +8 -1
- package/es5/signaling/v2/twilioconnectiontransport.js.map +1 -1
- package/es5/util/index.js +11 -0
- package/es5/util/index.js.map +1 -1
- package/es5/util/support.js +2 -0
- package/es5/util/support.js.map +1 -1
- package/es5/util/twiliowarning.js +12 -0
- package/es5/util/twiliowarning.js.map +1 -0
- package/es5/webrtc/util/sdp.js +10 -1
- package/es5/webrtc/util/sdp.js.map +1 -1
- package/lib/connect.js +9 -0
- package/lib/localparticipant.js +64 -37
- package/lib/media/track/localtrackpublication.js +32 -4
- package/lib/room.js +53 -0
- package/lib/signaling/v2/cancelableroomsignalingpromise.js +2 -0
- package/lib/signaling/v2/localparticipant.js +15 -1
- package/lib/signaling/v2/localtrackpublication.js +38 -1
- package/lib/signaling/v2/peerconnection.js +22 -7
- package/lib/signaling/v2/room.js +10 -0
- package/lib/signaling/v2/twilioconnectiontransport.js +10 -0
- package/lib/util/index.js +11 -0
- package/lib/util/support.js +2 -0
- package/lib/util/twiliowarning.js +13 -0
- package/lib/webrtc/util/sdp.js +11 -1
- package/package.json +2 -1
- package/tsdef/LocalParticipant.d.ts +2 -0
- package/tsdef/LocalTrackPublication.d.ts +2 -0
- package/tsdef/Room.d.ts +4 -1
- package/tsdef/twilio-video-tests.ts +38 -0
- package/tsdef/types.d.ts +3 -0
package/dist/twilio-video.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! twilio-video.js 2.
|
|
1
|
+
/*! twilio-video.js 2.22.2
|
|
2
2
|
|
|
3
3
|
The following license applies to all parts of this software except as
|
|
4
4
|
documented below.
|
|
@@ -495,6 +495,15 @@ function connect(token, options) {
|
|
|
495
495
|
* for the {@link LocalParticipant} to {@link NetworkQualityVerbosity}<code style="padding:0 0">#minimal</code>
|
|
496
496
|
* and the {@link NetworkQualityVerbosity} for {@link RemoteParticipant}s to
|
|
497
497
|
* {@link NetworkQualityVerbosity}<code style="padding:0 0">#none</code>.
|
|
498
|
+
* @property {Array<string>} [notifyWarnings=[]] - The SDK raises warning events when it
|
|
499
|
+
* detects certain conditions. You can implement callbacks on these events to act on them, or to alert
|
|
500
|
+
* the user of an issue. Subsequently, "warningsCleared" event is raised when conditions have returned
|
|
501
|
+
* to normal. You can listen to these events by specifying an array of warning. By default,
|
|
502
|
+
* this array is empty and no warning events will be raised.
|
|
503
|
+
* Possible values include <code>recording-media-lost</code>, which is raised when the media server
|
|
504
|
+
* has not detected any media on the published track that is being recorded in the past 30 seconds.
|
|
505
|
+
* This usually happens when there are network interruptions or when the track has stopped.
|
|
506
|
+
* This warning is raised by {@link LocalTrackPublication}, {@link LocalParticipant}, and {@link Room} object.
|
|
498
507
|
* @property {string} [region='gll'] - Preferred signaling region; By default, you will be connected to the
|
|
499
508
|
* nearest signaling server determined by latency based routing. Setting a value other
|
|
500
509
|
* than <code style="padding:0 0">gll</code> bypasses routing and guarantees that signaling traffic will be
|
|
@@ -990,7 +999,7 @@ function normalizeCodecSettings(nameOrSettings) {
|
|
|
990
999
|
}
|
|
991
1000
|
module.exports = connect;
|
|
992
1001
|
|
|
993
|
-
},{"./cancelableroompromise":1,"./encodingparameters":9,"./localparticipant":12,"./media/track/es5":14,"./networkqualityconfiguration":42,"./room":54,"./signaling/v2":68,"./util":128,"./util/cancelablepromise":121,"./util/constants":122,"./util/eventobserver":126,"./util/insightspublisher":129,"./util/insightspublisher/null":130,"./util/log":132,"./util/validate":
|
|
1002
|
+
},{"./cancelableroompromise":1,"./encodingparameters":9,"./localparticipant":12,"./media/track/es5":14,"./networkqualityconfiguration":42,"./room":54,"./signaling/v2":68,"./util":128,"./util/cancelablepromise":121,"./util/constants":122,"./util/eventobserver":126,"./util/insightspublisher":129,"./util/insightspublisher/null":130,"./util/log":132,"./util/validate":146,"./webrtc":154,"./webrtc/util":167}],3:[function(require,module,exports){
|
|
994
1003
|
'use strict';
|
|
995
1004
|
var _a = require('./util/constants'), DEFAULT_LOG_LEVEL = _a.DEFAULT_LOG_LEVEL, DEFAULT_LOGGER_NAME = _a.DEFAULT_LOGGER_NAME;
|
|
996
1005
|
/**
|
|
@@ -1322,7 +1331,7 @@ function createLocalTracks(options) {
|
|
|
1322
1331
|
}
|
|
1323
1332
|
exports.createLocalTracks = createLocalTracks;
|
|
1324
1333
|
|
|
1325
|
-
},{"./media/track/es5":14,"./util":128,"./util/constants":122,"./util/log":132,"./webaudio/workaround180748":
|
|
1334
|
+
},{"./media/track/es5":14,"./util":128,"./util/constants":122,"./util/log":132,"./webaudio/workaround180748":151,"./webrtc":154}],5:[function(require,module,exports){
|
|
1326
1335
|
'use strict';
|
|
1327
1336
|
var __extends = (this && this.__extends) || (function () {
|
|
1328
1337
|
var extendStatics = function (d, b) {
|
|
@@ -1678,7 +1687,7 @@ var DataTransport = /** @class */ (function (_super) {
|
|
|
1678
1687
|
*/
|
|
1679
1688
|
module.exports = DataTransport;
|
|
1680
1689
|
|
|
1681
|
-
},{"events":
|
|
1690
|
+
},{"events":170}],9:[function(require,module,exports){
|
|
1682
1691
|
'use strict';
|
|
1683
1692
|
var __extends = (this && this.__extends) || (function () {
|
|
1684
1693
|
var extendStatics = function (d, b) {
|
|
@@ -1776,13 +1785,13 @@ var EncodingParametersImpl = /** @class */ (function (_super) {
|
|
|
1776
1785
|
*/
|
|
1777
1786
|
module.exports = EncodingParametersImpl;
|
|
1778
1787
|
|
|
1779
|
-
},{"events":
|
|
1788
|
+
},{"events":170}],10:[function(require,module,exports){
|
|
1780
1789
|
'use strict';
|
|
1781
1790
|
var EventEmitter = require('events').EventEmitter;
|
|
1782
1791
|
var hidePrivateAndCertainPublicPropertiesInClass = require('./util').hidePrivateAndCertainPublicPropertiesInClass;
|
|
1783
1792
|
module.exports = hidePrivateAndCertainPublicPropertiesInClass(EventEmitter, ['domain']);
|
|
1784
1793
|
|
|
1785
|
-
},{"./util":128,"events":
|
|
1794
|
+
},{"./util":128,"events":170}],11:[function(require,module,exports){
|
|
1786
1795
|
'use strict';
|
|
1787
1796
|
var __assign = (this && this.__assign) || function () {
|
|
1788
1797
|
__assign = Object.assign || function(t) {
|
|
@@ -1856,7 +1865,7 @@ module.exports = {
|
|
|
1856
1865
|
LocalDataTrack: LocalDataTrack
|
|
1857
1866
|
};
|
|
1858
1867
|
|
|
1859
|
-
},{"../package.json":
|
|
1868
|
+
},{"../package.json":171,"./connect":2,"./createlocaltrack":3,"./createlocaltracks":4,"./media/track/es5":14,"./preflight/preflighttest":48,"./util/support":141,"./vendor/loglevel":148}],12:[function(require,module,exports){
|
|
1860
1869
|
'use strict';
|
|
1861
1870
|
var __extends = (this && this.__extends) || (function () {
|
|
1862
1871
|
var extendStatics = function (d, b) {
|
|
@@ -1906,6 +1915,8 @@ var Participant = require('./participant');
|
|
|
1906
1915
|
* @emits LocalParticipant#trackPublished
|
|
1907
1916
|
* @emits LocalParticipant#trackStarted
|
|
1908
1917
|
* @emits LocalParticipant#trackStopped
|
|
1918
|
+
* @emits LocalParticipant#trackWarning
|
|
1919
|
+
* @emits LocalParticipant#trackWarningsCleared
|
|
1909
1920
|
*/
|
|
1910
1921
|
var LocalParticipant = /** @class */ (function (_super) {
|
|
1911
1922
|
__extends(LocalParticipant, _super);
|
|
@@ -2034,59 +2045,47 @@ var LocalParticipant = /** @class */ (function (_super) {
|
|
|
2034
2045
|
if (this.state === 'disconnected') {
|
|
2035
2046
|
return;
|
|
2036
2047
|
}
|
|
2037
|
-
var
|
|
2038
|
-
|
|
2039
|
-
var trackSignaling = signaling.getPublication(localTrack._trackSender);
|
|
2048
|
+
var localTrackDisabled = function (localTrack) {
|
|
2049
|
+
var trackSignaling = _this._signaling.getPublication(localTrack._trackSender);
|
|
2040
2050
|
if (trackSignaling) {
|
|
2041
2051
|
trackSignaling.disable();
|
|
2042
2052
|
log.debug("Disabled the " + trackClass(localTrack, true) + ":", localTrack.id);
|
|
2043
2053
|
}
|
|
2044
|
-
}
|
|
2045
|
-
function
|
|
2046
|
-
var trackSignaling =
|
|
2054
|
+
};
|
|
2055
|
+
var localTrackEnabled = function (localTrack) {
|
|
2056
|
+
var trackSignaling = _this._signaling.getPublication(localTrack._trackSender);
|
|
2047
2057
|
if (trackSignaling) {
|
|
2048
2058
|
trackSignaling.enable();
|
|
2049
2059
|
log.debug("Enabled the " + trackClass(localTrack, true) + ":", localTrack.id);
|
|
2050
2060
|
}
|
|
2051
|
-
}
|
|
2052
|
-
function
|
|
2061
|
+
};
|
|
2062
|
+
var localTrackStopped = function (localTrack) {
|
|
2053
2063
|
// NOTE(mroberts): We shouldn't need to check for `stop`, since DataTracks
|
|
2054
2064
|
// do not emit "stopped".
|
|
2055
|
-
var trackSignaling =
|
|
2065
|
+
var trackSignaling = _this._signaling.getPublication(localTrack._trackSender);
|
|
2056
2066
|
if (trackSignaling) {
|
|
2057
2067
|
trackSignaling.stop();
|
|
2058
2068
|
}
|
|
2059
2069
|
return trackSignaling;
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
this.on('trackEnabled', localTrackEnabled);
|
|
2063
|
-
this.on('trackStopped', localTrackStopped);
|
|
2064
|
-
this._tracks.forEach(function (track) {
|
|
2065
|
-
_this._addLocalTrack(track, trackPriority.PRIORITY_STANDARD);
|
|
2066
|
-
_this._getOrCreateLocalTrackPublication(track).catch(function (error) {
|
|
2067
|
-
// Just log a warning for now.
|
|
2068
|
-
log.warn("Failed to get or create LocalTrackPublication for " + track + ":", error);
|
|
2069
|
-
});
|
|
2070
|
-
});
|
|
2071
|
-
var self = this;
|
|
2072
|
-
signaling.on('stateChanged', function stateChanged(state) {
|
|
2070
|
+
};
|
|
2071
|
+
var stateChanged = function (state) {
|
|
2073
2072
|
log.debug('Transitioned to state:', state);
|
|
2074
2073
|
if (state === 'disconnected') {
|
|
2075
2074
|
log.debug('Removing LocalTrack event listeners');
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2075
|
+
_this._signaling.removeListener('stateChanged', stateChanged);
|
|
2076
|
+
_this.removeListener('trackDisabled', localTrackDisabled);
|
|
2077
|
+
_this.removeListener('trackEnabled', localTrackEnabled);
|
|
2078
|
+
_this.removeListener('trackStopped', localTrackStopped);
|
|
2080
2079
|
// NOTE(mmalavalli): Remove the stale MediaTrackSender clones so that we
|
|
2081
2080
|
// do not call replaceTrack() on their RTCRtpSenders.
|
|
2082
|
-
|
|
2081
|
+
_this._tracks.forEach(function (track) {
|
|
2083
2082
|
var trackSignaling = localTrackStopped(track);
|
|
2084
2083
|
if (trackSignaling) {
|
|
2085
2084
|
track._trackSender.removeClone(trackSignaling._trackTransceiver);
|
|
2086
2085
|
}
|
|
2087
2086
|
});
|
|
2088
|
-
log.info("LocalParticipant disconnected. Stopping " +
|
|
2089
|
-
|
|
2087
|
+
log.info("LocalParticipant disconnected. Stopping " + _this._tracksToStop.size + " automatically-acquired LocalTracks");
|
|
2088
|
+
_this._tracksToStop.forEach(function (track) {
|
|
2090
2089
|
track.stop();
|
|
2091
2090
|
});
|
|
2092
2091
|
}
|
|
@@ -2097,8 +2096,19 @@ var LocalParticipant = /** @class */ (function (_super) {
|
|
|
2097
2096
|
log.info('reconnected');
|
|
2098
2097
|
// NOTE(mpatwardhan): `stateChanged` can get emitted with StateMachine locked.
|
|
2099
2098
|
// Do not signal public events synchronously with lock held.
|
|
2100
|
-
setTimeout(function () { return
|
|
2099
|
+
setTimeout(function () { return _this.emit('reconnected'); }, 0);
|
|
2101
2100
|
}
|
|
2101
|
+
};
|
|
2102
|
+
this.on('trackDisabled', localTrackDisabled);
|
|
2103
|
+
this.on('trackEnabled', localTrackEnabled);
|
|
2104
|
+
this.on('trackStopped', localTrackStopped);
|
|
2105
|
+
this._signaling.on('stateChanged', stateChanged);
|
|
2106
|
+
this._tracks.forEach(function (track) {
|
|
2107
|
+
_this._addLocalTrack(track, trackPriority.PRIORITY_STANDARD);
|
|
2108
|
+
_this._getOrCreateLocalTrackPublication(track).catch(function (error) {
|
|
2109
|
+
// Just log a warning for now.
|
|
2110
|
+
log.warn("Failed to get or create LocalTrackPublication for " + track + ":", error);
|
|
2111
|
+
});
|
|
2102
2112
|
});
|
|
2103
2113
|
};
|
|
2104
2114
|
/**
|
|
@@ -2117,9 +2127,6 @@ var LocalParticipant = /** @class */ (function (_super) {
|
|
|
2117
2127
|
if (!trackSignaling) {
|
|
2118
2128
|
return Promise.reject(new Error("Unexpected error: The " + localTrack + " cannot be published"));
|
|
2119
2129
|
}
|
|
2120
|
-
function unpublish(publication) {
|
|
2121
|
-
self.unpublishTrack(publication.track);
|
|
2122
|
-
}
|
|
2123
2130
|
return new Promise(function (resolve, reject) {
|
|
2124
2131
|
function updated() {
|
|
2125
2132
|
var error = trackSignaling.error;
|
|
@@ -2150,10 +2157,23 @@ var LocalParticipant = /** @class */ (function (_super) {
|
|
|
2150
2157
|
LocalVideoTrackPublication: self._LocalVideoTrackPublication
|
|
2151
2158
|
};
|
|
2152
2159
|
localTrackPublication = getTrackPublication(self.tracks, localTrack);
|
|
2160
|
+
var warningHandler = function (twilioWarningName) {
|
|
2161
|
+
return self.emit('trackWarning', twilioWarningName, localTrackPublication);
|
|
2162
|
+
};
|
|
2163
|
+
var warningsClearedHandler = function () {
|
|
2164
|
+
return self.emit('trackWarningsCleared', localTrackPublication);
|
|
2165
|
+
};
|
|
2166
|
+
var unpublish = function (publication) {
|
|
2167
|
+
localTrackPublication.removeListener('trackWarning', warningHandler);
|
|
2168
|
+
localTrackPublication.removeListener('trackWarningsCleared', warningsClearedHandler);
|
|
2169
|
+
self.unpublishTrack(publication.track);
|
|
2170
|
+
};
|
|
2153
2171
|
if (!localTrackPublication) {
|
|
2154
2172
|
localTrackPublication = asLocalTrackPublication(localTrack, trackSignaling, unpublish, options);
|
|
2155
2173
|
self._addTrackPublication(localTrackPublication);
|
|
2156
2174
|
}
|
|
2175
|
+
localTrackPublication.on('warning', warningHandler);
|
|
2176
|
+
localTrackPublication.on('warningsCleared', warningsClearedHandler);
|
|
2157
2177
|
var state = self._signaling.state;
|
|
2158
2178
|
if (state === 'connected' || state === 'connecting') {
|
|
2159
2179
|
if (localTrack._processorEventObserver) {
|
|
@@ -2488,6 +2508,19 @@ var LocalParticipant = /** @class */ (function (_super) {
|
|
|
2488
2508
|
* @param {LocalTrack} track - The {@link LocalTrack} that stopped
|
|
2489
2509
|
* @event LocalParticipant#trackStopped
|
|
2490
2510
|
*/
|
|
2511
|
+
/**
|
|
2512
|
+
* One of the {@link LocalParticipant}'s {@link LocalTrackPublication}s encountered a warning.
|
|
2513
|
+
* This event is only raised if you enabled warnings using <code>notifyWarnings</code> in <code>ConnectOptions</code>.
|
|
2514
|
+
* @param {string} name - The warning that was raised.
|
|
2515
|
+
* @param {LocalTrackPublication} publication - The {@link LocalTrackPublication} that encountered the warning.
|
|
2516
|
+
* @event LocalParticipant#trackWarning
|
|
2517
|
+
*/
|
|
2518
|
+
/**
|
|
2519
|
+
* One of the {@link LocalParticipant}'s {@link LocalTrackPublication}s cleared all warnings.
|
|
2520
|
+
* This event is only raised if you enabled warnings using <code>notifyWarnings</code> in <code>ConnectOptions</code>.
|
|
2521
|
+
* @param {LocalTrackPublication} publication - The {@link LocalTrackPublication} that cleared all warnings.
|
|
2522
|
+
* @event LocalParticipant#trackWarningsCleared
|
|
2523
|
+
*/
|
|
2491
2524
|
/**
|
|
2492
2525
|
* Outgoing media encoding parameters.
|
|
2493
2526
|
* @typedef {object} EncodingParameters
|
|
@@ -2535,7 +2568,7 @@ function getTrackPublication(trackPublications, track) {
|
|
|
2535
2568
|
}
|
|
2536
2569
|
module.exports = LocalParticipant;
|
|
2537
2570
|
|
|
2538
|
-
},{"./media/track/es5":14,"./media/track/localaudiotrackpublication":20,"./media/track/localdatatrackpublication":22,"./media/track/localvideotrackpublication":26,"./participant":43,"./util":128,"./util/constants":122,"./util/validate":
|
|
2571
|
+
},{"./media/track/es5":14,"./media/track/localaudiotrackpublication":20,"./media/track/localdatatrackpublication":22,"./media/track/localvideotrackpublication":26,"./participant":43,"./util":128,"./util/constants":122,"./util/validate":146,"./webrtc":154}],13:[function(require,module,exports){
|
|
2539
2572
|
'use strict';
|
|
2540
2573
|
var __extends = (this && this.__extends) || (function () {
|
|
2541
2574
|
var extendStatics = function (d, b) {
|
|
@@ -2724,7 +2757,7 @@ function LocalAudioTrack(mediaStreamTrack, options) {
|
|
|
2724
2757
|
inherits(LocalAudioTrack, LocalAudioTrackClass);
|
|
2725
2758
|
module.exports = LocalAudioTrack;
|
|
2726
2759
|
|
|
2727
|
-
},{"../../../vendor/inherits":
|
|
2760
|
+
},{"../../../vendor/inherits":147,"../localaudiotrack":19}],16:[function(require,module,exports){
|
|
2728
2761
|
// eslint-disable-next-line no-warning-comments
|
|
2729
2762
|
// TODO(mroberts): Remove this when we go to the next major version. This is
|
|
2730
2763
|
// only in place so that we can support ES6 classes without requiring `new`.
|
|
@@ -2739,7 +2772,7 @@ function LocalDataTrack(options) {
|
|
|
2739
2772
|
inherits(LocalDataTrack, LocalDataTrackClass);
|
|
2740
2773
|
module.exports = LocalDataTrack;
|
|
2741
2774
|
|
|
2742
|
-
},{"../../../vendor/inherits":
|
|
2775
|
+
},{"../../../vendor/inherits":147,"../localdatatrack":21}],17:[function(require,module,exports){
|
|
2743
2776
|
// eslint-disable-next-line no-warning-comments
|
|
2744
2777
|
// TODO(mroberts): Remove this when we go to the next major version. This is
|
|
2745
2778
|
// only in place so that we can support ES6 classes without requiring `new`.
|
|
@@ -2754,7 +2787,7 @@ function LocalVideoTrack(mediaStreamTrack, options) {
|
|
|
2754
2787
|
inherits(LocalVideoTrack, LocalVideoTrackClass);
|
|
2755
2788
|
module.exports = LocalVideoTrack;
|
|
2756
2789
|
|
|
2757
|
-
},{"../../../vendor/inherits":
|
|
2790
|
+
},{"../../../vendor/inherits":147,"../localvideotrack":25}],18:[function(require,module,exports){
|
|
2758
2791
|
'use strict';
|
|
2759
2792
|
var __extends = (this && this.__extends) || (function () {
|
|
2760
2793
|
var extendStatics = function (d, b) {
|
|
@@ -3611,7 +3644,7 @@ function restartWhenInadvertentlyStopped(localMediaTrack) {
|
|
|
3611
3644
|
}
|
|
3612
3645
|
module.exports = mixinLocalMediaTrack;
|
|
3613
3646
|
|
|
3614
|
-
},{"../../util":128,"../../util/constants":122,"../../util/detectsilentaudio":123,"../../util/detectsilentvideo":124,"../../util/documentvisibilitymonitor.js":125,"../../util/localmediarestartdeferreds":131,"../../webaudio/workaround180748":
|
|
3647
|
+
},{"../../util":128,"../../util/constants":122,"../../util/detectsilentaudio":123,"../../util/detectsilentvideo":124,"../../util/documentvisibilitymonitor.js":125,"../../util/localmediarestartdeferreds":131,"../../webaudio/workaround180748":151,"../../webrtc":154,"../../webrtc/util":167,"./sender":37}],24:[function(require,module,exports){
|
|
3615
3648
|
/* eslint new-cap:0 */
|
|
3616
3649
|
'use strict';
|
|
3617
3650
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -3629,6 +3662,27 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3629
3662
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
3630
3663
|
};
|
|
3631
3664
|
})();
|
|
3665
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3666
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3667
|
+
if (!m) return o;
|
|
3668
|
+
var i = m.call(o), r, ar = [], e;
|
|
3669
|
+
try {
|
|
3670
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3671
|
+
}
|
|
3672
|
+
catch (error) { e = { error: error }; }
|
|
3673
|
+
finally {
|
|
3674
|
+
try {
|
|
3675
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
3676
|
+
}
|
|
3677
|
+
finally { if (e) throw e.error; }
|
|
3678
|
+
}
|
|
3679
|
+
return ar;
|
|
3680
|
+
};
|
|
3681
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3682
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
3683
|
+
to[j] = from[i];
|
|
3684
|
+
return to;
|
|
3685
|
+
};
|
|
3632
3686
|
var TrackPublication = require('./trackpublication');
|
|
3633
3687
|
var _a = require('../../util/constants'), E = _a.typeErrors, trackPriority = _a.trackPriority;
|
|
3634
3688
|
/**
|
|
@@ -3640,6 +3694,8 @@ var _a = require('../../util/constants'), E = _a.typeErrors, trackPriority = _a.
|
|
|
3640
3694
|
* @property {Track.Kind} kind - kind of the published {@link LocalTrack}
|
|
3641
3695
|
* @property {Track.Priority} priority - the publish priority of the {@link LocalTrack}
|
|
3642
3696
|
* @property {LocalTrack} track - the {@link LocalTrack}
|
|
3697
|
+
* @emits LocalTrackPublication#warning
|
|
3698
|
+
* @emits LocalTrackPublication#warningsCleared
|
|
3643
3699
|
*/
|
|
3644
3700
|
var LocalTrackPublication = /** @class */ (function (_super) {
|
|
3645
3701
|
__extends(LocalTrackPublication, _super);
|
|
@@ -3656,6 +3712,15 @@ var LocalTrackPublication = /** @class */ (function (_super) {
|
|
|
3656
3712
|
function LocalTrackPublication(signaling, track, unpublish, options) {
|
|
3657
3713
|
var _this = _super.call(this, track.name, signaling.sid, options) || this;
|
|
3658
3714
|
Object.defineProperties(_this, {
|
|
3715
|
+
_reemitSignalingEvent: {
|
|
3716
|
+
value: function () {
|
|
3717
|
+
var args = [];
|
|
3718
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3719
|
+
args[_i] = arguments[_i];
|
|
3720
|
+
}
|
|
3721
|
+
return _this.emit.apply(_this, __spreadArray([args && args.length ? 'warning' : 'warningsCleared'], __read(args)));
|
|
3722
|
+
}
|
|
3723
|
+
},
|
|
3659
3724
|
_reemitTrackEvent: {
|
|
3660
3725
|
value: function () { return _this.emit(_this.isTrackEnabled
|
|
3661
3726
|
? 'trackEnabled'
|
|
@@ -3688,8 +3753,12 @@ var LocalTrackPublication = /** @class */ (function (_super) {
|
|
|
3688
3753
|
value: track
|
|
3689
3754
|
}
|
|
3690
3755
|
});
|
|
3691
|
-
|
|
3692
|
-
|
|
3756
|
+
['disabled', 'enabled'].forEach(function (name) {
|
|
3757
|
+
return track.on(name, _this._reemitTrackEvent);
|
|
3758
|
+
});
|
|
3759
|
+
['warning', 'warningsCleared'].forEach(function (name) {
|
|
3760
|
+
return signaling.on(name, _this._reemitSignalingEvent);
|
|
3761
|
+
});
|
|
3693
3762
|
return _this;
|
|
3694
3763
|
}
|
|
3695
3764
|
LocalTrackPublication.prototype.toString = function () {
|
|
@@ -3716,13 +3785,29 @@ var LocalTrackPublication = /** @class */ (function (_super) {
|
|
|
3716
3785
|
* @returns {this}
|
|
3717
3786
|
*/
|
|
3718
3787
|
LocalTrackPublication.prototype.unpublish = function () {
|
|
3719
|
-
|
|
3720
|
-
|
|
3788
|
+
var _this = this;
|
|
3789
|
+
['disabled', 'enabled'].forEach(function (name) {
|
|
3790
|
+
return _this.track.removeListener(name, _this._reemitTrackEvent);
|
|
3791
|
+
});
|
|
3792
|
+
['warning', 'warningsCleared'].forEach(function (name) {
|
|
3793
|
+
return _this._signaling.removeListener(name, _this._reemitSignalingEvent);
|
|
3794
|
+
});
|
|
3721
3795
|
this._unpublish(this);
|
|
3722
3796
|
return this;
|
|
3723
3797
|
};
|
|
3724
3798
|
return LocalTrackPublication;
|
|
3725
3799
|
}(TrackPublication));
|
|
3800
|
+
/**
|
|
3801
|
+
* The published {@link LocalTrack} encountered a warning.
|
|
3802
|
+
* This event is only raised if you enabled warnings using <code>notifyWarnings</code> in <code>ConnectOptions</code>.
|
|
3803
|
+
* @event LocalTrackPublication#warning
|
|
3804
|
+
* @param {string} name - The warning that was raised.
|
|
3805
|
+
*/
|
|
3806
|
+
/**
|
|
3807
|
+
* The published {@link LocalTrack} cleared all warnings.
|
|
3808
|
+
* This event is only raised if you enabled warnings using <code>notifyWarnings</code> in <code>ConnectOptions</code>.
|
|
3809
|
+
* @event LocalTrackPublication#warningsCleared
|
|
3810
|
+
*/
|
|
3726
3811
|
module.exports = LocalTrackPublication;
|
|
3727
3812
|
|
|
3728
3813
|
},{"../../util/constants":122,"./trackpublication":38}],25:[function(require,module,exports){
|
|
@@ -4072,7 +4157,7 @@ function workaroundSilentLocalVideo(localVideoTrack, doc) {
|
|
|
4072
4157
|
*/
|
|
4073
4158
|
module.exports = LocalVideoTrack;
|
|
4074
4159
|
|
|
4075
|
-
},{"../../util":128,"../../util/detectsilentvideo":124,"../../webrtc/util":
|
|
4160
|
+
},{"../../util":128,"../../util/detectsilentvideo":124,"../../webrtc/util":167,"./localmediatrack":23,"./videotrack":41}],26:[function(require,module,exports){
|
|
4076
4161
|
'use strict';
|
|
4077
4162
|
var __extends = (this && this.__extends) || (function () {
|
|
4078
4163
|
var extendStatics = function (d, b) {
|
|
@@ -4482,7 +4567,7 @@ function shimMediaElement(el, onUnintentionallyPaused) {
|
|
|
4482
4567
|
}
|
|
4483
4568
|
module.exports = MediaTrack;
|
|
4484
4569
|
|
|
4485
|
-
},{"../../util":128,"../../util/localmediarestartdeferreds":131,"../../webrtc":
|
|
4570
|
+
},{"../../util":128,"../../util/localmediarestartdeferreds":131,"../../webrtc":154,"../../webrtc/util":167,"./":18}],28:[function(require,module,exports){
|
|
4486
4571
|
'use strict';
|
|
4487
4572
|
var __extends = (this && this.__extends) || (function () {
|
|
4488
4573
|
var extendStatics = function (d, b) {
|
|
@@ -5222,7 +5307,7 @@ function playIfPausedWhileInBackground(remoteMediaTrack) {
|
|
|
5222
5307
|
*/
|
|
5223
5308
|
module.exports = mixinRemoteMediaTrack;
|
|
5224
5309
|
|
|
5225
|
-
},{"../../util/constants":122,"../../util/documentvisibilitymonitor.js":125,"../../webrtc/util":
|
|
5310
|
+
},{"../../util/constants":122,"../../util/documentvisibilitymonitor.js":125,"../../webrtc/util":167}],34:[function(require,module,exports){
|
|
5226
5311
|
'use strict';
|
|
5227
5312
|
var __extends = (this && this.__extends) || (function () {
|
|
5228
5313
|
var extendStatics = function (d, b) {
|
|
@@ -6391,7 +6476,7 @@ var VideoProcessorEventObserver = /** @class */ (function (_super) {
|
|
|
6391
6476
|
}(EventEmitter));
|
|
6392
6477
|
module.exports = VideoProcessorEventObserver;
|
|
6393
6478
|
|
|
6394
|
-
},{"../../util/constants":122,"events":
|
|
6479
|
+
},{"../../util/constants":122,"events":170}],41:[function(require,module,exports){
|
|
6395
6480
|
'use strict';
|
|
6396
6481
|
var __extends = (this && this.__extends) || (function () {
|
|
6397
6482
|
var extendStatics = function (d, b) {
|
|
@@ -7005,7 +7090,7 @@ var NetworkQualityConfigurationImpl = /** @class */ (function (_super) {
|
|
|
7005
7090
|
}(EventEmitter));
|
|
7006
7091
|
module.exports = NetworkQualityConfigurationImpl;
|
|
7007
7092
|
|
|
7008
|
-
},{"./util":128,"./util/constants":122,"events":
|
|
7093
|
+
},{"./util":128,"./util/constants":122,"events":170}],43:[function(require,module,exports){
|
|
7009
7094
|
'use strict';
|
|
7010
7095
|
var __extends = (this && this.__extends) || (function () {
|
|
7011
7096
|
var extendStatics = function (d, b) {
|
|
@@ -7824,7 +7909,7 @@ function getTurnCredentials(token, wsServer) {
|
|
|
7824
7909
|
}
|
|
7825
7910
|
exports.getTurnCredentials = getTurnCredentials;
|
|
7826
7911
|
|
|
7827
|
-
},{"../twilioconnection.js":117,"../util/constants":122,"../util/twilio-video-errors":143,"events":
|
|
7912
|
+
},{"../twilioconnection.js":117,"../util/constants":122,"../util/twilio-video-errors":143,"events":170}],46:[function(require,module,exports){
|
|
7828
7913
|
"use strict";
|
|
7829
7914
|
var __read = (this && this.__read) || function (o, n) {
|
|
7830
7915
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -8593,7 +8678,7 @@ function syntheticAudio() {
|
|
|
8593
8678
|
}
|
|
8594
8679
|
exports.syntheticAudio = syntheticAudio;
|
|
8595
8680
|
|
|
8596
|
-
},{"../webaudio/audiocontext":
|
|
8681
|
+
},{"../webaudio/audiocontext":149}],50:[function(require,module,exports){
|
|
8597
8682
|
"use strict";
|
|
8598
8683
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8599
8684
|
exports.syntheticVideo = void 0;
|
|
@@ -8758,7 +8843,7 @@ var QueueingEventEmitter = /** @class */ (function (_super) {
|
|
|
8758
8843
|
}(EventEmitter));
|
|
8759
8844
|
module.exports = QueueingEventEmitter;
|
|
8760
8845
|
|
|
8761
|
-
},{"events":
|
|
8846
|
+
},{"events":170}],53:[function(require,module,exports){
|
|
8762
8847
|
'use strict';
|
|
8763
8848
|
var __extends = (this && this.__extends) || (function () {
|
|
8764
8849
|
var extendStatics = function (d, b) {
|
|
@@ -9124,6 +9209,8 @@ var nInstances = 0;
|
|
|
9124
9209
|
* @emits Room#trackSwitchedOn
|
|
9125
9210
|
* @emits Room#trackUnpublished
|
|
9126
9211
|
* @emits Room#trackUnsubscribed
|
|
9212
|
+
* @emits Room#trackWarning
|
|
9213
|
+
* @emits Room#trackWarningsCleared
|
|
9127
9214
|
*/
|
|
9128
9215
|
var Room = /** @class */ (function (_super) {
|
|
9129
9216
|
__extends(Room, _super);
|
|
@@ -9198,6 +9285,7 @@ var Room = /** @class */ (function (_super) {
|
|
|
9198
9285
|
value: signaling.mediaRegion
|
|
9199
9286
|
}
|
|
9200
9287
|
});
|
|
9288
|
+
handleLocalParticipantEvents(_this, localParticipant);
|
|
9201
9289
|
handleRecordingEvents(_this, signaling.recording);
|
|
9202
9290
|
handleSignalingEvents(_this, signaling);
|
|
9203
9291
|
log.info('Created a new Room:', _this.name);
|
|
@@ -9501,6 +9589,40 @@ function rewriteLocalTrackIds(room, trackStats) {
|
|
|
9501
9589
|
* });
|
|
9502
9590
|
* });
|
|
9503
9591
|
*/
|
|
9592
|
+
/**
|
|
9593
|
+
* One of the {@link LocalParticipant}'s {@link LocalTrackPublication}s in the {@link Room} encountered a warning.
|
|
9594
|
+
* This event is only raised if you enabled warnings using <code>notifyWarnings</code> in <code>ConnectOptions</code>.
|
|
9595
|
+
* @param {string} name - The warning that was raised.
|
|
9596
|
+
* @param {LocalTrackPublication} publication - The {@link LocalTrackPublication} that encountered the warning.
|
|
9597
|
+
* @param {LocalParticipant} participant - The {@link LocalParticipant}
|
|
9598
|
+
* @event Room#trackWarning
|
|
9599
|
+
* @example
|
|
9600
|
+
* room.on('trackWarning', (name, publication, participant) => {
|
|
9601
|
+
* if (name === 'recording-media-lost') {
|
|
9602
|
+
* log(`LocalTrack ${publication.track.name} is not recording media.`,
|
|
9603
|
+
* name, publication, participant);
|
|
9604
|
+
*
|
|
9605
|
+
* // Wait a reasonable amount of time to clear the warning.
|
|
9606
|
+
* const timer = setTimeout(() => {
|
|
9607
|
+
* // If the warning is not cleared, you can manually
|
|
9608
|
+
* // reconnect to the room, or show a dialog to the user
|
|
9609
|
+
* }, 5000);
|
|
9610
|
+
*
|
|
9611
|
+
* room.once('trackWarningsCleared', (publication, participant) => {
|
|
9612
|
+
* log('LocalTrack warnings have cleared!',
|
|
9613
|
+
* publication, participant);
|
|
9614
|
+
* clearTimeout(timer);
|
|
9615
|
+
* });
|
|
9616
|
+
* }
|
|
9617
|
+
});
|
|
9618
|
+
*/
|
|
9619
|
+
/**
|
|
9620
|
+
* One of the {@link LocalParticipant}'s {@link LocalTrackPublication}s in the {@link Room} cleared all warnings.
|
|
9621
|
+
* This event is only raised if you enabled warnings using <code>notifyWarnings</code> in <code>ConnectOptions</code>.
|
|
9622
|
+
* @param {LocalTrackPublication} publication - The {@link LocalTrackPublication} that cleared all warnings.
|
|
9623
|
+
* @param {LocalParticipant} participant - The {@link LocalParticipant}
|
|
9624
|
+
* @event Room#trackWarningsCleared
|
|
9625
|
+
*/
|
|
9504
9626
|
function connectParticipant(room, participantSignaling) {
|
|
9505
9627
|
var log = room._log, clientTrackSwitchOffControl = room._clientTrackSwitchOffControl, contentPreferencesMode = room._contentPreferencesMode;
|
|
9506
9628
|
var participant = new RemoteParticipant(participantSignaling, { log: log, clientTrackSwitchOffControl: clientTrackSwitchOffControl, contentPreferencesMode: contentPreferencesMode });
|
|
@@ -9550,6 +9672,28 @@ function connectParticipant(room, participantSignaling) {
|
|
|
9550
9672
|
}
|
|
9551
9673
|
});
|
|
9552
9674
|
}
|
|
9675
|
+
function handleLocalParticipantEvents(room, localParticipant) {
|
|
9676
|
+
var events = ['trackWarning', 'trackWarningsCleared'].map(function (event) { return ({
|
|
9677
|
+
eventName: event,
|
|
9678
|
+
handler: function () {
|
|
9679
|
+
var args = [];
|
|
9680
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9681
|
+
args[_i] = arguments[_i];
|
|
9682
|
+
}
|
|
9683
|
+
return room.emit.apply(room, __spreadArray([event], __read(__spreadArray(__spreadArray([], __read(args)), [localParticipant]))));
|
|
9684
|
+
},
|
|
9685
|
+
}); });
|
|
9686
|
+
events.forEach(function (_a) {
|
|
9687
|
+
var eventName = _a.eventName, handler = _a.handler;
|
|
9688
|
+
return localParticipant.on(eventName, handler);
|
|
9689
|
+
});
|
|
9690
|
+
room.once('disconnected', function () {
|
|
9691
|
+
return events.forEach(function (_a) {
|
|
9692
|
+
var eventName = _a.eventName, handler = _a.handler;
|
|
9693
|
+
return localParticipant.removeListener(eventName, handler);
|
|
9694
|
+
});
|
|
9695
|
+
});
|
|
9696
|
+
}
|
|
9553
9697
|
function handleRecordingEvents(room, recording) {
|
|
9554
9698
|
recording.on('updated', function updated() {
|
|
9555
9699
|
var started = recording.isEnabled;
|
|
@@ -10274,7 +10418,7 @@ var RecordingSignaling = /** @class */ (function (_super) {
|
|
|
10274
10418
|
*/
|
|
10275
10419
|
module.exports = RecordingSignaling;
|
|
10276
10420
|
|
|
10277
|
-
},{"events":
|
|
10421
|
+
},{"events":170}],60:[function(require,module,exports){
|
|
10278
10422
|
'use strict';
|
|
10279
10423
|
var __extends = (this && this.__extends) || (function () {
|
|
10280
10424
|
var extendStatics = function (d, b) {
|
|
@@ -10883,7 +11027,7 @@ var TrackSignaling = /** @class */ (function (_super) {
|
|
|
10883
11027
|
*/
|
|
10884
11028
|
module.exports = TrackSignaling;
|
|
10885
11029
|
|
|
10886
|
-
},{"events":
|
|
11030
|
+
},{"events":170}],64:[function(require,module,exports){
|
|
10887
11031
|
'use strict';
|
|
10888
11032
|
var CancelablePromise = require('../../util/cancelablepromise');
|
|
10889
11033
|
var DefaultPeerConnectionManager = require('./peerconnectionmanager');
|
|
@@ -10930,7 +11074,7 @@ function createCancelableRoomSignalingPromise(token, wsServer, localParticipant,
|
|
|
10930
11074
|
throw error;
|
|
10931
11075
|
});
|
|
10932
11076
|
};
|
|
10933
|
-
var automaticSubscription = options.automaticSubscription, bandwidthProfile = options.bandwidthProfile, dominantSpeaker = options.dominantSpeaker, environment = options.environment, eventObserver = options.eventObserver, loggerName = options.loggerName, logLevel = options.logLevel, name = options.name, networkMonitor = options.networkMonitor, networkQuality = options.networkQuality, realm = options.realm, sdpSemantics = options.sdpSemantics;
|
|
11077
|
+
var automaticSubscription = options.automaticSubscription, bandwidthProfile = options.bandwidthProfile, dominantSpeaker = options.dominantSpeaker, environment = options.environment, eventObserver = options.eventObserver, loggerName = options.loggerName, logLevel = options.logLevel, name = options.name, networkMonitor = options.networkMonitor, networkQuality = options.networkQuality, notifyWarnings = options.notifyWarnings, realm = options.realm, sdpSemantics = options.sdpSemantics;
|
|
10934
11078
|
// decide which msp channels to request
|
|
10935
11079
|
// dominantSpeaker, networkQuality
|
|
10936
11080
|
var trackPriority = !!bandwidthProfile;
|
|
@@ -10947,6 +11091,7 @@ function createCancelableRoomSignalingPromise(token, wsServer, localParticipant,
|
|
|
10947
11091
|
logLevel: logLevel,
|
|
10948
11092
|
networkMonitor: networkMonitor,
|
|
10949
11093
|
networkQuality: networkQuality,
|
|
11094
|
+
notifyWarnings: notifyWarnings,
|
|
10950
11095
|
iceServers: iceServers,
|
|
10951
11096
|
onIced: onIced,
|
|
10952
11097
|
realm: realm,
|
|
@@ -11516,6 +11661,18 @@ var LocalParticipantV2 = /** @class */ (function (_super) {
|
|
|
11516
11661
|
}, this);
|
|
11517
11662
|
return this;
|
|
11518
11663
|
};
|
|
11664
|
+
LocalParticipantV2.prototype.updateMediaStates = function (mediaStates) {
|
|
11665
|
+
if (!mediaStates || !mediaStates.tracks) {
|
|
11666
|
+
return this;
|
|
11667
|
+
}
|
|
11668
|
+
Array.from(this.tracks.values()).forEach(function (publication) {
|
|
11669
|
+
var states = mediaStates.tracks[publication.sid];
|
|
11670
|
+
if (states) {
|
|
11671
|
+
publication.updateMediaStates(states);
|
|
11672
|
+
}
|
|
11673
|
+
});
|
|
11674
|
+
return this;
|
|
11675
|
+
};
|
|
11519
11676
|
/**
|
|
11520
11677
|
* @protected
|
|
11521
11678
|
* @param {DataTrackSender|MediaTrackSender} trackSender
|
|
@@ -11524,7 +11681,7 @@ var LocalParticipantV2 = /** @class */ (function (_super) {
|
|
|
11524
11681
|
* @returns {LocalTrackPublicationV2}
|
|
11525
11682
|
*/
|
|
11526
11683
|
LocalParticipantV2.prototype._createLocalTrackPublicationSignaling = function (trackSender, name, priority) {
|
|
11527
|
-
return new this._LocalTrackPublicationV2(trackSender, name, priority);
|
|
11684
|
+
return new this._LocalTrackPublicationV2(trackSender, name, priority, { log: this._log });
|
|
11528
11685
|
};
|
|
11529
11686
|
/**
|
|
11530
11687
|
* Add a {@link LocalTrackPublicationV2} for the given {@link DataTrackSender}
|
|
@@ -11679,6 +11836,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
11679
11836
|
};
|
|
11680
11837
|
})();
|
|
11681
11838
|
var LocalTrackPublicationSignaling = require('../localtrackpublication');
|
|
11839
|
+
var TwilioWarning = require('../../util/twiliowarning');
|
|
11682
11840
|
var createTwilioError = require('../../util/twilio-video-errors').createTwilioError;
|
|
11683
11841
|
/**
|
|
11684
11842
|
* @extends LocalTrackPublicationSignaling
|
|
@@ -11690,9 +11848,20 @@ var LocalTrackPublicationV2 = /** @class */ (function (_super) {
|
|
|
11690
11848
|
* @param {DataTrackSender|MediaTrackSender} trackSender
|
|
11691
11849
|
* @param {string} name
|
|
11692
11850
|
* @param {Track.Priority} priority
|
|
11851
|
+
* @param {object} [options]
|
|
11693
11852
|
*/
|
|
11694
|
-
function LocalTrackPublicationV2(trackSender, name, priority) {
|
|
11695
|
-
|
|
11853
|
+
function LocalTrackPublicationV2(trackSender, name, priority, options) {
|
|
11854
|
+
var _this = _super.call(this, trackSender, name, priority) || this;
|
|
11855
|
+
Object.defineProperties(_this, {
|
|
11856
|
+
_log: {
|
|
11857
|
+
value: options.log.createLog('default', _this)
|
|
11858
|
+
},
|
|
11859
|
+
_mediaStates: {
|
|
11860
|
+
value: { recordings: null },
|
|
11861
|
+
writable: true
|
|
11862
|
+
}
|
|
11863
|
+
});
|
|
11864
|
+
return _this;
|
|
11696
11865
|
}
|
|
11697
11866
|
/**
|
|
11698
11867
|
* Get the {@link LocalTrackPublicationV2#Representation} of a given {@link TrackSignaling}.
|
|
@@ -11707,6 +11876,9 @@ var LocalTrackPublicationV2 = /** @class */ (function (_super) {
|
|
|
11707
11876
|
priority: this.updatedPriority
|
|
11708
11877
|
};
|
|
11709
11878
|
};
|
|
11879
|
+
LocalTrackPublicationV2.prototype.toString = function () {
|
|
11880
|
+
return "[LocalTrackPublicationV2: " + this.sid + "]";
|
|
11881
|
+
};
|
|
11710
11882
|
/**
|
|
11711
11883
|
* Compare the {@link LocalTrackPublicationV2} to a {@link LocalTrackPublicationV2#Representation} of itself
|
|
11712
11884
|
* and perform any updates necessary.
|
|
@@ -11729,6 +11901,27 @@ var LocalTrackPublicationV2 = /** @class */ (function (_super) {
|
|
|
11729
11901
|
}
|
|
11730
11902
|
return this;
|
|
11731
11903
|
};
|
|
11904
|
+
LocalTrackPublicationV2.prototype.updateMediaStates = function (mediaStates) {
|
|
11905
|
+
if (!mediaStates || !mediaStates.recordings ||
|
|
11906
|
+
this._mediaStates.recordings === mediaStates.recordings) {
|
|
11907
|
+
return this;
|
|
11908
|
+
}
|
|
11909
|
+
this._mediaStates.recordings = mediaStates.recordings;
|
|
11910
|
+
switch (this._mediaStates.recordings) {
|
|
11911
|
+
case 'OK':
|
|
11912
|
+
this._log.info('Warnings have cleared.');
|
|
11913
|
+
this.emit('warningsCleared');
|
|
11914
|
+
break;
|
|
11915
|
+
case 'NO_MEDIA':
|
|
11916
|
+
this._log.warn('Recording media lost.');
|
|
11917
|
+
this.emit('warning', TwilioWarning.recordingMediaLost);
|
|
11918
|
+
break;
|
|
11919
|
+
default:
|
|
11920
|
+
this._log.warn("Unknown media state detected: " + this._mediaStates.recordings);
|
|
11921
|
+
break;
|
|
11922
|
+
}
|
|
11923
|
+
return this;
|
|
11924
|
+
};
|
|
11732
11925
|
return LocalTrackPublicationV2;
|
|
11733
11926
|
}(LocalTrackPublicationSignaling));
|
|
11734
11927
|
/**
|
|
@@ -11743,7 +11936,7 @@ var LocalTrackPublicationV2 = /** @class */ (function (_super) {
|
|
|
11743
11936
|
*/
|
|
11744
11937
|
module.exports = LocalTrackPublicationV2;
|
|
11745
11938
|
|
|
11746
|
-
},{"../../util/twilio-video-errors":143,"../localtrackpublication":57}],71:[function(require,module,exports){
|
|
11939
|
+
},{"../../util/twilio-video-errors":143,"../../util/twiliowarning":145,"../localtrackpublication":57}],71:[function(require,module,exports){
|
|
11747
11940
|
/* eslint callback-return:0 */
|
|
11748
11941
|
'use strict';
|
|
11749
11942
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -11840,7 +12033,7 @@ var MediaSignaling = /** @class */ (function (_super) {
|
|
|
11840
12033
|
}(EventEmitter));
|
|
11841
12034
|
module.exports = MediaSignaling;
|
|
11842
12035
|
|
|
11843
|
-
},{"events":
|
|
12036
|
+
},{"events":170}],72:[function(require,module,exports){
|
|
11844
12037
|
/* eslint callback-return:0 */
|
|
11845
12038
|
'use strict';
|
|
11846
12039
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -11999,7 +12192,7 @@ function next(monitor) {
|
|
|
11999
12192
|
*/
|
|
12000
12193
|
module.exports = NetworkQualityMonitor;
|
|
12001
12194
|
|
|
12002
|
-
},{"../../stats/peerconnectionreportfactory":103,"events":
|
|
12195
|
+
},{"../../stats/peerconnectionreportfactory":103,"events":170}],73:[function(require,module,exports){
|
|
12003
12196
|
'use strict';
|
|
12004
12197
|
var __extends = (this && this.__extends) || (function () {
|
|
12005
12198
|
var extendStatics = function (d, b) {
|
|
@@ -14054,13 +14247,29 @@ function updateEncodingParameters(pcv2) {
|
|
|
14054
14247
|
else {
|
|
14055
14248
|
setMaxBitrate(params, maxBitrate);
|
|
14056
14249
|
}
|
|
14057
|
-
if (!isFirefox &&
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14250
|
+
if (!isFirefox && params.encodings.length > 0) {
|
|
14251
|
+
if (sender.track.kind === 'audio') {
|
|
14252
|
+
// NOTE(mmalavalli): "priority" is a per-sender property and not
|
|
14253
|
+
// a per-encoding-layer property. So, we set the value only on the first
|
|
14254
|
+
// encoding layer. Any attempt to set the value on subsequent encoding
|
|
14255
|
+
// layers (in the case of simulcast) will result in the Promise returned
|
|
14256
|
+
// by RTCRtpSender.setParameters() being rejected. With this, audio encoding
|
|
14257
|
+
// is prioritized the most.
|
|
14258
|
+
params.encodings[0].priority = 'high';
|
|
14259
|
+
}
|
|
14260
|
+
else if (pcv2._isChromeScreenShareTrack(sender.track)) {
|
|
14261
|
+
// NOTE(mmalavalli): Screen share encodings are prioritized more than those
|
|
14262
|
+
// of the camera.
|
|
14263
|
+
params.encodings[0].priority = 'medium';
|
|
14264
|
+
}
|
|
14265
|
+
if (pcv2._enableDscp) {
|
|
14266
|
+
// NOTE(mmalavalli): "networkPriority" is a per-sender property and not
|
|
14267
|
+
// a per-encoding-layer property. So, we set the value only on the first
|
|
14268
|
+
// encoding layer. Any attempt to set the value on subsequent encoding
|
|
14269
|
+
// layers (in the case of simulcast) will result in the Promise returned
|
|
14270
|
+
// by RTCRtpSender.setParameters() being rejected.
|
|
14271
|
+
params.encodings[0].networkPriority = 'high';
|
|
14272
|
+
}
|
|
14064
14273
|
}
|
|
14065
14274
|
// when a sender is reused, delete any active encodings set by server.
|
|
14066
14275
|
var trackReplaced = pcv2._rtpNewSenders.has(sender);
|
|
@@ -14101,7 +14310,7 @@ function setMaxBitrate(params, maxBitrate) {
|
|
|
14101
14310
|
}
|
|
14102
14311
|
module.exports = PeerConnectionV2;
|
|
14103
14312
|
|
|
14104
|
-
},{"../../data/receiver":5,"../../media/track/receiver":28,"../../statemachine":85,"../../util":128,"../../util/backoff":119,"../../util/constants":122,"../../util/log":132,"../../util/sdp":136,"../../util/sdp/issue8329":137,"../../util/sdp/trackmatcher":139,"../../util/timeout":142,"../../util/twilio-video-errors":143,"../../webrtc":
|
|
14313
|
+
},{"../../data/receiver":5,"../../media/track/receiver":28,"../../statemachine":85,"../../util":128,"../../util/backoff":119,"../../util/constants":122,"../../util/log":132,"../../util/sdp":136,"../../util/sdp/issue8329":137,"../../util/sdp/trackmatcher":139,"../../util/timeout":142,"../../util/twilio-video-errors":143,"../../webrtc":154,"../../webrtc/util":167,"./icebox":66,"./iceconnectionmonitor.js":67}],75:[function(require,module,exports){
|
|
14105
14314
|
'use strict';
|
|
14106
14315
|
var __extends = (this && this.__extends) || (function () {
|
|
14107
14316
|
var extendStatics = function (d, b) {
|
|
@@ -14669,7 +14878,7 @@ function updateConnectionState(pcm) {
|
|
|
14669
14878
|
}
|
|
14670
14879
|
module.exports = PeerConnectionManager;
|
|
14671
14880
|
|
|
14672
|
-
},{"../../media/track/sender":37,"../../queueingeventemitter":52,"../../util":128,"../../util/twilio-video-errors":143,"../../webaudio/audiocontext":
|
|
14881
|
+
},{"../../media/track/sender":37,"../../queueingeventemitter":52,"../../util":128,"../../util/twilio-video-errors":143,"../../webaudio/audiocontext":149,"../../webrtc/util":167,"./peerconnection":74}],76:[function(require,module,exports){
|
|
14673
14882
|
/* eslint callback-return:0 */
|
|
14674
14883
|
'use strict';
|
|
14675
14884
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -15227,6 +15436,10 @@ var RoomV2 = /** @class */ (function (_super) {
|
|
|
15227
15436
|
value: localParticipant.bandwidthProfileRevision,
|
|
15228
15437
|
writable: true
|
|
15229
15438
|
},
|
|
15439
|
+
_mediaStatesWarningsRevision: {
|
|
15440
|
+
value: 0,
|
|
15441
|
+
writable: true
|
|
15442
|
+
},
|
|
15230
15443
|
_networkQualityMonitor: {
|
|
15231
15444
|
value: null,
|
|
15232
15445
|
writable: true
|
|
@@ -15566,6 +15779,11 @@ var RoomV2 = /** @class */ (function (_super) {
|
|
|
15566
15779
|
mediaSignaling.setup(roomState.media_signaling[channel].transport.label);
|
|
15567
15780
|
}
|
|
15568
15781
|
});
|
|
15782
|
+
if (roomState.type === 'warning' && roomState.states &&
|
|
15783
|
+
roomState.states.revision > this._mediaStatesWarningsRevision) {
|
|
15784
|
+
this._mediaStatesWarningsRevision = roomState.states.revision;
|
|
15785
|
+
this.localParticipant.updateMediaStates(roomState.states);
|
|
15786
|
+
}
|
|
15569
15787
|
return this;
|
|
15570
15788
|
};
|
|
15571
15789
|
RoomV2.prototype._initPublisherHintSignaling = function () {
|
|
@@ -16129,7 +16347,7 @@ var DefaultBackoff = require('../../util/backoff');
|
|
|
16129
16347
|
var reconnectBackoffConfig = require('../../util/constants').reconnectBackoffConfig;
|
|
16130
16348
|
var Timeout = require('../../util/timeout');
|
|
16131
16349
|
var _a = require('../../util/constants'), SDK_NAME = _a.SDK_NAME, SDK_VERSION = _a.SDK_VERSION, SDP_FORMAT = _a.SDP_FORMAT;
|
|
16132
|
-
var _b = require('../../util'), createBandwidthProfilePayload = _b.createBandwidthProfilePayload, createMediaSignalingPayload = _b.createMediaSignalingPayload, createSubscribePayload = _b.createSubscribePayload, getUserAgent = _b.getUserAgent, isNonArrayObject = _b.isNonArrayObject;
|
|
16350
|
+
var _b = require('../../util'), createBandwidthProfilePayload = _b.createBandwidthProfilePayload, createMediaSignalingPayload = _b.createMediaSignalingPayload, createMediaWarningsPayload = _b.createMediaWarningsPayload, createSubscribePayload = _b.createSubscribePayload, getUserAgent = _b.getUserAgent, isNonArrayObject = _b.isNonArrayObject;
|
|
16133
16351
|
var _c = require('../../util/twilio-video-errors'), createTwilioError = _c.createTwilioError, RoomCompletedError = _c.RoomCompletedError, SignalingConnectionError = _c.SignalingConnectionError, SignalingServerBusyError = _c.SignalingServerBusyError;
|
|
16134
16352
|
var ICE_VERSION = 1;
|
|
16135
16353
|
var RSP_VERSION = 2;
|
|
@@ -16238,6 +16456,9 @@ var TwilioConnectionTransport = /** @class */ (function (_super) {
|
|
|
16238
16456
|
_networkQuality: {
|
|
16239
16457
|
value: isNonArrayObject(options.networkQuality) || options.networkQuality
|
|
16240
16458
|
},
|
|
16459
|
+
_notifyWarnings: {
|
|
16460
|
+
value: options.notifyWarnings
|
|
16461
|
+
},
|
|
16241
16462
|
_options: {
|
|
16242
16463
|
value: options
|
|
16243
16464
|
},
|
|
@@ -16322,6 +16543,9 @@ var TwilioConnectionTransport = /** @class */ (function (_super) {
|
|
|
16322
16543
|
if (this._bandwidthProfile) {
|
|
16323
16544
|
message.bandwidth_profile = createBandwidthProfilePayload(this._bandwidthProfile);
|
|
16324
16545
|
}
|
|
16546
|
+
if (this._notifyWarnings) {
|
|
16547
|
+
message.participant.media_warnings = createMediaWarningsPayload(this._notifyWarnings);
|
|
16548
|
+
}
|
|
16325
16549
|
message.media_signaling = createMediaSignalingPayload(this._dominantSpeaker, this._networkQuality, this._trackPriority, this._trackSwitchOff, this._adaptiveSimulcast, this._renderHints);
|
|
16326
16550
|
message.subscribe = createSubscribePayload(this._automaticSubscription);
|
|
16327
16551
|
message.format = SDP_FORMAT;
|
|
@@ -16592,6 +16816,7 @@ function setupTransport(transport) {
|
|
|
16592
16816
|
case 'connected':
|
|
16593
16817
|
case 'synced':
|
|
16594
16818
|
case 'update':
|
|
16819
|
+
case 'warning':
|
|
16595
16820
|
transport.emit('message', message);
|
|
16596
16821
|
return;
|
|
16597
16822
|
case 'disconnected':
|
|
@@ -17132,7 +17357,7 @@ function createUnreachableError(here, there) {
|
|
|
17132
17357
|
}
|
|
17133
17358
|
module.exports = StateMachine;
|
|
17134
17359
|
|
|
17135
|
-
},{"./util":128,"events":
|
|
17360
|
+
},{"./util":128,"events":170}],86:[function(require,module,exports){
|
|
17136
17361
|
/* eslint no-undefined:0 */
|
|
17137
17362
|
'use strict';
|
|
17138
17363
|
/**
|
|
@@ -18329,7 +18554,7 @@ function updateChrome(factory) {
|
|
|
18329
18554
|
}
|
|
18330
18555
|
module.exports = PeerConnectionReportFactory;
|
|
18331
18556
|
|
|
18332
|
-
},{"../webrtc/util":
|
|
18557
|
+
},{"../webrtc/util":167,"./icereportfactory":88,"./peerconnectionreport":102,"./receiverreportfactory":105,"./senderreportfactory":112}],104:[function(require,module,exports){
|
|
18333
18558
|
'use strict';
|
|
18334
18559
|
var __extends = (this && this.__extends) || (function () {
|
|
18335
18560
|
var extendStatics = function (d, b) {
|
|
@@ -19083,7 +19308,7 @@ var TrackTransceiver = /** @class */ (function (_super) {
|
|
|
19083
19308
|
*/
|
|
19084
19309
|
module.exports = TrackTransceiver;
|
|
19085
19310
|
|
|
19086
|
-
},{"events":
|
|
19311
|
+
},{"events":170}],117:[function(require,module,exports){
|
|
19087
19312
|
'use strict';
|
|
19088
19313
|
var __extends = (this && this.__extends) || (function () {
|
|
19089
19314
|
var extendStatics = function (d, b) {
|
|
@@ -19736,7 +19961,7 @@ TwilioConnection.CloseReason = CloseReason;
|
|
|
19736
19961
|
*/
|
|
19737
19962
|
module.exports = TwilioConnection;
|
|
19738
19963
|
|
|
19739
|
-
},{"./statemachine":85,"./util":128,"./util/log":132,"./util/networkmonitor":134,"./util/timeout":142,"ws":
|
|
19964
|
+
},{"./statemachine":85,"./util":128,"./util/log":132,"./util/networkmonitor":134,"./util/timeout":142,"ws":172}],118:[function(require,module,exports){
|
|
19740
19965
|
'use strict';
|
|
19741
19966
|
var defer = require('./').defer;
|
|
19742
19967
|
/**
|
|
@@ -20287,7 +20512,7 @@ module.exports.videoContentPreferencesMode = {
|
|
|
20287
20512
|
MODE_MANUAL: 'manual'
|
|
20288
20513
|
};
|
|
20289
20514
|
|
|
20290
|
-
},{"../../package.json":
|
|
20515
|
+
},{"../../package.json":171}],123:[function(require,module,exports){
|
|
20291
20516
|
'use strict';
|
|
20292
20517
|
var detectSilence = require('../webaudio/detectsilence');
|
|
20293
20518
|
var N_ATTEMPTS = 3;
|
|
@@ -20328,7 +20553,7 @@ function detectSilentAudio(el) {
|
|
|
20328
20553
|
}
|
|
20329
20554
|
module.exports = detectSilentAudio;
|
|
20330
20555
|
|
|
20331
|
-
},{"../webaudio/audiocontext":
|
|
20556
|
+
},{"../webaudio/audiocontext":149,"../webaudio/detectsilence":150}],124:[function(require,module,exports){
|
|
20332
20557
|
'use strict';
|
|
20333
20558
|
// Cached copy of the <canvas> used to check silent video frames.
|
|
20334
20559
|
var canvas = null;
|
|
@@ -20607,7 +20832,7 @@ var EventObserver = /** @class */ (function (_super) {
|
|
|
20607
20832
|
*/
|
|
20608
20833
|
module.exports = EventObserver;
|
|
20609
20834
|
|
|
20610
|
-
},{"events":
|
|
20835
|
+
},{"events":170}],127:[function(require,module,exports){
|
|
20611
20836
|
'use strict';
|
|
20612
20837
|
var Filter = /** @class */ (function () {
|
|
20613
20838
|
function Filter(options) {
|
|
@@ -20693,6 +20918,7 @@ var constants = require('./constants');
|
|
|
20693
20918
|
var E = constants.typeErrors, trackPriority = constants.trackPriority;
|
|
20694
20919
|
var util = require('../webrtc/util');
|
|
20695
20920
|
var sessionSID = require('./sid').sessionSID;
|
|
20921
|
+
var TwilioWarning = require('./twiliowarning');
|
|
20696
20922
|
/**
|
|
20697
20923
|
* Return the given {@link LocalTrack} or a new {@link LocalTrack} for the
|
|
20698
20924
|
* given MediaStreamTrack.
|
|
@@ -21436,6 +21662,15 @@ function createSubscribePayload(automaticSubscription) {
|
|
|
21436
21662
|
revision: 1
|
|
21437
21663
|
};
|
|
21438
21664
|
}
|
|
21665
|
+
function createMediaWarningsPayload(notifyWarnings) {
|
|
21666
|
+
var _a;
|
|
21667
|
+
var mediaWarnings = (_a = {},
|
|
21668
|
+
_a[TwilioWarning.recordingMediaLost] = 'recordings',
|
|
21669
|
+
_a);
|
|
21670
|
+
return notifyWarnings
|
|
21671
|
+
.map(function (twilioWarningName) { return mediaWarnings[twilioWarningName]; })
|
|
21672
|
+
.filter(function (name) { return !!name; });
|
|
21673
|
+
}
|
|
21439
21674
|
/**
|
|
21440
21675
|
* Add random jitter to a given value in the range [-jitter, jitter].
|
|
21441
21676
|
* @private
|
|
@@ -21503,6 +21738,7 @@ function waitForEvent(eventTarget, event) {
|
|
|
21503
21738
|
exports.constants = constants;
|
|
21504
21739
|
exports.createBandwidthProfilePayload = createBandwidthProfilePayload;
|
|
21505
21740
|
exports.createMediaSignalingPayload = createMediaSignalingPayload;
|
|
21741
|
+
exports.createMediaWarningsPayload = createMediaWarningsPayload;
|
|
21506
21742
|
exports.createRoomConnectEventPayload = createRoomConnectEventPayload;
|
|
21507
21743
|
exports.createSubscribePayload = createSubscribePayload;
|
|
21508
21744
|
exports.asLocalTrack = asLocalTrack;
|
|
@@ -21537,7 +21773,7 @@ exports.isUserMediaTrack = isUserMediaTrack;
|
|
|
21537
21773
|
exports.waitForSometime = waitForSometime;
|
|
21538
21774
|
exports.waitForEvent = waitForEvent;
|
|
21539
21775
|
|
|
21540
|
-
},{"../webrtc/util":
|
|
21776
|
+
},{"../webrtc/util":167,"./constants":122,"./sid":140,"./twiliowarning":145}],129:[function(require,module,exports){
|
|
21541
21777
|
/* eslint-disable camelcase */
|
|
21542
21778
|
'use strict';
|
|
21543
21779
|
var __extends = (this && this.__extends) || (function () {
|
|
@@ -21832,7 +22068,7 @@ function reconnect(publisher, token, sdkName, sdkVersion, roomSid, participantSi
|
|
|
21832
22068
|
*/
|
|
21833
22069
|
module.exports = InsightsPublisher;
|
|
21834
22070
|
|
|
21835
|
-
},{"..":128,"../../util":128,"../browserdetection":120,"../constants":122,"events":
|
|
22071
|
+
},{"..":128,"../../util":128,"../browserdetection":120,"../constants":122,"events":170,"ws":172}],130:[function(require,module,exports){
|
|
21836
22072
|
// eslint-disable-next-line no-warning-comments
|
|
21837
22073
|
// TODO(mroberts): This should be described as implementing some
|
|
21838
22074
|
// InsightsPublisher interface.
|
|
@@ -22226,7 +22462,7 @@ function validateLogLevels(levels) {
|
|
|
22226
22462
|
}
|
|
22227
22463
|
module.exports = Log;
|
|
22228
22464
|
|
|
22229
|
-
},{"../vendor/loglevel":
|
|
22465
|
+
},{"../vendor/loglevel":148,"./constants":122}],133:[function(require,module,exports){
|
|
22230
22466
|
'use strict';
|
|
22231
22467
|
/**
|
|
22232
22468
|
* Calculates the moving average delta for the given pair ofsamples. A sample (S)
|
|
@@ -23156,7 +23392,7 @@ function addFmtpAttributeForRtxPt(mediaSection, rtxPt, pt) {
|
|
|
23156
23392
|
}
|
|
23157
23393
|
module.exports = workaround;
|
|
23158
23394
|
|
|
23159
|
-
},{"../../webrtc":
|
|
23395
|
+
},{"../../webrtc":154,"./":136}],138:[function(require,module,exports){
|
|
23160
23396
|
'use strict';
|
|
23161
23397
|
var __read = (this && this.__read) || function (o, n) {
|
|
23162
23398
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
@@ -23486,6 +23722,7 @@ exports.createSID = createSID;
|
|
|
23486
23722
|
},{}],141:[function(require,module,exports){
|
|
23487
23723
|
'use strict';
|
|
23488
23724
|
var _a = require('../webrtc/util'), guessBrowser = _a.guessBrowser, isWebRTCSupported = _a.support;
|
|
23725
|
+
var getSdpFormat = require('../webrtc/util/sdp').getSdpFormat;
|
|
23489
23726
|
var _b = require('./browserdetection'), isAndroid = _b.isAndroid, isMobile = _b.isMobile, isNonChromiumEdge = _b.isNonChromiumEdge, rebrandedChromeBrowser = _b.rebrandedChromeBrowser, mobileWebKitBrowser = _b.mobileWebKitBrowser;
|
|
23490
23727
|
var SUPPORTED_CHROME_BASED_BROWSERS = [
|
|
23491
23728
|
'crios',
|
|
@@ -23521,6 +23758,7 @@ function isSupported() {
|
|
|
23521
23758
|
SUPPORTED_ANDROID_BROWSERS : SUPPORTED_IOS_BROWSERS;
|
|
23522
23759
|
return !!browser
|
|
23523
23760
|
&& isWebRTCSupported()
|
|
23761
|
+
&& getSdpFormat() === 'unified'
|
|
23524
23762
|
&& (!rebrandedChrome || SUPPORTED_CHROME_BASED_BROWSERS.includes(rebrandedChrome))
|
|
23525
23763
|
&& !isNonChromiumEdge(browser)
|
|
23526
23764
|
&& (!mobileWebKit || SUPPORTED_MOBILE_WEBKIT_BASED_BROWSERS.includes(mobileWebKit))
|
|
@@ -23528,7 +23766,7 @@ function isSupported() {
|
|
|
23528
23766
|
}
|
|
23529
23767
|
module.exports = isSupported;
|
|
23530
23768
|
|
|
23531
|
-
},{"../webrtc/util":
|
|
23769
|
+
},{"../webrtc/util":167,"../webrtc/util/sdp":169,"./browserdetection":120}],142:[function(require,module,exports){
|
|
23532
23770
|
'use strict';
|
|
23533
23771
|
/**
|
|
23534
23772
|
* A {@link Timeout} represents a resettable and clearable timeout.
|
|
@@ -24731,6 +24969,19 @@ module.exports = TwilioError;
|
|
|
24731
24969
|
|
|
24732
24970
|
},{}],145:[function(require,module,exports){
|
|
24733
24971
|
'use strict';
|
|
24972
|
+
/**
|
|
24973
|
+
* @private
|
|
24974
|
+
* Represents a warning encountered when
|
|
24975
|
+
* interacting with one of Twilio's services.
|
|
24976
|
+
*/
|
|
24977
|
+
// eslint-disable-next-line
|
|
24978
|
+
var TwilioWarning = {
|
|
24979
|
+
recordingMediaLost: 'recording-media-lost'
|
|
24980
|
+
};
|
|
24981
|
+
module.exports = TwilioWarning;
|
|
24982
|
+
|
|
24983
|
+
},{}],146:[function(require,module,exports){
|
|
24984
|
+
'use strict';
|
|
24734
24985
|
var isNonArrayObject = require('./').isNonArrayObject;
|
|
24735
24986
|
var _a = require('./constants'), E = _a.typeErrors, clientTrackSwitchOffControl = _a.clientTrackSwitchOffControl, videoContentPreferencesMode = _a.videoContentPreferencesMode, subscriptionMode = _a.subscriptionMode, trackPriority = _a.trackPriority, trackSwitchOffMode = _a.trackSwitchOffMode;
|
|
24736
24987
|
/**
|
|
@@ -24846,7 +25097,7 @@ exports.validateBandwidthProfile = validateBandwidthProfile;
|
|
|
24846
25097
|
exports.validateLocalTrack = validateLocalTrack;
|
|
24847
25098
|
exports.validateObject = validateObject;
|
|
24848
25099
|
|
|
24849
|
-
},{"./":128,"./constants":122}],
|
|
25100
|
+
},{"./":128,"./constants":122}],147:[function(require,module,exports){
|
|
24850
25101
|
/**
|
|
24851
25102
|
* Copyright (c) 2011-2022 Isaac Z. Schlueter
|
|
24852
25103
|
* Licensed under the ISC License.
|
|
@@ -24881,7 +25132,7 @@ module.exports = function inherits(ctor, superCtor) {
|
|
|
24881
25132
|
}
|
|
24882
25133
|
};
|
|
24883
25134
|
|
|
24884
|
-
},{}],
|
|
25135
|
+
},{}],148:[function(require,module,exports){
|
|
24885
25136
|
/**
|
|
24886
25137
|
* Copyright (c) 2013 Tim Perry
|
|
24887
25138
|
* Licensed under the MIT license.
|
|
@@ -25121,7 +25372,7 @@ defaultLogger.getLoggers = function getLoggers() {
|
|
|
25121
25372
|
defaultLogger['default'] = defaultLogger;
|
|
25122
25373
|
module.exports = defaultLogger;
|
|
25123
25374
|
|
|
25124
|
-
},{}],
|
|
25375
|
+
},{}],149:[function(require,module,exports){
|
|
25125
25376
|
/* globals webkitAudioContext, AudioContext */
|
|
25126
25377
|
'use strict';
|
|
25127
25378
|
var NativeAudioContext = typeof AudioContext !== 'undefined'
|
|
@@ -25204,7 +25455,7 @@ var AudioContextFactory = /** @class */ (function () {
|
|
|
25204
25455
|
}());
|
|
25205
25456
|
module.exports = new AudioContextFactory();
|
|
25206
25457
|
|
|
25207
|
-
},{}],
|
|
25458
|
+
},{}],150:[function(require,module,exports){
|
|
25208
25459
|
'use strict';
|
|
25209
25460
|
/**
|
|
25210
25461
|
* Return a Promise that resolves after `timeout` milliseconds.
|
|
@@ -25257,7 +25508,7 @@ function detectSilence(audioContext, stream, timeout) {
|
|
|
25257
25508
|
}
|
|
25258
25509
|
module.exports = detectSilence;
|
|
25259
25510
|
|
|
25260
|
-
},{}],
|
|
25511
|
+
},{}],151:[function(require,module,exports){
|
|
25261
25512
|
'use strict';
|
|
25262
25513
|
var detectSilence = require('./detectsilence');
|
|
25263
25514
|
/**
|
|
@@ -25327,7 +25578,7 @@ to get a new one, but we\'ve run out of retries; returning it anyway.');
|
|
|
25327
25578
|
}
|
|
25328
25579
|
module.exports = workaround;
|
|
25329
25580
|
|
|
25330
|
-
},{"./audiocontext":
|
|
25581
|
+
},{"./audiocontext":149,"./detectsilence":150}],152:[function(require,module,exports){
|
|
25331
25582
|
'use strict';
|
|
25332
25583
|
var flatMap = require('./util').flatMap;
|
|
25333
25584
|
var guessBrowser = require('./util').guessBrowser;
|
|
@@ -26121,7 +26372,7 @@ function standardizeFirefoxStats(response, isRemote) {
|
|
|
26121
26372
|
*/
|
|
26122
26373
|
module.exports = getStats;
|
|
26123
26374
|
|
|
26124
|
-
},{"./util":
|
|
26375
|
+
},{"./util":167,"./util/sdp":169}],153:[function(require,module,exports){
|
|
26125
26376
|
/* globals navigator */
|
|
26126
26377
|
'use strict';
|
|
26127
26378
|
/**
|
|
@@ -26145,7 +26396,7 @@ function getUserMedia(constraints) {
|
|
|
26145
26396
|
}
|
|
26146
26397
|
module.exports = getUserMedia;
|
|
26147
26398
|
|
|
26148
|
-
},{}],
|
|
26399
|
+
},{}],154:[function(require,module,exports){
|
|
26149
26400
|
'use strict';
|
|
26150
26401
|
var WebRTC = {};
|
|
26151
26402
|
Object.defineProperties(WebRTC, {
|
|
@@ -26180,7 +26431,7 @@ Object.defineProperties(WebRTC, {
|
|
|
26180
26431
|
});
|
|
26181
26432
|
module.exports = WebRTC;
|
|
26182
26433
|
|
|
26183
|
-
},{"./getstats":
|
|
26434
|
+
},{"./getstats":152,"./getusermedia":153,"./mediastream":155,"./mediastreamtrack":156,"./rtcicecandidate":157,"./rtcpeerconnection":160,"./rtcsessiondescription":165}],155:[function(require,module,exports){
|
|
26184
26435
|
/* globals MediaStream */
|
|
26185
26436
|
'use strict';
|
|
26186
26437
|
if (typeof MediaStream === 'function') {
|
|
@@ -26192,7 +26443,7 @@ else {
|
|
|
26192
26443
|
};
|
|
26193
26444
|
}
|
|
26194
26445
|
|
|
26195
|
-
},{}],
|
|
26446
|
+
},{}],156:[function(require,module,exports){
|
|
26196
26447
|
/* global MediaStreamTrack */
|
|
26197
26448
|
'use strict';
|
|
26198
26449
|
if (typeof MediaStreamTrack === 'function') {
|
|
@@ -26204,7 +26455,7 @@ else {
|
|
|
26204
26455
|
};
|
|
26205
26456
|
}
|
|
26206
26457
|
|
|
26207
|
-
},{}],
|
|
26458
|
+
},{}],157:[function(require,module,exports){
|
|
26208
26459
|
/* global RTCIceCandidate */
|
|
26209
26460
|
'use strict';
|
|
26210
26461
|
if (typeof RTCIceCandidate === 'function') {
|
|
@@ -26216,7 +26467,7 @@ else {
|
|
|
26216
26467
|
};
|
|
26217
26468
|
}
|
|
26218
26469
|
|
|
26219
|
-
},{}],
|
|
26470
|
+
},{}],158:[function(require,module,exports){
|
|
26220
26471
|
/* globals RTCDataChannel, RTCPeerConnection, RTCSessionDescription */
|
|
26221
26472
|
'use strict';
|
|
26222
26473
|
var ChromeRTCSessionDescription = require('../rtcsessiondescription/chrome');
|
|
@@ -26727,7 +26978,7 @@ function updateTrackIdsToSSRCs(sdpFormat, tracksToSSRCs, sdp) {
|
|
|
26727
26978
|
}
|
|
26728
26979
|
module.exports = ChromeRTCPeerConnection;
|
|
26729
26980
|
|
|
26730
|
-
},{"../../vendor/inherits":
|
|
26981
|
+
},{"../../vendor/inherits":147,"../mediastream":155,"../rtcrtpsender":162,"../rtcsessiondescription/chrome":163,"../util":167,"../util/eventtarget":166,"../util/latch":168,"../util/sdp":169}],159:[function(require,module,exports){
|
|
26731
26982
|
/* globals RTCPeerConnection */
|
|
26732
26983
|
'use strict';
|
|
26733
26984
|
var EventTarget = require('../util/eventtarget');
|
|
@@ -27022,7 +27273,7 @@ function overwriteWithInitiallyNegotiatedDtlsRole(description, dtlsRole) {
|
|
|
27022
27273
|
}
|
|
27023
27274
|
module.exports = FirefoxRTCPeerConnection;
|
|
27024
27275
|
|
|
27025
|
-
},{"../../vendor/inherits":
|
|
27276
|
+
},{"../../vendor/inherits":147,"../rtcsessiondescription/firefox":164,"../util":167,"../util/eventtarget":166,"../util/sdp":169}],160:[function(require,module,exports){
|
|
27026
27277
|
'use strict';
|
|
27027
27278
|
if (typeof RTCPeerConnection === 'function') {
|
|
27028
27279
|
var guessBrowser = require('../util').guessBrowser;
|
|
@@ -27047,7 +27298,7 @@ else {
|
|
|
27047
27298
|
};
|
|
27048
27299
|
}
|
|
27049
27300
|
|
|
27050
|
-
},{"../util":
|
|
27301
|
+
},{"../util":167,"./chrome":158,"./firefox":159,"./safari":161}],161:[function(require,module,exports){
|
|
27051
27302
|
/* globals RTCPeerConnection, RTCSessionDescription */
|
|
27052
27303
|
'use strict';
|
|
27053
27304
|
var EventTarget = require('../util/eventtarget');
|
|
@@ -27396,7 +27647,7 @@ function shimDataChannel(dataChannel) {
|
|
|
27396
27647
|
}
|
|
27397
27648
|
module.exports = SafariRTCPeerConnection;
|
|
27398
27649
|
|
|
27399
|
-
},{"../../vendor/inherits":
|
|
27650
|
+
},{"../../vendor/inherits":147,"../util":167,"../util/eventtarget":166,"../util/latch":168,"../util/sdp":169}],162:[function(require,module,exports){
|
|
27400
27651
|
'use strict';
|
|
27401
27652
|
/**
|
|
27402
27653
|
* RTCRtpSender shim.
|
|
@@ -27434,7 +27685,7 @@ function RTCRtpSenderShim(track) {
|
|
|
27434
27685
|
// using the RTCRtpSender APIs.
|
|
27435
27686
|
module.exports = RTCRtpSenderShim;
|
|
27436
27687
|
|
|
27437
|
-
},{}],
|
|
27688
|
+
},{}],163:[function(require,module,exports){
|
|
27438
27689
|
/* globals RTCSessionDescription */
|
|
27439
27690
|
'use strict';
|
|
27440
27691
|
// This class wraps Chrome's RTCSessionDescription implementation. It provides
|
|
@@ -27471,12 +27722,12 @@ function ChromeRTCSessionDescription(descriptionInitDict) {
|
|
|
27471
27722
|
}
|
|
27472
27723
|
module.exports = ChromeRTCSessionDescription;
|
|
27473
27724
|
|
|
27474
|
-
},{}],
|
|
27725
|
+
},{}],164:[function(require,module,exports){
|
|
27475
27726
|
/* globals RTCSessionDescription */
|
|
27476
27727
|
'use strict';
|
|
27477
27728
|
module.exports = RTCSessionDescription;
|
|
27478
27729
|
|
|
27479
|
-
},{}],
|
|
27730
|
+
},{}],165:[function(require,module,exports){
|
|
27480
27731
|
/* globals RTCSessionDescription */
|
|
27481
27732
|
'use strict';
|
|
27482
27733
|
if (typeof RTCSessionDescription === 'function') {
|
|
@@ -27499,7 +27750,7 @@ else {
|
|
|
27499
27750
|
};
|
|
27500
27751
|
}
|
|
27501
27752
|
|
|
27502
|
-
},{"../util":
|
|
27753
|
+
},{"../util":167,"./chrome":163,"./firefox":164}],166:[function(require,module,exports){
|
|
27503
27754
|
'use strict';
|
|
27504
27755
|
var EventEmitter = require('events').EventEmitter;
|
|
27505
27756
|
/**
|
|
@@ -27534,7 +27785,7 @@ EventTarget.prototype.removeEventListener = function removeEventListener() {
|
|
|
27534
27785
|
};
|
|
27535
27786
|
module.exports = EventTarget;
|
|
27536
27787
|
|
|
27537
|
-
},{"events":
|
|
27788
|
+
},{"events":170}],167:[function(require,module,exports){
|
|
27538
27789
|
'use strict';
|
|
27539
27790
|
/**
|
|
27540
27791
|
* Create a {@link Deferred}.
|
|
@@ -27843,7 +28094,7 @@ exports.makeUUID = makeUUID;
|
|
|
27843
28094
|
exports.proxyProperties = proxyProperties;
|
|
27844
28095
|
exports.support = support;
|
|
27845
28096
|
|
|
27846
|
-
},{}],
|
|
28097
|
+
},{}],168:[function(require,module,exports){
|
|
27847
28098
|
'use strict';
|
|
27848
28099
|
var defer = require('./').defer;
|
|
27849
28100
|
var states = {
|
|
@@ -27949,7 +28200,7 @@ function createUnreachableStateError(from, to) {
|
|
|
27949
28200
|
}
|
|
27950
28201
|
module.exports = Latch;
|
|
27951
28202
|
|
|
27952
|
-
},{"./":
|
|
28203
|
+
},{"./":167}],169:[function(require,module,exports){
|
|
27953
28204
|
/* globals RTCPeerConnection, RTCRtpTransceiver */
|
|
27954
28205
|
'use strict';
|
|
27955
28206
|
var flatMap = require('./').flatMap;
|
|
@@ -27982,6 +28233,12 @@ function checkIfSdpSemanticsIsSupported() {
|
|
|
27982
28233
|
// NOTE(mmalavalli): We cache Chrome's SDP format in order to prevent
|
|
27983
28234
|
// instantiation of more than one RTCPeerConnection.
|
|
27984
28235
|
var chromeSdpFormat = null;
|
|
28236
|
+
/**
|
|
28237
|
+
* Clear cached Chrome's SDP format
|
|
28238
|
+
*/
|
|
28239
|
+
function clearChromeCachedSdpFormat() {
|
|
28240
|
+
chromeSdpFormat = null;
|
|
28241
|
+
}
|
|
27985
28242
|
/**
|
|
27986
28243
|
* Get Chrome's default SDP format.
|
|
27987
28244
|
* @returns {'planb'|'unified'}
|
|
@@ -27990,13 +28247,15 @@ function getChromeDefaultSdpFormat() {
|
|
|
27990
28247
|
if (!chromeSdpFormat) {
|
|
27991
28248
|
if (typeof RTCPeerConnection !== 'undefined'
|
|
27992
28249
|
&& 'addTransceiver' in RTCPeerConnection.prototype) {
|
|
28250
|
+
var pc = new RTCPeerConnection();
|
|
27993
28251
|
try {
|
|
27994
|
-
|
|
28252
|
+
pc.addTransceiver('audio');
|
|
27995
28253
|
chromeSdpFormat = 'unified';
|
|
27996
28254
|
}
|
|
27997
28255
|
catch (e) {
|
|
27998
28256
|
chromeSdpFormat = 'planb';
|
|
27999
28257
|
}
|
|
28258
|
+
pc.close();
|
|
28000
28259
|
}
|
|
28001
28260
|
else {
|
|
28002
28261
|
chromeSdpFormat = 'planb';
|
|
@@ -28225,6 +28484,7 @@ function updatePlanBTrackIdsToSSRCs(trackIdsToSSRCs, sdp) {
|
|
|
28225
28484
|
function updateUnifiedPlanTrackIdsToSSRCs(trackIdsToSSRCs, sdp) {
|
|
28226
28485
|
return updateTrackIdsToSSRCs(getUnifiedPlanTrackIdsToSSRCs, trackIdsToSSRCs, sdp);
|
|
28227
28486
|
}
|
|
28487
|
+
exports.clearChromeCachedSdpFormat = clearChromeCachedSdpFormat;
|
|
28228
28488
|
exports.getSdpFormat = getSdpFormat;
|
|
28229
28489
|
exports.getMediaSections = getMediaSections;
|
|
28230
28490
|
exports.getPlanBTrackIds = getPlanBTrackIds;
|
|
@@ -28234,7 +28494,7 @@ exports.getUnifiedPlanSSRCs = getUnifiedPlanSSRCs;
|
|
|
28234
28494
|
exports.updatePlanBTrackIdsToSSRCs = updatePlanBTrackIdsToSSRCs;
|
|
28235
28495
|
exports.updateUnifiedPlanTrackIdsToSSRCs = updateUnifiedPlanTrackIdsToSSRCs;
|
|
28236
28496
|
|
|
28237
|
-
},{"./":
|
|
28497
|
+
},{"./":167}],170:[function(require,module,exports){
|
|
28238
28498
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
28239
28499
|
//
|
|
28240
28500
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -28733,12 +28993,12 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
|
|
28733
28993
|
}
|
|
28734
28994
|
}
|
|
28735
28995
|
|
|
28736
|
-
},{}],
|
|
28996
|
+
},{}],171:[function(require,module,exports){
|
|
28737
28997
|
module.exports={
|
|
28738
28998
|
"name": "twilio-video",
|
|
28739
28999
|
"title": "Twilio Video",
|
|
28740
29000
|
"description": "Twilio Video JavaScript Library",
|
|
28741
|
-
"version": "2.
|
|
29001
|
+
"version": "2.22.2",
|
|
28742
29002
|
"homepage": "https://twilio.com",
|
|
28743
29003
|
"author": "Mark Andrus Roberts <mroberts@twilio.com>",
|
|
28744
29004
|
"contributors": [
|
|
@@ -28835,6 +29095,7 @@ module.exports={
|
|
|
28835
29095
|
"lint": "npm-run-all lint:js lint:ts",
|
|
28836
29096
|
"printVersion": "node --version && npm --version",
|
|
28837
29097
|
"test:unit": "npm-run-all printVersion build:es5 && nyc --report-dir=./coverage --include=lib/**/* --reporter=html --reporter=lcov --reporter=text mocha -r ts-node/register ./test/unit/*",
|
|
29098
|
+
"test:unit:quick": "nyc --report-dir=./coverage --include=lib/**/* --reporter=html --reporter=lcov mocha -r ts-node/register",
|
|
28838
29099
|
"test:serversiderender": "mocha ./test/serversiderender/index.js",
|
|
28839
29100
|
"test:integration:adapter": "node ./scripts/karma.js karma/integration.adapter.conf.js",
|
|
28840
29101
|
"test:integration": "npm run build:es5 && node ./scripts/karma.js karma/integration.conf.js",
|
|
@@ -28891,7 +29152,7 @@ module.exports={
|
|
|
28891
29152
|
}
|
|
28892
29153
|
}
|
|
28893
29154
|
|
|
28894
|
-
},{}],
|
|
29155
|
+
},{}],172:[function(require,module,exports){
|
|
28895
29156
|
module.exports = WebSocket;
|
|
28896
29157
|
|
|
28897
29158
|
},{}]},{},[11]);
|