twilio-video 2.20.1 → 2.21.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 +18 -0
- package/README.md +8 -9
- package/dist/twilio-video.js +179 -114
- package/dist/twilio-video.min.js +22 -22
- package/es5/connect.js +0 -2
- package/es5/connect.js.map +1 -1
- package/es5/createlocaltrack.js +0 -2
- package/es5/createlocaltrack.js.map +1 -1
- package/es5/createlocaltracks.js +152 -92
- package/es5/createlocaltracks.js.map +1 -1
- package/es5/index.js +19 -8
- package/es5/index.js.map +1 -1
- package/lib/connect.js +0 -2
- package/lib/createlocaltrack.js +0 -2
- package/lib/{createlocaltracks.js → createlocaltracks.ts} +65 -44
- package/lib/index.ts +18 -10
- package/package.json +3 -5
- package/tsdef/ConnectOptionsInternal.d.ts +5 -0
- package/tsdef/twilio-video-tests.ts +8 -0
- package/tsdef/types.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@ The Twilio Programmable Video SDKs use [Semantic Versioning](http://www.semver.o
|
|
|
2
2
|
|
|
3
3
|
**Version 1.x reached End of Life on September 8th, 2021.** See the changelog entry [here](https://www.twilio.com/changelog/end-of-life-complete-for-unsupported-versions-of-the-programmable-video-sdk). Support for the 1.x version ended on December 4th, 2020.
|
|
4
4
|
|
|
5
|
+
2.21.0 (March 8, 2022)
|
|
6
|
+
==========================
|
|
7
|
+
|
|
8
|
+
New Features
|
|
9
|
+
------------
|
|
10
|
+
- twilio-video.js now supports WKWebView and SFSafariViewController on iOS version 14.3 or later. The [`isSupported` flag](https://sdk.twilio.com/js/video/releases/2.20.1/docs/module-twilio-video.html) relies partly on the [User-Agent string](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent) to determine if twilio-video.js officially supports the user's browser. If your application modifies the default value for the User-Agent string, the new value should follow the [correct format](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#syntax).
|
|
11
|
+
|
|
12
|
+
Additionally, for [iOS applications](https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_ios), your application will need to include the [camera usage description](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/plist/info/NSCameraUsageDescription), [microphone usage description](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW25) and [inline media playback](https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1614793-allowsinlinemediaplayback) in order for the SDK to work on WKWebView.
|
|
13
|
+
|
|
14
|
+
Note: As with Safari, WKWebViews only support only one local media track of each kind at a time.
|
|
15
|
+
|
|
16
|
+
We also would like to thank @cbxp for his [contribution](https://github.com/twilio/twilio-webrtc.js/pull/133). (VIDEO-8374)
|
|
17
|
+
|
|
18
|
+
Known Issue
|
|
19
|
+
-----------
|
|
20
|
+
|
|
21
|
+
Some [common issues](https://github.com/twilio/twilio-video.js/blob/master/COMMON_ISSUES.md#safari-mobile) such as interruptions on mobile devices which includes, backgrounding the application, or switching between applications can sometimes cause VideoTracks to go black or AudioTracks to stop.
|
|
22
|
+
|
|
5
23
|
2.20.1 (Feb 17, 2022)
|
|
6
24
|
=====================
|
|
7
25
|
Bug Fixes
|
package/README.md
CHANGED
|
@@ -21,13 +21,13 @@ View [CHANGELOG.md](https://github.com/twilio/twilio-video.js/blob/master/CHANGE
|
|
|
21
21
|
Browser Support
|
|
22
22
|
---------------
|
|
23
23
|
|
|
24
|
-
| | Chrome | Edge (Chromium) | Firefox | Safari |
|
|
25
|
-
|
|
|
26
|
-
| **Android** | ✓ | - | ✓ | - |
|
|
27
|
-
| **iOS** | ✓ | - | * | ✓ |
|
|
28
|
-
| **Linux** | ✓ | - | ✓ | - |
|
|
29
|
-
| **macOS** | ✓ | ✓ ** | ✓ | ✓ |
|
|
30
|
-
| **Windows** | ✓ | ✓ ** | ✓ | - |
|
|
24
|
+
| | Chrome | Edge (Chromium) | Firefox | Safari | WebView |
|
|
25
|
+
| ------------|--------|-----------------|---------|--------|---------|
|
|
26
|
+
| **Android** | ✓ | - | ✓ | - | - |
|
|
27
|
+
| **iOS** | ✓ | - | * | ✓ | ✓ |
|
|
28
|
+
| **Linux** | ✓ | - | ✓ | - | - |
|
|
29
|
+
| **macOS** | ✓ | ✓ ** | ✓ | ✓ | - |
|
|
30
|
+
| **Windows** | ✓ | ✓ ** | ✓ | - | - |
|
|
31
31
|
|
|
32
32
|
\*\* twilio-video.js supports the [Chromium-based Edge](https://www.microsoftedgeinsider.com/) browser.
|
|
33
33
|
|
|
@@ -74,7 +74,7 @@ Releases of twilio-video.js are hosted on a CDN, and you can include these
|
|
|
74
74
|
directly in your web app using a <script> tag.
|
|
75
75
|
|
|
76
76
|
```html
|
|
77
|
-
<script src="//sdk.twilio.com/js/video/releases/2.
|
|
77
|
+
<script src="//sdk.twilio.com/js/video/releases/2.21.0/twilio-video.min.js"></script>
|
|
78
78
|
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -235,4 +235,3 @@ License
|
|
|
235
235
|
-------
|
|
236
236
|
|
|
237
237
|
See [LICENSE.md](https://github.com/twilio/twilio-video.js/blob/master/LICENSE.md).
|
|
238
|
-
|
package/dist/twilio-video.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! twilio-video.js 2.
|
|
1
|
+
/*! twilio-video.js 2.21.0
|
|
2
2
|
|
|
3
3
|
The following license applies to all parts of this software except as
|
|
4
4
|
documented below.
|
|
@@ -88,7 +88,6 @@ module.exports = createCancelableRoomPromise;
|
|
|
88
88
|
var MediaStreamTrack = require('@twilio/webrtc').MediaStreamTrack;
|
|
89
89
|
var _a = require('@twilio/webrtc/lib/util'), guessBrowser = _a.guessBrowser, guessBrowserVersion = _a.guessBrowserVersion;
|
|
90
90
|
var createCancelableRoomPromise = require('./cancelableroompromise');
|
|
91
|
-
var createLocalTracks = require('./createlocaltracks');
|
|
92
91
|
var EncodingParametersImpl = require('./encodingparameters');
|
|
93
92
|
var LocalParticipant = require('./localparticipant');
|
|
94
93
|
var InsightsPublisher = require('./util/insightspublisher');
|
|
@@ -283,7 +282,6 @@ function connect(token, options) {
|
|
|
283
282
|
}
|
|
284
283
|
options = Object.assign({
|
|
285
284
|
automaticSubscription: true,
|
|
286
|
-
createLocalTracks: createLocalTracks,
|
|
287
285
|
dominantSpeaker: false,
|
|
288
286
|
enableDscp: false,
|
|
289
287
|
environment: DEFAULT_ENVIRONMENT,
|
|
@@ -992,9 +990,8 @@ function normalizeCodecSettings(nameOrSettings) {
|
|
|
992
990
|
}
|
|
993
991
|
module.exports = connect;
|
|
994
992
|
|
|
995
|
-
},{"./cancelableroompromise":1,"./
|
|
993
|
+
},{"./cancelableroompromise":1,"./encodingparameters":9,"./localparticipant":12,"./media/track/es5":14,"./networkqualityconfiguration":42,"./room":54,"./signaling/v2":68,"./util":127,"./util/cancelablepromise":120,"./util/constants":121,"./util/eventobserver":125,"./util/insightspublisher":128,"./util/insightspublisher/null":129,"./util/log":131,"./util/validate":144,"@twilio/webrtc":151,"@twilio/webrtc/lib/util":164}],3:[function(require,module,exports){
|
|
996
994
|
'use strict';
|
|
997
|
-
var defaultCreateLocalTracks = require('./createlocaltracks');
|
|
998
995
|
var _a = require('./util/constants'), DEFAULT_LOG_LEVEL = _a.DEFAULT_LOG_LEVEL, DEFAULT_LOGGER_NAME = _a.DEFAULT_LOGGER_NAME;
|
|
999
996
|
/**
|
|
1000
997
|
* Request a {@link LocalAudioTrack} or {@link LocalVideoTrack}.
|
|
@@ -1005,7 +1002,6 @@ var _a = require('./util/constants'), DEFAULT_LOG_LEVEL = _a.DEFAULT_LOG_LEVEL,
|
|
|
1005
1002
|
*/
|
|
1006
1003
|
function createLocalTrack(kind, options) {
|
|
1007
1004
|
options = Object.assign({
|
|
1008
|
-
createLocalTracks: defaultCreateLocalTracks,
|
|
1009
1005
|
loggerName: DEFAULT_LOGGER_NAME,
|
|
1010
1006
|
logLevel: DEFAULT_LOG_LEVEL,
|
|
1011
1007
|
}, options);
|
|
@@ -1105,20 +1101,89 @@ module.exports = {
|
|
|
1105
1101
|
video: createLocalVideoTrack
|
|
1106
1102
|
};
|
|
1107
1103
|
|
|
1108
|
-
},{"./
|
|
1104
|
+
},{"./util/constants":121}],4:[function(require,module,exports){
|
|
1109
1105
|
'use strict';
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1112
|
-
var
|
|
1113
|
-
|
|
1114
|
-
var
|
|
1106
|
+
var __assign = (this && this.__assign) || function () {
|
|
1107
|
+
__assign = Object.assign || function(t) {
|
|
1108
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1109
|
+
s = arguments[i];
|
|
1110
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1111
|
+
t[p] = s[p];
|
|
1112
|
+
}
|
|
1113
|
+
return t;
|
|
1114
|
+
};
|
|
1115
|
+
return __assign.apply(this, arguments);
|
|
1116
|
+
};
|
|
1117
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
1118
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
1119
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
1120
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
1121
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
1122
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
1123
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1124
|
+
});
|
|
1125
|
+
};
|
|
1126
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
1127
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1128
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
1129
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1130
|
+
function step(op) {
|
|
1131
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
1132
|
+
while (_) try {
|
|
1133
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1134
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1135
|
+
switch (op[0]) {
|
|
1136
|
+
case 0: case 1: t = op; break;
|
|
1137
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
1138
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1139
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1140
|
+
default:
|
|
1141
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1142
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1143
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1144
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1145
|
+
if (t[2]) _.ops.pop();
|
|
1146
|
+
_.trys.pop(); continue;
|
|
1147
|
+
}
|
|
1148
|
+
op = body.call(thisArg, _);
|
|
1149
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1150
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
1154
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1155
|
+
if (!m) return o;
|
|
1156
|
+
var i = m.call(o), r, ar = [], e;
|
|
1157
|
+
try {
|
|
1158
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
1159
|
+
}
|
|
1160
|
+
catch (error) { e = { error: error }; }
|
|
1161
|
+
finally {
|
|
1162
|
+
try {
|
|
1163
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
1164
|
+
}
|
|
1165
|
+
finally { if (e) throw e.error; }
|
|
1166
|
+
}
|
|
1167
|
+
return ar;
|
|
1168
|
+
};
|
|
1169
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
1170
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
1171
|
+
to[j] = from[i];
|
|
1172
|
+
return to;
|
|
1173
|
+
};
|
|
1174
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1175
|
+
exports.createLocalTracks = void 0;
|
|
1176
|
+
var _a = require('./util'), asLocalTrack = _a.asLocalTrack, buildLogLevels = _a.buildLogLevels;
|
|
1177
|
+
var _b = require('@twilio/webrtc'), getUserMedia = _b.getUserMedia, MediaStreamTrack = _b.MediaStreamTrack;
|
|
1178
|
+
var _c = require('./media/track/es5'), LocalAudioTrack = _c.LocalAudioTrack, LocalDataTrack = _c.LocalDataTrack, LocalVideoTrack = _c.LocalVideoTrack;
|
|
1115
1179
|
var Log = require('./util/log');
|
|
1116
|
-
var
|
|
1180
|
+
var _d = require('./util/constants'), DEFAULT_LOG_LEVEL = _d.DEFAULT_LOG_LEVEL, DEFAULT_LOGGER_NAME = _d.DEFAULT_LOGGER_NAME;
|
|
1117
1181
|
var workaround180748 = require('./webaudio/workaround180748');
|
|
1118
1182
|
// This is used to make out which createLocalTracks() call a particular Log
|
|
1119
1183
|
// statement belongs to. Each call to createLocalTracks() increments this
|
|
1120
1184
|
// counter.
|
|
1121
1185
|
var createLocalTrackCalls = 0;
|
|
1186
|
+
;
|
|
1122
1187
|
/**
|
|
1123
1188
|
* Request {@link LocalTrack}s. By default, it requests a
|
|
1124
1189
|
* {@link LocalAudioTrack} and a {@link LocalVideoTrack}.
|
|
@@ -1177,94 +1242,85 @@ var createLocalTrackCalls = 0;
|
|
|
1177
1242
|
*
|
|
1178
1243
|
*/
|
|
1179
1244
|
function createLocalTracks(options) {
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1245
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1246
|
+
var isAudioVideoAbsent, fullOptions, logComponentName, logLevels, log, localTrackOptions, extraLocalTrackOptions, mediaStreamConstraints, workaroundWebKitBug180748, mediaStream, mediaStreamTracks, error_1;
|
|
1247
|
+
return __generator(this, function (_a) {
|
|
1248
|
+
switch (_a.label) {
|
|
1249
|
+
case 0:
|
|
1250
|
+
isAudioVideoAbsent = !(options && ('audio' in options || 'video' in options));
|
|
1251
|
+
fullOptions = __assign({ audio: isAudioVideoAbsent, getUserMedia: getUserMedia, loggerName: DEFAULT_LOGGER_NAME, logLevel: DEFAULT_LOG_LEVEL, LocalAudioTrack: LocalAudioTrack,
|
|
1252
|
+
LocalDataTrack: LocalDataTrack,
|
|
1253
|
+
LocalVideoTrack: LocalVideoTrack,
|
|
1254
|
+
MediaStreamTrack: MediaStreamTrack,
|
|
1255
|
+
Log: Log, video: isAudioVideoAbsent }, options);
|
|
1256
|
+
logComponentName = "[createLocalTracks #" + ++createLocalTrackCalls + "]";
|
|
1257
|
+
logLevels = buildLogLevels(fullOptions.logLevel);
|
|
1258
|
+
log = new fullOptions.Log('default', logComponentName, logLevels, fullOptions.loggerName);
|
|
1259
|
+
localTrackOptions = Object.assign({ log: log }, fullOptions);
|
|
1260
|
+
// NOTE(mmalavalli): The Room "name" in "options" was being used
|
|
1261
|
+
// as the LocalTrack name in asLocalTrack(). So we pass a copy of
|
|
1262
|
+
// "options" without the "name".
|
|
1263
|
+
// NOTE(joma): CreateLocalTracksOptions type does not really have a "name" property when used publicly by customers.
|
|
1264
|
+
// But we are passing this property when used internally by other JS files.
|
|
1265
|
+
// We can update this "any" type once those JS files are converted to TS.
|
|
1266
|
+
delete localTrackOptions.name;
|
|
1267
|
+
if (fullOptions.audio === false && fullOptions.video === false) {
|
|
1268
|
+
log.info('Neither audio nor video requested, so returning empty LocalTracks');
|
|
1269
|
+
return [2 /*return*/, []];
|
|
1270
|
+
}
|
|
1271
|
+
if (fullOptions.tracks) {
|
|
1272
|
+
log.info('Adding user-provided LocalTracks');
|
|
1273
|
+
log.debug('LocalTracks:', fullOptions.tracks);
|
|
1274
|
+
return [2 /*return*/, fullOptions.tracks];
|
|
1275
|
+
}
|
|
1276
|
+
extraLocalTrackOptions = {
|
|
1277
|
+
audio: typeof fullOptions.audio === 'object' && fullOptions.audio.name
|
|
1278
|
+
? { name: fullOptions.audio.name }
|
|
1279
|
+
: {},
|
|
1280
|
+
video: typeof fullOptions.video === 'object' && fullOptions.video.name
|
|
1281
|
+
? { name: fullOptions.video.name }
|
|
1282
|
+
: {}
|
|
1283
|
+
};
|
|
1284
|
+
extraLocalTrackOptions.audio.isCreatedByCreateLocalTracks = true;
|
|
1285
|
+
extraLocalTrackOptions.video.isCreatedByCreateLocalTracks = true;
|
|
1286
|
+
if (typeof fullOptions.audio === 'object' && typeof fullOptions.audio.workaroundWebKitBug1208516 === 'boolean') {
|
|
1287
|
+
extraLocalTrackOptions.audio.workaroundWebKitBug1208516 = fullOptions.audio.workaroundWebKitBug1208516;
|
|
1288
|
+
}
|
|
1289
|
+
if (typeof fullOptions.video === 'object' && typeof fullOptions.video.workaroundWebKitBug1208516 === 'boolean') {
|
|
1290
|
+
extraLocalTrackOptions.video.workaroundWebKitBug1208516 = fullOptions.video.workaroundWebKitBug1208516;
|
|
1291
|
+
}
|
|
1292
|
+
if (typeof fullOptions.audio === 'object') {
|
|
1293
|
+
delete fullOptions.audio.name;
|
|
1294
|
+
}
|
|
1295
|
+
if (typeof fullOptions.video === 'object') {
|
|
1296
|
+
delete fullOptions.video.name;
|
|
1297
|
+
}
|
|
1298
|
+
mediaStreamConstraints = {
|
|
1299
|
+
audio: fullOptions.audio,
|
|
1300
|
+
video: fullOptions.video
|
|
1301
|
+
};
|
|
1302
|
+
workaroundWebKitBug180748 = typeof fullOptions.audio === 'object' && fullOptions.audio.workaroundWebKitBug180748;
|
|
1303
|
+
_a.label = 1;
|
|
1304
|
+
case 1:
|
|
1305
|
+
_a.trys.push([1, 3, , 4]);
|
|
1306
|
+
return [4 /*yield*/, (workaroundWebKitBug180748
|
|
1307
|
+
? workaround180748(log, fullOptions.getUserMedia, mediaStreamConstraints)
|
|
1308
|
+
: fullOptions.getUserMedia(mediaStreamConstraints))];
|
|
1309
|
+
case 2:
|
|
1310
|
+
mediaStream = _a.sent();
|
|
1311
|
+
mediaStreamTracks = __spreadArray(__spreadArray([], __read(mediaStream.getAudioTracks())), __read(mediaStream.getVideoTracks()));
|
|
1312
|
+
log.info('Call to getUserMedia successful; got MediaStreamTracks:', mediaStreamTracks);
|
|
1313
|
+
return [2 /*return*/, mediaStreamTracks.map(function (mediaStreamTrack) { return asLocalTrack(mediaStreamTrack, __assign(__assign({}, extraLocalTrackOptions[mediaStreamTrack.kind]), localTrackOptions)); })];
|
|
1314
|
+
case 3:
|
|
1315
|
+
error_1 = _a.sent();
|
|
1316
|
+
log.warn('Call to getUserMedia failed:', error_1);
|
|
1317
|
+
throw error_1;
|
|
1318
|
+
case 4: return [2 /*return*/];
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1247
1321
|
});
|
|
1248
1322
|
}
|
|
1249
|
-
|
|
1250
|
-
* {@link createLocalTracks} options
|
|
1251
|
-
* @typedef {object} CreateLocalTracksOptions
|
|
1252
|
-
* @property {boolean|CreateLocalTrackOptions} [audio=true] - Whether or not to
|
|
1253
|
-
* get local audio with <code>getUserMedia</code> when <code>tracks</code>
|
|
1254
|
-
* are not provided.
|
|
1255
|
-
* @property {LogLevel|LogLevels} [logLevel='warn'] - <code>(deprecated: use [Video.Logger](module-twilio-video.html) instead.
|
|
1256
|
-
* See [examples](module-twilio-video.html#.connect) for details)</code>
|
|
1257
|
-
* Set the default log verbosity
|
|
1258
|
-
* of logging. Passing a {@link LogLevel} string will use the same
|
|
1259
|
-
* level for all components. Pass a {@link LogLevels} to set specific log
|
|
1260
|
-
* levels.
|
|
1261
|
-
* @property {string} [loggerName='twilio-video'] - The name of the logger. Use this name when accessing the logger used by the SDK.
|
|
1262
|
-
* See [examples](module-twilio-video.html#.connect) for details.
|
|
1263
|
-
* @property {boolean|CreateLocalTrackOptions} [video=true] - Whether or not to
|
|
1264
|
-
* get local video with <code>getUserMedia</code> when <code>tracks</code>
|
|
1265
|
-
* are not provided.
|
|
1266
|
-
*/
|
|
1267
|
-
module.exports = createLocalTracks;
|
|
1323
|
+
exports.createLocalTracks = createLocalTracks;
|
|
1268
1324
|
|
|
1269
1325
|
},{"./media/track/es5":14,"./util":127,"./util/constants":121,"./util/log":131,"./webaudio/workaround180748":148,"@twilio/webrtc":151}],5:[function(require,module,exports){
|
|
1270
1326
|
'use strict';
|
|
@@ -1728,12 +1784,23 @@ module.exports = hidePrivateAndCertainPublicPropertiesInClass(EventEmitter, ['do
|
|
|
1728
1784
|
|
|
1729
1785
|
},{"./util":127,"events":178}],11:[function(require,module,exports){
|
|
1730
1786
|
'use strict';
|
|
1787
|
+
var __assign = (this && this.__assign) || function () {
|
|
1788
|
+
__assign = Object.assign || function(t) {
|
|
1789
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1790
|
+
s = arguments[i];
|
|
1791
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1792
|
+
t[p] = s[p];
|
|
1793
|
+
}
|
|
1794
|
+
return t;
|
|
1795
|
+
};
|
|
1796
|
+
return __assign.apply(this, arguments);
|
|
1797
|
+
};
|
|
1731
1798
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1799
|
+
var createlocaltracks_1 = require("./createlocaltracks");
|
|
1732
1800
|
var preflighttest_1 = require("./preflight/preflighttest");
|
|
1733
1801
|
var internals = {
|
|
1734
1802
|
connect: require('./connect'),
|
|
1735
1803
|
createLocalAudioTrack: require('./createlocaltrack').audio,
|
|
1736
|
-
createLocalTracks: require('./createlocaltracks'),
|
|
1737
1804
|
createLocalVideoTrack: require('./createlocaltrack').video,
|
|
1738
1805
|
isSupported: require('./util/support')(),
|
|
1739
1806
|
version: require('../package.json').version,
|
|
@@ -1743,16 +1810,16 @@ var internals = {
|
|
|
1743
1810
|
LocalVideoTrack: require('./media/track/es5').LocalVideoTrack
|
|
1744
1811
|
};
|
|
1745
1812
|
function connect(token, options) {
|
|
1746
|
-
|
|
1813
|
+
var internalOptions = __assign({ createLocalTracks: createlocaltracks_1.createLocalTracks }, options);
|
|
1814
|
+
return internals.connect(token, internalOptions);
|
|
1747
1815
|
}
|
|
1748
1816
|
function createLocalAudioTrack(options) {
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
function createLocalTracks(options) {
|
|
1752
|
-
return internals.createLocalTracks(options);
|
|
1817
|
+
var internalOptions = __assign({ createLocalTracks: createlocaltracks_1.createLocalTracks }, options);
|
|
1818
|
+
return internals.createLocalAudioTrack(internalOptions);
|
|
1753
1819
|
}
|
|
1754
1820
|
function createLocalVideoTrack(options) {
|
|
1755
|
-
|
|
1821
|
+
var internalOptions = __assign({ createLocalTracks: createlocaltracks_1.createLocalTracks }, options);
|
|
1822
|
+
return internals.createLocalVideoTrack(internalOptions);
|
|
1756
1823
|
}
|
|
1757
1824
|
/**
|
|
1758
1825
|
* @module twilio-video
|
|
@@ -1778,8 +1845,8 @@ var LocalDataTrack = internals.LocalDataTrack;
|
|
|
1778
1845
|
module.exports = {
|
|
1779
1846
|
connect: connect,
|
|
1780
1847
|
createLocalAudioTrack: createLocalAudioTrack,
|
|
1781
|
-
createLocalTracks: createLocalTracks,
|
|
1782
1848
|
createLocalVideoTrack: createLocalVideoTrack,
|
|
1849
|
+
createLocalTracks: createlocaltracks_1.createLocalTracks,
|
|
1783
1850
|
runPreflight: preflighttest_1.runPreflight,
|
|
1784
1851
|
isSupported: isSupported,
|
|
1785
1852
|
version: version,
|
|
@@ -27698,7 +27765,7 @@ function guessBrowser(userAgent) {
|
|
|
27698
27765
|
if (/Firefox|FxiOS/.test(userAgent)) {
|
|
27699
27766
|
return 'firefox';
|
|
27700
27767
|
}
|
|
27701
|
-
if (/Safari/.test(userAgent)) {
|
|
27768
|
+
if (/Safari|iPhone|iPad|iPod/.test(userAgent)) {
|
|
27702
27769
|
return 'safari';
|
|
27703
27770
|
}
|
|
27704
27771
|
return null;
|
|
@@ -28312,7 +28379,7 @@ exports.updateUnifiedPlanTrackIdsToSSRCs = updateUnifiedPlanTrackIdsToSSRCs;
|
|
|
28312
28379
|
},{"./":164}],167:[function(require,module,exports){
|
|
28313
28380
|
module.exports={
|
|
28314
28381
|
"name": "@twilio/webrtc",
|
|
28315
|
-
"version": "4.
|
|
28382
|
+
"version": "4.6.0",
|
|
28316
28383
|
"description": "WebRTC-related APIs and shims used by twilio-video.js",
|
|
28317
28384
|
"scripts": {
|
|
28318
28385
|
"build": "npm-run-all clean lint test",
|
|
@@ -31535,7 +31602,7 @@ module.exports={
|
|
|
31535
31602
|
"name": "twilio-video",
|
|
31536
31603
|
"title": "Twilio Video",
|
|
31537
31604
|
"description": "Twilio Video JavaScript Library",
|
|
31538
|
-
"version": "2.
|
|
31605
|
+
"version": "2.21.0",
|
|
31539
31606
|
"homepage": "https://twilio.com",
|
|
31540
31607
|
"author": "Mark Andrus Roberts <mroberts@twilio.com>",
|
|
31541
31608
|
"contributors": [
|
|
@@ -31631,9 +31698,7 @@ module.exports={
|
|
|
31631
31698
|
"lint:ts": "eslint ./tsdef/*.ts ./lib/**/*.ts",
|
|
31632
31699
|
"lint": "npm-run-all lint:js lint:ts",
|
|
31633
31700
|
"printVersion": "node --version && npm --version",
|
|
31634
|
-
"test:unit": "npm-run-all printVersion build:es5
|
|
31635
|
-
"test:unit:js": "nyc --report-dir=./coverage/js --extension=.js --include=lib/**/* --reporter=html --reporter=lcov --reporter=text mocha ./test/unit/index.js",
|
|
31636
|
-
"test:unit:ts": "nyc --report-dir=./coverage/ts --extension=.ts --include=lib/**/* --reporter=html --reporter=lcov --reporter=text mocha -r ts-node/register ./test/unit/index.ts",
|
|
31701
|
+
"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/*",
|
|
31637
31702
|
"test:serversiderender": "mocha ./test/serversiderender/index.js",
|
|
31638
31703
|
"test:integration:adapter": "node ./scripts/karma.js karma/integration.adapter.conf.js",
|
|
31639
31704
|
"test:integration": "npm run build:es5 && node ./scripts/karma.js karma/integration.conf.js",
|
|
@@ -31679,7 +31744,7 @@ module.exports={
|
|
|
31679
31744
|
"clean": "rimraf ./coverage ./es5 ./dist"
|
|
31680
31745
|
},
|
|
31681
31746
|
"dependencies": {
|
|
31682
|
-
"@twilio/webrtc": "4.
|
|
31747
|
+
"@twilio/webrtc": "4.6.0",
|
|
31683
31748
|
"backoff": "^2.5.0",
|
|
31684
31749
|
"ws": "^7.4.6",
|
|
31685
31750
|
"xmlhttprequest": "^1.8.0"
|