@microsoft/teams-js 2.10.0-beta.2 → 2.10.0-beta.4
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/dist/MicrosoftTeams.d.ts
CHANGED
@@ -2075,7 +2075,7 @@ export namespace videoEx {
|
|
2075
2075
|
* @internal
|
2076
2076
|
* Limited to Microsoft-internal use
|
2077
2077
|
*/
|
2078
|
-
interface VideoFrame extends video.
|
2078
|
+
interface VideoFrame extends video.VideoFrame {
|
2079
2079
|
/**
|
2080
2080
|
* @hidden
|
2081
2081
|
* The model output if you passed in an {@linkcode VideoFrameConfig.audioInferenceModel}
|
@@ -3738,11 +3738,11 @@ export namespace app {
|
|
3738
3738
|
*/
|
3739
3739
|
interface AppHostInfo {
|
3740
3740
|
/**
|
3741
|
-
*
|
3741
|
+
* Identifies which host is running your app
|
3742
3742
|
*/
|
3743
3743
|
name: HostName;
|
3744
3744
|
/**
|
3745
|
-
* The type
|
3745
|
+
* The client type on which the host is running
|
3746
3746
|
*/
|
3747
3747
|
clientType: HostClientType;
|
3748
3748
|
/**
|
@@ -3868,6 +3868,7 @@ export namespace app {
|
|
3868
3868
|
templateId?: string;
|
3869
3869
|
/**
|
3870
3870
|
* The user's role in the team.
|
3871
|
+
|
3871
3872
|
* Because a malicious party can run your content in a browser, this value should
|
3872
3873
|
* be used only as a hint as to the user's role, and never as proof of her role.
|
3873
3874
|
*/
|
@@ -3879,8 +3880,13 @@ export namespace app {
|
|
3879
3880
|
interface UserInfo {
|
3880
3881
|
/**
|
3881
3882
|
* The Azure AD object id of the current user.
|
3882
|
-
*
|
3883
|
-
*
|
3883
|
+
*
|
3884
|
+
* Because a malicious party can run your content in a browser, this value should
|
3885
|
+
* be used only as a optimization hint as to who the user is and never as proof of identity.
|
3886
|
+
* Specifically, this value should never be used to determine if a user is authorized to access
|
3887
|
+
* a resource; access tokens should be used for that.
|
3888
|
+
* See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
|
3889
|
+
*
|
3884
3890
|
* This field is available only when the identity permission is requested in the manifest.
|
3885
3891
|
*/
|
3886
3892
|
id: string;
|
@@ -3898,21 +3904,29 @@ export namespace app {
|
|
3898
3904
|
isPSTNCallingAllowed?: boolean;
|
3899
3905
|
/**
|
3900
3906
|
* The license type for the current user. Possible values are:
|
3901
|
-
* "Unknown", "Teacher", "Student", "Free", "SmbBusinessVoice", "SmbNonVoice", "FrontlineWorker"
|
3907
|
+
* "Unknown", "Teacher", "Student", "Free", "SmbBusinessVoice", "SmbNonVoice", "FrontlineWorker", "Anonymous"
|
3902
3908
|
*/
|
3903
3909
|
licenseType?: string;
|
3904
3910
|
/**
|
3905
|
-
* A value suitable for use
|
3911
|
+
* A value suitable for use when providing a login_hint to Azure Active Directory for authentication purposes.
|
3912
|
+
* See [Provide optional claims to your app](https://learn.microsoft.com/azure/active-directory/develop/active-directory-optional-claims#v10-and-v20-optional-claims-set)
|
3913
|
+
* for more information about the use of login_hint
|
3914
|
+
*
|
3906
3915
|
* Because a malicious party can run your content in a browser, this value should
|
3907
|
-
* be used only as a hint as to who the user is and never as proof of identity.
|
3908
|
-
*
|
3916
|
+
* be used only as a optimization hint as to who the user is and never as proof of identity.
|
3917
|
+
* Specifically, this value should never be used to determine if a user is authorized to access
|
3918
|
+
* a resource; access tokens should be used for that.
|
3919
|
+
* See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
|
3909
3920
|
*/
|
3910
3921
|
loginHint?: string;
|
3911
3922
|
/**
|
3912
3923
|
* The UPN of the current user. This may be an externally-authenticated UPN (e.g., guest users).
|
3913
|
-
|
3914
|
-
*
|
3915
|
-
*
|
3924
|
+
|
3925
|
+
* Because a malicious party can run your content in a browser, this value should
|
3926
|
+
* be used only as a optimization hint as to who the user is and never as proof of identity.
|
3927
|
+
* Specifically, this value should never be used to determine if a user is authorized to access
|
3928
|
+
* a resource; access tokens should be used for that.
|
3929
|
+
* See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
|
3916
3930
|
*/
|
3917
3931
|
userPrincipalName?: string;
|
3918
3932
|
/**
|
@@ -3926,9 +3940,12 @@ export namespace app {
|
|
3926
3940
|
interface TenantInfo {
|
3927
3941
|
/**
|
3928
3942
|
* The Azure AD tenant ID of the current user.
|
3943
|
+
|
3929
3944
|
* Because a malicious party can run your content in a browser, this value should
|
3930
|
-
* be used only as a hint as to who the user is and never as proof of identity.
|
3931
|
-
*
|
3945
|
+
* be used only as a optimization hint as to who the user is and never as proof of identity.
|
3946
|
+
* Specifically, this value should never be used to determine if a user is authorized to access
|
3947
|
+
* a resource; access tokens should be used for that.
|
3948
|
+
* See {@link authentication.getAuthToken} and {@link authentication.authenticate} for more information on access tokens.
|
3932
3949
|
*/
|
3933
3950
|
id: string;
|
3934
3951
|
/**
|
@@ -6382,24 +6399,54 @@ export namespace mail {
|
|
6382
6399
|
Forward = "forward"
|
6383
6400
|
}
|
6384
6401
|
/**
|
6385
|
-
*
|
6402
|
+
* Foundational interface for all other mail compose interfaces
|
6403
|
+
* Used for holding the type of mail item being composed
|
6404
|
+
*
|
6405
|
+
* @see {@link ComposeMailType}
|
6386
6406
|
*/
|
6387
6407
|
interface ComposeMailBase<T extends ComposeMailType> {
|
6388
6408
|
type: T;
|
6389
6409
|
}
|
6390
6410
|
/**
|
6391
|
-
*
|
6411
|
+
* Parameters supplied when composing a new mail item
|
6392
6412
|
*/
|
6393
6413
|
export interface ComposeNewParams extends ComposeMailBase<ComposeMailType.New> {
|
6414
|
+
/**
|
6415
|
+
* The To: recipients for the message
|
6416
|
+
*/
|
6394
6417
|
toRecipients?: string[];
|
6418
|
+
/**
|
6419
|
+
* The Cc: recipients for the message
|
6420
|
+
*/
|
6395
6421
|
ccRecipients?: string[];
|
6422
|
+
/**
|
6423
|
+
* The Bcc: recipients for the message
|
6424
|
+
*/
|
6396
6425
|
bccRecipients?: string[];
|
6426
|
+
/**
|
6427
|
+
* The subject of the message
|
6428
|
+
*/
|
6397
6429
|
subject?: string;
|
6430
|
+
/**
|
6431
|
+
* The body of the message
|
6432
|
+
*/
|
6398
6433
|
message?: string;
|
6399
6434
|
}
|
6435
|
+
/**
|
6436
|
+
* Parameters supplied when composing a reply to or forward of a message
|
6437
|
+
*
|
6438
|
+
* @see {@link ComposeMailType}
|
6439
|
+
*/
|
6400
6440
|
export interface ComposeReplyOrForwardParams<T extends ComposeMailType> extends ComposeMailBase<T> {
|
6401
6441
|
itemid: string;
|
6402
6442
|
}
|
6443
|
+
/**
|
6444
|
+
* Parameters supplied to {@link composeMail} when composing a new mail item
|
6445
|
+
*
|
6446
|
+
* @see {@link ComposeNewParams}
|
6447
|
+
* @see {@link ComposeReplyOrForwardParams}
|
6448
|
+
* @see {@link ComposeMailType}
|
6449
|
+
*/
|
6403
6450
|
export type ComposeMailParams = ComposeNewParams | ComposeReplyOrForwardParams<ComposeMailType.Reply> | ComposeReplyOrForwardParams<ComposeMailType.ReplyAll> | ComposeReplyOrForwardParams<ComposeMailType.Forward>;
|
6404
6451
|
export {};
|
6405
6452
|
}
|
@@ -6683,7 +6730,7 @@ export namespace video {
|
|
6683
6730
|
* Represents a video frame
|
6684
6731
|
* @beta
|
6685
6732
|
*/
|
6686
|
-
interface
|
6733
|
+
interface VideoFrame {
|
6687
6734
|
/**
|
6688
6735
|
* Video frame width
|
6689
6736
|
*/
|
@@ -6695,7 +6742,7 @@ export namespace video {
|
|
6695
6742
|
/**
|
6696
6743
|
* Video frame buffer
|
6697
6744
|
*/
|
6698
|
-
|
6745
|
+
data: Uint8ClampedArray;
|
6699
6746
|
/**
|
6700
6747
|
* NV12 luma stride, valid only when video frame format is NV12
|
6701
6748
|
*/
|
@@ -6718,7 +6765,7 @@ export namespace video {
|
|
6718
6765
|
* @beta
|
6719
6766
|
*/
|
6720
6767
|
enum VideoFrameFormat {
|
6721
|
-
NV12 =
|
6768
|
+
NV12 = 0
|
6722
6769
|
}
|
6723
6770
|
/**
|
6724
6771
|
* Video frame configuration supplied to the host to customize the generated video frame parameters, like format
|
@@ -6748,7 +6795,7 @@ export namespace video {
|
|
6748
6795
|
* Video frame call back function definition
|
6749
6796
|
* @beta
|
6750
6797
|
*/
|
6751
|
-
type VideoFrameCallback = (frame:
|
6798
|
+
type VideoFrameCallback = (frame: VideoFrame, notifyVideoFrameProcessed: () => void, notifyError: (errorMessage: string) => void) => void;
|
6752
6799
|
/**
|
6753
6800
|
* Predefined failure reasons for preparing the selected video effect
|
6754
6801
|
* @beta
|
@@ -6801,56 +6848,6 @@ export namespace video {
|
|
6801
6848
|
*
|
6802
6849
|
*/
|
6803
6850
|
function isSupported(): boolean;
|
6804
|
-
/**
|
6805
|
-
* @beta
|
6806
|
-
* Namespace to get video frames from a media stream.
|
6807
|
-
* When the host supports this capability, developer should call {@link mediaStream.registerForVideoFrame} to get the video frames instead of {@link registerForVideoFrame} to get the video frames, callback of {@link registerForVideoFrame} will be ignored when the host supports this capability.
|
6808
|
-
*/
|
6809
|
-
namespace mediaStream {
|
6810
|
-
/**
|
6811
|
-
* @beta
|
6812
|
-
* Checks if video.mediaStream capability is supported by the host
|
6813
|
-
* @returns boolean to represent whether the video.medisStream capability is supported
|
6814
|
-
*
|
6815
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6816
|
-
*
|
6817
|
-
*/
|
6818
|
-
function isSupported(): boolean;
|
6819
|
-
/**
|
6820
|
-
* @beta
|
6821
|
-
* Video frame data extracted from the media stream. More properties may be added in the future.
|
6822
|
-
*/
|
6823
|
-
type MediaStreamFrameData = {
|
6824
|
-
/**
|
6825
|
-
* The video frame from the media stream.
|
6826
|
-
*/
|
6827
|
-
videoFrame: VideoFrame;
|
6828
|
-
};
|
6829
|
-
/**
|
6830
|
-
* @beta
|
6831
|
-
* Video effect change call back function definition.
|
6832
|
-
* The video app should resolve the promise to notify a successfully processed video frame.
|
6833
|
-
* The video app should reject the promise to notify a failure.
|
6834
|
-
*/
|
6835
|
-
type VideoFrameCallback = (receivedVideoFrame: MediaStreamFrameData) => Promise<VideoFrame>;
|
6836
|
-
/**
|
6837
|
-
* @beta
|
6838
|
-
* Register to read the video frames from the media stream provided by the host.
|
6839
|
-
* @param frameCallback - The callback to invoke when recieve a video frame from the media stream.
|
6840
|
-
* @example
|
6841
|
-
* ```typescript
|
6842
|
-
* video.mediaStream.registerForVideoFrame(async (receivedVideoFrame) => {
|
6843
|
-
* const { videoFrame } = receivedVideoFrame;
|
6844
|
-
* try {
|
6845
|
-
* return await processVideoFrame(videoFrame);
|
6846
|
-
* } catch (error) {
|
6847
|
-
* throw error;
|
6848
|
-
* }
|
6849
|
-
* });
|
6850
|
-
* ```
|
6851
|
-
*/
|
6852
|
-
function registerForVideoFrame(frameCallback: VideoFrameCallback): void;
|
6853
|
-
}
|
6854
6851
|
}
|
6855
6852
|
|
6856
6853
|
/**
|
@@ -7097,7 +7094,7 @@ export namespace call {
|
|
7097
7094
|
* @remarks
|
7098
7095
|
* Currently the User ID field supports the Azure AD UserPrincipalName,
|
7099
7096
|
* typically an email address, or in case of a PSTN call, it supports a pstn
|
7100
|
-
* mri 4
|
7097
|
+
* mri 4:\<phonenumber>.
|
7101
7098
|
*/
|
7102
7099
|
targets: string[];
|
7103
7100
|
/**
|
@@ -7566,7 +7563,7 @@ export namespace tasks {
|
|
7566
7563
|
function submitTask(result?: string | object, appIds?: string | string[]): void;
|
7567
7564
|
/**
|
7568
7565
|
* Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
|
7569
|
-
* otherwise uses the height and width values corresponding to {@link
|
7566
|
+
* otherwise uses the height and width values corresponding to {@link DialogDimension | TaskModuleDimension.Small}
|
7570
7567
|
* @param taskInfo TaskInfo object from which to extract size info, if specified
|
7571
7568
|
* @returns TaskInfo with height and width specified
|
7572
7569
|
*/
|
package/dist/MicrosoftTeams.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
exports["microsoftTeams"] = factory();
|
8
8
|
else
|
9
9
|
root["microsoftTeams"] = factory();
|
10
|
-
})(self, () => {
|
10
|
+
})(typeof self !== 'undefined' ? self : this, () => {
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
12
12
|
/******/ var __webpack_modules__ = ({
|
13
13
|
|
@@ -1011,10 +1011,6 @@ var validOrigins = [
|
|
1011
1011
|
'local.teams.live.com:8080',
|
1012
1012
|
'local.teams.office.com',
|
1013
1013
|
'local.teams.office.com:8080',
|
1014
|
-
'msft.spoppe.com',
|
1015
|
-
'*.sharepoint.com',
|
1016
|
-
'*.sharepoint-df.com',
|
1017
|
-
'*.sharepointonline.com',
|
1018
1014
|
'outlook.office.com',
|
1019
1015
|
'outlook-sdf.office.com',
|
1020
1016
|
'outlook.office365.com',
|
@@ -2003,7 +1999,7 @@ var _minRuntimeConfigToUninitialize = {
|
|
2003
1999
|
};
|
2004
2000
|
|
2005
2001
|
;// CONCATENATED MODULE: ./src/public/version.ts
|
2006
|
-
var version = "2.10.0-beta.
|
2002
|
+
var version = "2.10.0-beta.4";
|
2007
2003
|
|
2008
2004
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2009
2005
|
|
@@ -2087,13 +2083,15 @@ function isCurrentSDKVersionAtLeast(requiredVersion) {
|
|
2087
2083
|
}
|
2088
2084
|
/**
|
2089
2085
|
* @hidden
|
2090
|
-
* Helper function to identify if host client is either android or
|
2086
|
+
* Helper function to identify if host client is either android, ios, or ipados
|
2091
2087
|
*
|
2092
2088
|
* @internal
|
2093
2089
|
* Limited to Microsoft-internal use
|
2094
2090
|
*/
|
2095
2091
|
function isHostClientMobile() {
|
2096
|
-
return GlobalVars.hostClientType == HostClientType.android ||
|
2092
|
+
return (GlobalVars.hostClientType == HostClientType.android ||
|
2093
|
+
GlobalVars.hostClientType == HostClientType.ios ||
|
2094
|
+
GlobalVars.hostClientType == HostClientType.ipados);
|
2097
2095
|
}
|
2098
2096
|
/**
|
2099
2097
|
* @hidden
|
@@ -2222,6 +2220,7 @@ var authentication;
|
|
2222
2220
|
if (GlobalVars.hostClientType === HostClientType.desktop ||
|
2223
2221
|
GlobalVars.hostClientType === HostClientType.android ||
|
2224
2222
|
GlobalVars.hostClientType === HostClientType.ios ||
|
2223
|
+
GlobalVars.hostClientType === HostClientType.ipados ||
|
2225
2224
|
GlobalVars.hostClientType === HostClientType.rigel ||
|
2226
2225
|
GlobalVars.hostClientType === HostClientType.teamsRoomsWindows ||
|
2227
2226
|
GlobalVars.hostClientType === HostClientType.teamsRoomsAndroid ||
|
@@ -6961,7 +6960,7 @@ var meeting;
|
|
6961
6960
|
if (!callback) {
|
6962
6961
|
throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');
|
6963
6962
|
}
|
6964
|
-
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
|
6963
|
+
ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);
|
6965
6964
|
sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);
|
6966
6965
|
}
|
6967
6966
|
meeting.getAuthenticationTokenForAnonymousUser = getAuthenticationTokenForAnonymousUser;
|
@@ -7638,53 +7637,6 @@ var profile;
|
|
7638
7637
|
})(profile || (profile = {}));
|
7639
7638
|
|
7640
7639
|
;// CONCATENATED MODULE: ./src/public/video.ts
|
7641
|
-
var video_assign = (undefined && undefined.__assign) || function () {
|
7642
|
-
video_assign = Object.assign || function(t) {
|
7643
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7644
|
-
s = arguments[i];
|
7645
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7646
|
-
t[p] = s[p];
|
7647
|
-
}
|
7648
|
-
return t;
|
7649
|
-
};
|
7650
|
-
return video_assign.apply(this, arguments);
|
7651
|
-
};
|
7652
|
-
var video_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7653
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7654
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
7655
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
7656
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7657
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7658
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
7659
|
-
});
|
7660
|
-
};
|
7661
|
-
var video_generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
7662
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
7663
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
7664
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
7665
|
-
function step(op) {
|
7666
|
-
if (f) throw new TypeError("Generator is already executing.");
|
7667
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
7668
|
-
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;
|
7669
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
7670
|
-
switch (op[0]) {
|
7671
|
-
case 0: case 1: t = op; break;
|
7672
|
-
case 4: _.label++; return { value: op[1], done: false };
|
7673
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
7674
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
7675
|
-
default:
|
7676
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
7677
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
7678
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
7679
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
7680
|
-
if (t[2]) _.ops.pop();
|
7681
|
-
_.trys.pop(); continue;
|
7682
|
-
}
|
7683
|
-
op = body.call(thisArg, _);
|
7684
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
7685
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
7686
|
-
}
|
7687
|
-
};
|
7688
7640
|
|
7689
7641
|
|
7690
7642
|
|
@@ -7702,7 +7654,7 @@ var video;
|
|
7702
7654
|
*/
|
7703
7655
|
var VideoFrameFormat;
|
7704
7656
|
(function (VideoFrameFormat) {
|
7705
|
-
VideoFrameFormat["NV12"] = "NV12";
|
7657
|
+
VideoFrameFormat[VideoFrameFormat["NV12"] = 0] = "NV12";
|
7706
7658
|
})(VideoFrameFormat = video.VideoFrameFormat || (video.VideoFrameFormat = {}));
|
7707
7659
|
/**
|
7708
7660
|
* Video effect change type enum
|
@@ -7746,14 +7698,10 @@ var video;
|
|
7746
7698
|
if (!isSupported()) {
|
7747
7699
|
throw errorNotSupportedOnPlatform;
|
7748
7700
|
}
|
7749
|
-
registerHandler('video.newVideoFrame',
|
7750
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
7751
|
-
function (videoFrame) {
|
7701
|
+
registerHandler('video.newVideoFrame', function (videoFrame) {
|
7752
7702
|
if (videoFrame) {
|
7753
|
-
|
7754
|
-
|
7755
|
-
var timestamp_1 = videoFrameData.timestamp;
|
7756
|
-
frameCallback(videoFrameData, function () {
|
7703
|
+
var timestamp_1 = videoFrame.timestamp;
|
7704
|
+
frameCallback(videoFrame, function () {
|
7757
7705
|
notifyVideoFrameProcessed(timestamp_1);
|
7758
7706
|
}, notifyError);
|
7759
7707
|
}
|
@@ -7829,165 +7777,6 @@ var video;
|
|
7829
7777
|
return ensureInitialized(runtime) && runtime.supports.video ? true : false;
|
7830
7778
|
}
|
7831
7779
|
video.isSupported = isSupported;
|
7832
|
-
/**
|
7833
|
-
* @beta
|
7834
|
-
* Namespace to get video frames from a media stream.
|
7835
|
-
* When the host supports this capability, developer should call {@link mediaStream.registerForVideoFrame} to get the video frames instead of {@link registerForVideoFrame} to get the video frames, callback of {@link registerForVideoFrame} will be ignored when the host supports this capability.
|
7836
|
-
*/
|
7837
|
-
var mediaStream;
|
7838
|
-
(function (mediaStream_1) {
|
7839
|
-
/**
|
7840
|
-
* @beta
|
7841
|
-
* Checks if video.mediaStream capability is supported by the host
|
7842
|
-
* @returns boolean to represent whether the video.medisStream capability is supported
|
7843
|
-
*
|
7844
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
7845
|
-
*
|
7846
|
-
*/
|
7847
|
-
function isSupported() {
|
7848
|
-
var _a;
|
7849
|
-
return ensureInitialized(runtime) && isTextureStreamAvailable() && !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream);
|
7850
|
-
}
|
7851
|
-
mediaStream_1.isSupported = isSupported;
|
7852
|
-
function isTextureStreamAvailable() {
|
7853
|
-
var _a, _b, _c, _d;
|
7854
|
-
return (typeof window !== 'undefined' &&
|
7855
|
-
!!(((_b = (_a = window['chrome']) === null || _a === void 0 ? void 0 : _a.webview) === null || _b === void 0 ? void 0 : _b.getTextureStream) && ((_d = (_c = window['chrome']) === null || _c === void 0 ? void 0 : _c.webview) === null || _d === void 0 ? void 0 : _d.registerTextureStream)));
|
7856
|
-
}
|
7857
|
-
/**
|
7858
|
-
* @beta
|
7859
|
-
* Register to read the video frames from the media stream provided by the host.
|
7860
|
-
* @param frameCallback - The callback to invoke when recieve a video frame from the media stream.
|
7861
|
-
* @example
|
7862
|
-
* ```typescript
|
7863
|
-
* video.mediaStream.registerForVideoFrame(async (receivedVideoFrame) => {
|
7864
|
-
* const { videoFrame } = receivedVideoFrame;
|
7865
|
-
* try {
|
7866
|
-
* return await processVideoFrame(videoFrame);
|
7867
|
-
* } catch (error) {
|
7868
|
-
* throw error;
|
7869
|
-
* }
|
7870
|
-
* });
|
7871
|
-
* ```
|
7872
|
-
*/
|
7873
|
-
function registerForVideoFrame(frameCallback) {
|
7874
|
-
var _this = this;
|
7875
|
-
ensureInitialized(runtime, FrameContexts.sidePanel);
|
7876
|
-
if (!isSupported()) {
|
7877
|
-
throw errorNotSupportedOnPlatform;
|
7878
|
-
}
|
7879
|
-
registerHandler('video.startVideoExtensibilityVideoStream', function (mediaStreamInfo) { return video_awaiter(_this, void 0, void 0, function () {
|
7880
|
-
var streamId, videoTrack, generator;
|
7881
|
-
var _a, _b;
|
7882
|
-
return video_generator(this, function (_c) {
|
7883
|
-
switch (_c.label) {
|
7884
|
-
case 0:
|
7885
|
-
streamId = mediaStreamInfo.streamId;
|
7886
|
-
return [4 /*yield*/, getInputVideoTrack(streamId)];
|
7887
|
-
case 1:
|
7888
|
-
videoTrack = _c.sent();
|
7889
|
-
generator = createProcessedStreamGenerator(videoTrack, frameCallback);
|
7890
|
-
// register the video track with processed frames back to the stream:
|
7891
|
-
typeof window !== 'undefined' && ((_b = (_a = window['chrome']) === null || _a === void 0 ? void 0 : _a.webview) === null || _b === void 0 ? void 0 : _b.registerTextureStream(streamId, generator));
|
7892
|
-
return [2 /*return*/];
|
7893
|
-
}
|
7894
|
-
});
|
7895
|
-
}); });
|
7896
|
-
sendMessageToParent('video.mediaStream.registerForVideoFrame', [
|
7897
|
-
{
|
7898
|
-
format: VideoFrameFormat.NV12,
|
7899
|
-
},
|
7900
|
-
]);
|
7901
|
-
}
|
7902
|
-
mediaStream_1.registerForVideoFrame = registerForVideoFrame;
|
7903
|
-
/**
|
7904
|
-
* Get the video track from the media stream gotten from chrome.webview.getTextureStream(streamId).
|
7905
|
-
*/
|
7906
|
-
function getInputVideoTrack(streamId) {
|
7907
|
-
return video_awaiter(this, void 0, void 0, function () {
|
7908
|
-
var chrome, mediaStream_2, tracks, error_1, errorMsg;
|
7909
|
-
return video_generator(this, function (_a) {
|
7910
|
-
switch (_a.label) {
|
7911
|
-
case 0:
|
7912
|
-
if (typeof window === 'undefined') {
|
7913
|
-
throw errorNotSupportedOnPlatform;
|
7914
|
-
}
|
7915
|
-
chrome = window['chrome'];
|
7916
|
-
_a.label = 1;
|
7917
|
-
case 1:
|
7918
|
-
_a.trys.push([1, 3, , 4]);
|
7919
|
-
return [4 /*yield*/, chrome.webview.getTextureStream(streamId)];
|
7920
|
-
case 2:
|
7921
|
-
mediaStream_2 = _a.sent();
|
7922
|
-
tracks = mediaStream_2.getVideoTracks();
|
7923
|
-
if (tracks.length === 0) {
|
7924
|
-
throw new Error("No video track in stream ".concat(streamId));
|
7925
|
-
}
|
7926
|
-
return [2 /*return*/, tracks[0]];
|
7927
|
-
case 3:
|
7928
|
-
error_1 = _a.sent();
|
7929
|
-
errorMsg = "Failed to get video track from stream ".concat(streamId, ", error: ").concat(error_1);
|
7930
|
-
notifyError(errorMsg);
|
7931
|
-
throw new Error(errorMsg);
|
7932
|
-
case 4: return [2 /*return*/];
|
7933
|
-
}
|
7934
|
-
});
|
7935
|
-
});
|
7936
|
-
}
|
7937
|
-
/**
|
7938
|
-
* The function to create a processed video track from the original video track.
|
7939
|
-
* It reads frames from the video track and pipes them to the video frame callback to process the frames.
|
7940
|
-
* The processed frames are then enqueued to the generator.
|
7941
|
-
* The generator can be registered back to the media stream so that the host can get the processed frames.
|
7942
|
-
*/
|
7943
|
-
function createProcessedStreamGenerator(videoTrack, videoFrameCallback) {
|
7944
|
-
var processor = new MediaStreamTrackProcessor({ track: videoTrack });
|
7945
|
-
var source = processor.readable;
|
7946
|
-
var generator = new MediaStreamTrackGenerator({ kind: 'video' });
|
7947
|
-
var sink = generator.writable;
|
7948
|
-
source
|
7949
|
-
.pipeThrough(new TransformStream({
|
7950
|
-
transform: function (originalFrame, controller) {
|
7951
|
-
return video_awaiter(this, void 0, void 0, function () {
|
7952
|
-
var timestamp, frameProcessedByApp, processedFrame, error_2;
|
7953
|
-
return video_generator(this, function (_a) {
|
7954
|
-
switch (_a.label) {
|
7955
|
-
case 0:
|
7956
|
-
timestamp = originalFrame.timestamp;
|
7957
|
-
if (!(timestamp !== null)) return [3 /*break*/, 5];
|
7958
|
-
_a.label = 1;
|
7959
|
-
case 1:
|
7960
|
-
_a.trys.push([1, 3, , 4]);
|
7961
|
-
return [4 /*yield*/, videoFrameCallback({ videoFrame: originalFrame })];
|
7962
|
-
case 2:
|
7963
|
-
frameProcessedByApp = _a.sent();
|
7964
|
-
processedFrame = new VideoFrame(frameProcessedByApp, {
|
7965
|
-
// we need the timestamp to be unchanged from the oirginal frame, so we explicitly set it here.
|
7966
|
-
timestamp: timestamp,
|
7967
|
-
});
|
7968
|
-
controller.enqueue(processedFrame);
|
7969
|
-
originalFrame.close();
|
7970
|
-
frameProcessedByApp.close();
|
7971
|
-
return [3 /*break*/, 4];
|
7972
|
-
case 3:
|
7973
|
-
error_2 = _a.sent();
|
7974
|
-
originalFrame.close();
|
7975
|
-
notifyError(error_2);
|
7976
|
-
return [3 /*break*/, 4];
|
7977
|
-
case 4: return [3 /*break*/, 6];
|
7978
|
-
case 5:
|
7979
|
-
notifyError('timestamp of the original video frame is null');
|
7980
|
-
_a.label = 6;
|
7981
|
-
case 6: return [2 /*return*/];
|
7982
|
-
}
|
7983
|
-
});
|
7984
|
-
});
|
7985
|
-
},
|
7986
|
-
}))
|
7987
|
-
.pipeTo(sink);
|
7988
|
-
return generator;
|
7989
|
-
}
|
7990
|
-
})(mediaStream = video.mediaStream || (video.mediaStream = {}));
|
7991
7780
|
})(video || (video = {})); //end of video namespace
|
7992
7781
|
|
7993
7782
|
;// CONCATENATED MODULE: ./src/public/search.ts
|
@@ -8995,7 +8784,7 @@ var tasks;
|
|
8995
8784
|
}
|
8996
8785
|
/**
|
8997
8786
|
* Sets the height and width of the {@link TaskInfo} object to the original height and width, if initially specified,
|
8998
|
-
* otherwise uses the height and width values corresponding to {@link
|
8787
|
+
* otherwise uses the height and width values corresponding to {@link DialogDimension | TaskModuleDimension.Small}
|
8999
8788
|
* @param taskInfo TaskInfo object from which to extract size info, if specified
|
9000
8789
|
* @returns TaskInfo with height and width specified
|
9001
8790
|
*/
|