@microsoft/teams-js 2.0.0-beta.3-dev.37 → 2.0.0-beta.3-dev.41

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.
@@ -1120,10 +1120,10 @@ __webpack_require__.d(__webpack_exports__, {
1120
1120
  });
1121
1121
 
1122
1122
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1123
- var version = "2.0.0-beta.3-dev.37";
1123
+ var version = "2.0.0-beta.3-dev.41";
1124
1124
  /**
1125
1125
  * @hidden
1126
- * The SDK version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
1126
+ * The client version when all SDK APIs started to check platform compatibility for the APIs was 1.6.0.
1127
1127
  * Modified to 2.0.1 which is hightest till now so that if any client doesn't pass version in initialize function, it will be set to highest.
1128
1128
  * Mobile clients are passing versions, hence will be applicable to web and desktop clients only.
1129
1129
  *
@@ -1132,11 +1132,15 @@ var version = "2.0.0-beta.3-dev.37";
1132
1132
  var defaultSDKVersionForCompatCheck = '2.0.1';
1133
1133
  /**
1134
1134
  * @hidden
1135
- * This is the SDK version when selectMedia API - VideoAndImage is supported on mobile.
1135
+ * This is the client version when selectMedia API - VideoAndImage is supported on mobile.
1136
1136
  *
1137
1137
  * @internal
1138
1138
  */
1139
1139
  var videoAndImageMediaAPISupportVersion = '2.0.2';
1140
+ /**
1141
+ * This is the client version when selectMedia API - Video with non-full screen mode is supported on mobile.
1142
+ */
1143
+ var nonFullScreenVideoModeAPISupportVersion = '2.0.3';
1140
1144
  /**
1141
1145
  * @hidden
1142
1146
  * Minimum required client supported version for {@link getUserJoinedTeams} to be supported on {@link HostClientType.android}
@@ -1146,42 +1150,42 @@ var videoAndImageMediaAPISupportVersion = '2.0.2';
1146
1150
  var getUserJoinedTeamsSupportedAndroidClientVersion = '2.0.1';
1147
1151
  /**
1148
1152
  * @hidden
1149
- * This is the SDK version when location APIs (getLocation and showLocation) are supported.
1153
+ * This is the client version when location APIs (getLocation and showLocation) are supported.
1150
1154
  *
1151
1155
  * @internal
1152
1156
  */
1153
1157
  var locationAPIsRequiredVersion = '1.9.0';
1154
1158
  /**
1155
1159
  * @hidden
1156
- * This is the SDK version when people picker API is supported on mobile.
1160
+ * This is the client version when people picker API is supported on mobile.
1157
1161
  *
1158
1162
  * @internal
1159
1163
  */
1160
1164
  var peoplePickerRequiredVersion = '2.0.0';
1161
1165
  /**
1162
1166
  * @hidden
1163
- * This is the SDK version when captureImage API is supported on mobile.
1167
+ * This is the client version when captureImage API is supported on mobile.
1164
1168
  *
1165
1169
  * @internal
1166
1170
  */
1167
1171
  var captureImageMobileSupportVersion = '1.7.0';
1168
1172
  /**
1169
1173
  * @hidden
1170
- * This is the SDK version when media APIs are supported on all three platforms ios, android and web.
1174
+ * This is the client version when media APIs are supported on all three platforms ios, android and web.
1171
1175
  *
1172
1176
  * @internal
1173
1177
  */
1174
1178
  var mediaAPISupportVersion = '1.8.0';
1175
1179
  /**
1176
1180
  * @hidden
1177
- * This is the SDK version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
1181
+ * This is the client version when getMedia API is supported via Callbacks on all three platforms ios, android and web.
1178
1182
  *
1179
1183
  * @internal
1180
1184
  */
1181
1185
  var getMediaCallbackSupportVersion = '2.0.0';
1182
1186
  /**
1183
1187
  * @hidden
1184
- * This is the SDK version when scanBarCode API is supported on mobile.
1188
+ * This is the client version when scanBarCode API is supported on mobile.
1185
1189
  *
1186
1190
  * @internal
1187
1191
  */
@@ -1241,6 +1245,164 @@ var GlobalVars = /** @class */ (function () {
1241
1245
  }());
1242
1246
 
1243
1247
 
1248
+ ;// CONCATENATED MODULE: ./src/public/constants.ts
1249
+ var HostClientType;
1250
+ (function (HostClientType) {
1251
+ HostClientType["desktop"] = "desktop";
1252
+ HostClientType["web"] = "web";
1253
+ HostClientType["android"] = "android";
1254
+ HostClientType["ios"] = "ios";
1255
+ /**
1256
+ * @deprecated
1257
+ * As of 2.0.0-beta.1, please use {@link teamsRoomsWindows} instead.
1258
+ */
1259
+ HostClientType["rigel"] = "rigel";
1260
+ HostClientType["surfaceHub"] = "surfaceHub";
1261
+ HostClientType["teamsRoomsWindows"] = "teamsRoomsWindows";
1262
+ HostClientType["teamsRoomsAndroid"] = "teamsRoomsAndroid";
1263
+ HostClientType["teamsPhones"] = "teamsPhones";
1264
+ HostClientType["teamsDisplays"] = "teamsDisplays";
1265
+ })(HostClientType || (HostClientType = {}));
1266
+ var HostName;
1267
+ (function (HostName) {
1268
+ HostName["office"] = "Office";
1269
+ HostName["outlook"] = "Outlook";
1270
+ HostName["orange"] = "Orange";
1271
+ HostName["teams"] = "Teams";
1272
+ })(HostName || (HostName = {}));
1273
+ // Ensure these declarations stay in sync with the framework.
1274
+ var FrameContexts;
1275
+ (function (FrameContexts) {
1276
+ FrameContexts["settings"] = "settings";
1277
+ FrameContexts["content"] = "content";
1278
+ FrameContexts["authentication"] = "authentication";
1279
+ FrameContexts["remove"] = "remove";
1280
+ FrameContexts["task"] = "task";
1281
+ FrameContexts["sidePanel"] = "sidePanel";
1282
+ FrameContexts["stage"] = "stage";
1283
+ FrameContexts["meetingStage"] = "meetingStage";
1284
+ })(FrameContexts || (FrameContexts = {}));
1285
+ /**
1286
+ * Indicates the team type, currently used to distinguish between different team
1287
+ * types in Office 365 for Education (team types 1, 2, 3, and 4).
1288
+ */
1289
+ var TeamType;
1290
+ (function (TeamType) {
1291
+ TeamType[TeamType["Standard"] = 0] = "Standard";
1292
+ TeamType[TeamType["Edu"] = 1] = "Edu";
1293
+ TeamType[TeamType["Class"] = 2] = "Class";
1294
+ TeamType[TeamType["Plc"] = 3] = "Plc";
1295
+ TeamType[TeamType["Staff"] = 4] = "Staff";
1296
+ })(TeamType || (TeamType = {}));
1297
+ /**
1298
+ * Indicates the various types of roles of a user in a team.
1299
+ */
1300
+ var UserTeamRole;
1301
+ (function (UserTeamRole) {
1302
+ UserTeamRole[UserTeamRole["Admin"] = 0] = "Admin";
1303
+ UserTeamRole[UserTeamRole["User"] = 1] = "User";
1304
+ UserTeamRole[UserTeamRole["Guest"] = 2] = "Guest";
1305
+ })(UserTeamRole || (UserTeamRole = {}));
1306
+ /**
1307
+ * Dialog module dimension enum
1308
+ */
1309
+ var DialogDimension;
1310
+ (function (DialogDimension) {
1311
+ DialogDimension["Large"] = "large";
1312
+ DialogDimension["Medium"] = "medium";
1313
+ DialogDimension["Small"] = "small";
1314
+ })(DialogDimension || (DialogDimension = {}));
1315
+ /**
1316
+ * @deprecated
1317
+ * As of 2.0.0-beta.1, please use {@link DialogDimension} instead.
1318
+ */
1319
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1320
+ var TaskModuleDimension = DialogDimension;
1321
+ /**
1322
+ * The type of the channel with which the content is associated.
1323
+ */
1324
+ var ChannelType;
1325
+ (function (ChannelType) {
1326
+ ChannelType["Regular"] = "Regular";
1327
+ ChannelType["Private"] = "Private";
1328
+ ChannelType["Shared"] = "Shared";
1329
+ })(ChannelType || (ChannelType = {}));
1330
+
1331
+ ;// CONCATENATED MODULE: ./src/public/interfaces.ts
1332
+ /* eslint-disable @typescript-eslint/no-explicit-any*/
1333
+ /**
1334
+ * Allowed user file open preferences
1335
+ */
1336
+ var FileOpenPreference;
1337
+ (function (FileOpenPreference) {
1338
+ FileOpenPreference["Inline"] = "inline";
1339
+ FileOpenPreference["Desktop"] = "desktop";
1340
+ FileOpenPreference["Web"] = "web";
1341
+ })(FileOpenPreference || (FileOpenPreference = {}));
1342
+ var ErrorCode;
1343
+ (function (ErrorCode) {
1344
+ /**
1345
+ * API not supported in the current platform.
1346
+ */
1347
+ ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
1348
+ /**
1349
+ * Internal error encountered while performing the required operation.
1350
+ */
1351
+ ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
1352
+ /**
1353
+ * API is not supported in the current context
1354
+ */
1355
+ ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
1356
+ /**
1357
+ Permissions denied by user
1358
+ */
1359
+ ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
1360
+ /**
1361
+ * Network issue
1362
+ */
1363
+ ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
1364
+ /**
1365
+ * Underlying hardware doesn't support the capability
1366
+ */
1367
+ ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
1368
+ /**
1369
+ * One or more arguments are invalid
1370
+ */
1371
+ ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
1372
+ /**
1373
+ * User is not authorized for this operation
1374
+ */
1375
+ ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
1376
+ /**
1377
+ * Could not complete the operation due to insufficient resources
1378
+ */
1379
+ ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
1380
+ /**
1381
+ * Platform throttled the request because of API was invoked too frequently
1382
+ */
1383
+ ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
1384
+ /**
1385
+ * User aborted the operation
1386
+ */
1387
+ ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
1388
+ /**
1389
+ * Could not complete the operation in the given time interval
1390
+ */
1391
+ ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
1392
+ /**
1393
+ * Platform code is old and doesn't implement this API
1394
+ */
1395
+ ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
1396
+ /**
1397
+ * The file specified was not found on the given location
1398
+ */
1399
+ ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
1400
+ /**
1401
+ * The return value is too big and has exceeded our size boundries
1402
+ */
1403
+ ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
1404
+ })(ErrorCode || (ErrorCode = {}));
1405
+
1244
1406
  // EXTERNAL MODULE: ../../node_modules/uuid/index.js
1245
1407
  var uuid = __webpack_require__(22);
1246
1408
  ;// CONCATENATED MODULE: ./src/internal/utils.ts
@@ -1549,6 +1711,8 @@ function createTeamsAppLink(params) {
1549
1711
 
1550
1712
 
1551
1713
 
1714
+
1715
+
1552
1716
  /** @internal */
1553
1717
  function ensureInitialized() {
1554
1718
  var expectedFrameContexts = [];
@@ -1589,6 +1753,35 @@ function isAPISupportedByPlatform(requiredVersion) {
1589
1753
  }
1590
1754
  return value >= 0;
1591
1755
  }
1756
+ /**
1757
+ * @hidden
1758
+ * Helper function to identify if host client is either android or ios
1759
+ *
1760
+ * @internal
1761
+ */
1762
+ function isHostClientMobile() {
1763
+ return GlobalVars.hostClientType == HostClientType.android || GlobalVars.hostClientType == HostClientType.ios;
1764
+ }
1765
+ /**
1766
+ * @hidden
1767
+ * Helper function which indicates if current API is supported on mobile or not.
1768
+ * @returns SdkError if host client is not android/ios or if the requiredVersion is not
1769
+ * supported by platform or not. Null is returned in case of success.
1770
+ *
1771
+ * @internal
1772
+ */
1773
+ function isApiSupportedOnMobile(requiredVersion) {
1774
+ if (requiredVersion === void 0) { requiredVersion = defaultSDKVersionForCompatCheck; }
1775
+ if (!isHostClientMobile()) {
1776
+ var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
1777
+ return notSupportedError;
1778
+ }
1779
+ else if (!isAPISupportedByPlatform(requiredVersion)) {
1780
+ var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
1781
+ return oldPlatformError;
1782
+ }
1783
+ return null;
1784
+ }
1592
1785
  /**
1593
1786
  * @hidden
1594
1787
  * Processes the valid origins specifuied by the user, de-duplicates and converts them into a regexp
@@ -1954,89 +2147,6 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
1954
2147
  registerHandler('userSettingsChange', handler, true, [settingTypes]);
1955
2148
  }
1956
2149
 
1957
- ;// CONCATENATED MODULE: ./src/public/constants.ts
1958
- var HostClientType;
1959
- (function (HostClientType) {
1960
- HostClientType["desktop"] = "desktop";
1961
- HostClientType["web"] = "web";
1962
- HostClientType["android"] = "android";
1963
- HostClientType["ios"] = "ios";
1964
- /**
1965
- * @deprecated
1966
- * As of 2.0.0-beta.1, please use {@link teamsRoomsWindows} instead.
1967
- */
1968
- HostClientType["rigel"] = "rigel";
1969
- HostClientType["surfaceHub"] = "surfaceHub";
1970
- HostClientType["teamsRoomsWindows"] = "teamsRoomsWindows";
1971
- HostClientType["teamsRoomsAndroid"] = "teamsRoomsAndroid";
1972
- HostClientType["teamsPhones"] = "teamsPhones";
1973
- HostClientType["teamsDisplays"] = "teamsDisplays";
1974
- })(HostClientType || (HostClientType = {}));
1975
- var HostName;
1976
- (function (HostName) {
1977
- HostName["office"] = "Office";
1978
- HostName["outlook"] = "Outlook";
1979
- HostName["orange"] = "Orange";
1980
- HostName["teams"] = "Teams";
1981
- })(HostName || (HostName = {}));
1982
- // Ensure these declarations stay in sync with the framework.
1983
- var FrameContexts;
1984
- (function (FrameContexts) {
1985
- FrameContexts["settings"] = "settings";
1986
- FrameContexts["content"] = "content";
1987
- FrameContexts["authentication"] = "authentication";
1988
- FrameContexts["remove"] = "remove";
1989
- FrameContexts["task"] = "task";
1990
- FrameContexts["sidePanel"] = "sidePanel";
1991
- FrameContexts["stage"] = "stage";
1992
- FrameContexts["meetingStage"] = "meetingStage";
1993
- })(FrameContexts || (FrameContexts = {}));
1994
- /**
1995
- * Indicates the team type, currently used to distinguish between different team
1996
- * types in Office 365 for Education (team types 1, 2, 3, and 4).
1997
- */
1998
- var TeamType;
1999
- (function (TeamType) {
2000
- TeamType[TeamType["Standard"] = 0] = "Standard";
2001
- TeamType[TeamType["Edu"] = 1] = "Edu";
2002
- TeamType[TeamType["Class"] = 2] = "Class";
2003
- TeamType[TeamType["Plc"] = 3] = "Plc";
2004
- TeamType[TeamType["Staff"] = 4] = "Staff";
2005
- })(TeamType || (TeamType = {}));
2006
- /**
2007
- * Indicates the various types of roles of a user in a team.
2008
- */
2009
- var UserTeamRole;
2010
- (function (UserTeamRole) {
2011
- UserTeamRole[UserTeamRole["Admin"] = 0] = "Admin";
2012
- UserTeamRole[UserTeamRole["User"] = 1] = "User";
2013
- UserTeamRole[UserTeamRole["Guest"] = 2] = "Guest";
2014
- })(UserTeamRole || (UserTeamRole = {}));
2015
- /**
2016
- * Dialog module dimension enum
2017
- */
2018
- var DialogDimension;
2019
- (function (DialogDimension) {
2020
- DialogDimension["Large"] = "large";
2021
- DialogDimension["Medium"] = "medium";
2022
- DialogDimension["Small"] = "small";
2023
- })(DialogDimension || (DialogDimension = {}));
2024
- /**
2025
- * @deprecated
2026
- * As of 2.0.0-beta.1, please use {@link DialogDimension} instead.
2027
- */
2028
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
2029
- var TaskModuleDimension = DialogDimension;
2030
- /**
2031
- * The type of the channel with which the content is associated.
2032
- */
2033
- var ChannelType;
2034
- (function (ChannelType) {
2035
- ChannelType["Regular"] = "Regular";
2036
- ChannelType["Private"] = "Private";
2037
- ChannelType["Shared"] = "Shared";
2038
- })(ChannelType || (ChannelType = {}));
2039
-
2040
2150
  ;// CONCATENATED MODULE: ./src/public/authentication.ts
2041
2151
 
2042
2152
 
@@ -4088,81 +4198,6 @@ var chat;
4088
4198
  chat.isSupported = isSupported;
4089
4199
  })(chat || (chat = {}));
4090
4200
 
4091
- ;// CONCATENATED MODULE: ./src/public/interfaces.ts
4092
- /* eslint-disable @typescript-eslint/no-explicit-any*/
4093
- /**
4094
- * Allowed user file open preferences
4095
- */
4096
- var FileOpenPreference;
4097
- (function (FileOpenPreference) {
4098
- FileOpenPreference["Inline"] = "inline";
4099
- FileOpenPreference["Desktop"] = "desktop";
4100
- FileOpenPreference["Web"] = "web";
4101
- })(FileOpenPreference || (FileOpenPreference = {}));
4102
- var ErrorCode;
4103
- (function (ErrorCode) {
4104
- /**
4105
- * API not supported in the current platform.
4106
- */
4107
- ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
4108
- /**
4109
- * Internal error encountered while performing the required operation.
4110
- */
4111
- ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
4112
- /**
4113
- * API is not supported in the current context
4114
- */
4115
- ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
4116
- /**
4117
- Permissions denied by user
4118
- */
4119
- ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
4120
- /**
4121
- * Network issue
4122
- */
4123
- ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
4124
- /**
4125
- * Underlying hardware doesn't support the capability
4126
- */
4127
- ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
4128
- /**
4129
- * One or more arguments are invalid
4130
- */
4131
- ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
4132
- /**
4133
- * User is not authorized for this operation
4134
- */
4135
- ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
4136
- /**
4137
- * Could not complete the operation due to insufficient resources
4138
- */
4139
- ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
4140
- /**
4141
- * Platform throttled the request because of API was invoked too frequently
4142
- */
4143
- ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
4144
- /**
4145
- * User aborted the operation
4146
- */
4147
- ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
4148
- /**
4149
- * Could not complete the operation in the given time interval
4150
- */
4151
- ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
4152
- /**
4153
- * Platform code is old and doesn't implement this API
4154
- */
4155
- ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
4156
- /**
4157
- * The file specified was not found on the given location
4158
- */
4159
- ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
4160
- /**
4161
- * The return value is too big and has exceeded our size boundries
4162
- */
4163
- ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
4164
- })(ErrorCode || (ErrorCode = {}));
4165
-
4166
4201
  ;// CONCATENATED MODULE: ./src/public/appInstallDialog.ts
4167
4202
 
4168
4203
 
@@ -4348,6 +4383,8 @@ var dialog;
4348
4383
 
4349
4384
  ;// CONCATENATED MODULE: ./src/internal/mediaUtil.ts
4350
4385
 
4386
+
4387
+
4351
4388
  /**
4352
4389
  * @hidden
4353
4390
  * Helper function to create a blob from media chunks based on their sequence
@@ -4398,6 +4435,35 @@ function decodeAttachment(attachment, mimeType) {
4398
4435
  };
4399
4436
  return assemble;
4400
4437
  }
4438
+ /**
4439
+ * @hidden
4440
+ * Function returns null if the media call is supported on current mobile version, else SdkError.
4441
+ *
4442
+ * @internal
4443
+ */
4444
+ function isMediaCallSupportedOnMobile(mediaInputs) {
4445
+ if (isMediaCallForVideoAndImageInputs(mediaInputs)) {
4446
+ return isApiSupportedOnMobile(videoAndImageMediaAPISupportVersion);
4447
+ }
4448
+ else if (isMediaCallForNonFullScreenVideoMode(mediaInputs)) {
4449
+ return isApiSupportedOnMobile(nonFullScreenVideoModeAPISupportVersion);
4450
+ }
4451
+ return null;
4452
+ }
4453
+ /**
4454
+ * @hidden
4455
+ * Function returns true if the app has registered to listen to video controller events, else false.
4456
+ *
4457
+ * @internal
4458
+ */
4459
+ function isVideoControllerRegistered(mediaInputs) {
4460
+ if (mediaInputs.mediaType == media.MediaType.Video &&
4461
+ mediaInputs.videoProps &&
4462
+ mediaInputs.videoProps.videoController) {
4463
+ return true;
4464
+ }
4465
+ return false;
4466
+ }
4401
4467
  /**
4402
4468
  * @hidden
4403
4469
  * Returns true if the mediaInput params are valid and false otherwise
@@ -4417,10 +4483,23 @@ function validateSelectMediaInputs(mediaInputs) {
4417
4483
  * @internal
4418
4484
  */
4419
4485
  function isMediaCallForVideoAndImageInputs(mediaInputs) {
4420
- if (mediaInputs) {
4421
- if (mediaInputs.mediaType == media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps) {
4422
- return true;
4423
- }
4486
+ if (mediaInputs && (mediaInputs.mediaType == media.MediaType.VideoAndImage || mediaInputs.videoAndImageProps)) {
4487
+ return true;
4488
+ }
4489
+ return false;
4490
+ }
4491
+ /**
4492
+ * @hidden
4493
+ * Returns true if the mediaInput params are called for non-full screen video mode and false otherwise
4494
+ *
4495
+ * @internal
4496
+ */
4497
+ function isMediaCallForNonFullScreenVideoMode(mediaInputs) {
4498
+ if (mediaInputs &&
4499
+ mediaInputs.mediaType == media.MediaType.Video &&
4500
+ mediaInputs.videoProps &&
4501
+ !mediaInputs.videoProps.isFullScreenMode) {
4502
+ return true;
4424
4503
  }
4425
4504
  return false;
4426
4505
  }
@@ -4672,6 +4751,87 @@ var media;
4672
4751
  return Media;
4673
4752
  }(File));
4674
4753
  media.Media = Media;
4754
+ /**
4755
+ * @hidden
4756
+ * Hide from docs
4757
+ * --------
4758
+ * Base class which holds the callback and notifies events to the host client
4759
+ */
4760
+ var MediaController = /** @class */ (function () {
4761
+ function MediaController(controllerCallback) {
4762
+ this.controllerCallback = controllerCallback;
4763
+ }
4764
+ /**
4765
+ * @hidden
4766
+ * Hide from docs
4767
+ * --------
4768
+ * Function to notify the host client to programatically control the experience
4769
+ * @param mediaEvent indicates what the event that needs to be signaled to the host client
4770
+ * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
4771
+ */
4772
+ MediaController.prototype.notifyEventToHost = function (mediaEvent, callback) {
4773
+ ensureInitialized(FrameContexts.content, FrameContexts.task);
4774
+ var err = isApiSupportedOnMobile(nonFullScreenVideoModeAPISupportVersion);
4775
+ if (err) {
4776
+ if (callback) {
4777
+ callback(err);
4778
+ }
4779
+ return;
4780
+ }
4781
+ var params = { mediaType: this.getMediaType(), mediaControllerEvent: mediaEvent };
4782
+ sendMessageToParent('media.controller', [params], function (err) {
4783
+ if (callback) {
4784
+ callback(err);
4785
+ }
4786
+ });
4787
+ };
4788
+ /**
4789
+ * Function to programatically stop the ongoing media event
4790
+ * Optional; @param callback is used to send app if host client has successfully stopped the event or not
4791
+ */
4792
+ MediaController.prototype.stop = function (callback) {
4793
+ this.notifyEventToHost(MediaControllerEvent.StopRecording, callback);
4794
+ };
4795
+ return MediaController;
4796
+ }());
4797
+ /**
4798
+ * VideoController class is used to communicate between the app and the host client during the video capture flow
4799
+ */
4800
+ var VideoController = /** @class */ (function (_super) {
4801
+ __extends(VideoController, _super);
4802
+ function VideoController() {
4803
+ return _super !== null && _super.apply(this, arguments) || this;
4804
+ }
4805
+ VideoController.prototype.getMediaType = function () {
4806
+ return MediaType.Video;
4807
+ };
4808
+ VideoController.prototype.notifyEventToApp = function (mediaEvent) {
4809
+ if (!this.controllerCallback) {
4810
+ // Early return as app has not registered with the callback
4811
+ return;
4812
+ }
4813
+ switch (mediaEvent) {
4814
+ case MediaControllerEvent.StartRecording:
4815
+ if (this.controllerCallback.onRecordingStarted) {
4816
+ this.controllerCallback.onRecordingStarted();
4817
+ break;
4818
+ }
4819
+ }
4820
+ };
4821
+ return VideoController;
4822
+ }(MediaController));
4823
+ media.VideoController = VideoController;
4824
+ /**
4825
+ * @hidden
4826
+ * Hide from docs
4827
+ * --------
4828
+ * Events which are used to communicate between the app and the host client during the media recording flow
4829
+ */
4830
+ var MediaControllerEvent;
4831
+ (function (MediaControllerEvent) {
4832
+ MediaControllerEvent[MediaControllerEvent["StartRecording"] = 1] = "StartRecording";
4833
+ MediaControllerEvent[MediaControllerEvent["StopRecording"] = 2] = "StopRecording";
4834
+ })(MediaControllerEvent || (MediaControllerEvent = {}));
4675
4835
  /**
4676
4836
  * The modes in which camera can be launched in select Media API
4677
4837
  */
@@ -4696,7 +4856,7 @@ var media;
4696
4856
  var MediaType;
4697
4857
  (function (MediaType) {
4698
4858
  MediaType[MediaType["Image"] = 1] = "Image";
4699
- // Video = 2, // Not implemented yet
4859
+ MediaType[MediaType["Video"] = 2] = "Video";
4700
4860
  MediaType[MediaType["VideoAndImage"] = 3] = "VideoAndImage";
4701
4861
  MediaType[MediaType["Audio"] = 4] = "Audio";
4702
4862
  })(MediaType = media.MediaType || (media.MediaType = {}));
@@ -4715,13 +4875,9 @@ var media;
4715
4875
  if (!isAPISupportedByPlatform(mediaAPISupportVersion)) {
4716
4876
  throw { errorCode: ErrorCode.OLD_PLATFORM };
4717
4877
  }
4718
- if (isMediaCallForVideoAndImageInputs(mediaInputs)) {
4719
- if (GlobalVars.hostClientType != HostClientType.android && GlobalVars.hostClientType != HostClientType.ios) {
4720
- throw { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
4721
- }
4722
- else if (!isAPISupportedByPlatform(videoAndImageMediaAPISupportVersion)) {
4723
- throw { errorCode: ErrorCode.OLD_PLATFORM };
4724
- }
4878
+ var err = isMediaCallSupportedOnMobile(mediaInputs);
4879
+ if (err) {
4880
+ throw err;
4725
4881
  }
4726
4882
  if (!validateSelectMediaInputs(mediaInputs)) {
4727
4883
  throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
@@ -4730,7 +4886,15 @@ var media;
4730
4886
  // What comes back from native at attachments would just be objects and will be missing getMedia method on them.
4731
4887
  resolve(sendMessageToParentAsync('selectMedia', params));
4732
4888
  }).then(function (_a) {
4733
- var err = _a[0], localAttachments = _a[1];
4889
+ var err = _a[0], localAttachments = _a[1], mediaEvent = _a[2];
4890
+ // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
4891
+ if (mediaEvent) {
4892
+ if (isVideoControllerRegistered(mediaInputs)) {
4893
+ mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);
4894
+ }
4895
+ return [];
4896
+ }
4897
+ // Media Attachments are final response to selectMedia
4734
4898
  if (!localAttachments) {
4735
4899
  throw err;
4736
4900
  }
@@ -5020,6 +5184,12 @@ var meeting;
5020
5184
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(shareAppContentToStageHelper, callback, appContentUrl);
5021
5185
  }
5022
5186
  meeting.shareAppContentToStage = shareAppContentToStage;
5187
+ /**
5188
+ * @hidden
5189
+ * Helper method to generate and return a promise for shareAppContentToStage
5190
+ * @param appContentUrl
5191
+ * @returns
5192
+ */
5023
5193
  function shareAppContentToStageHelper(appContentUrl) {
5024
5194
  return new Promise(function (resolve) {
5025
5195
  resolve(sendAndHandleSdkError('meeting.shareAppContentToStage', appContentUrl));
@@ -5030,6 +5200,10 @@ var meeting;
5030
5200
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(getAppContentStageSharingCapabilitiesHelper, callback);
5031
5201
  }
5032
5202
  meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
5203
+ /**
5204
+ * @hidden
5205
+ * @returns
5206
+ */
5033
5207
  function getAppContentStageSharingCapabilitiesHelper() {
5034
5208
  return new Promise(function (resolve) {
5035
5209
  resolve(sendAndHandleSdkError('meeting.getAppContentStageSharingCapabilities'));
@@ -5040,6 +5214,10 @@ var meeting;
5040
5214
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(stopSharingAppContentToStageHelper, callback);
5041
5215
  }
5042
5216
  meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
5217
+ /**
5218
+ * @hidden
5219
+ * @returns
5220
+ */
5043
5221
  function stopSharingAppContentToStageHelper() {
5044
5222
  return new Promise(function (resolve) {
5045
5223
  resolve(sendAndHandleSdkError('meeting.stopSharingAppContentToStage'));
@@ -6316,7 +6494,6 @@ var files;
6316
6494
  *
6317
6495
  * @param folder - Cloud storage folder (CloudStorageFolder) / sub directory (CloudStorageFolderItem)
6318
6496
  * @param providerCode - Code of the cloud storage folder provider
6319
- * @param callback - Callback that will be triggered post contents are loaded
6320
6497
  */
6321
6498
  function getCloudStorageFolderContents(folder, providerCode) {
6322
6499
  return new Promise(function (resolve) {