@microsoft/teams-js 2.9.0 → 2.9.1
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/README.md +4 -4
- package/dist/MicrosoftTeams.d.ts +33 -67
- package/dist/MicrosoftTeams.js +30 -227
- package/dist/MicrosoftTeams.js.map +1 -1
- package/dist/MicrosoftTeams.min.js +1 -1
- package/dist/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -3
package/README.md
CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
|
|
24
24
|
|
25
25
|
### Production
|
26
26
|
|
27
|
-
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.9.
|
27
|
+
You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.9.1/js/MicrosoftTeams.min.js) or point your package manager at them.
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
|
|
45
45
|
```html
|
46
46
|
<!-- Microsoft Teams JavaScript API (via CDN) -->
|
47
47
|
<script
|
48
|
-
src="https://res.cdn.office.net/teams-js/2.9.
|
49
|
-
integrity="sha384-
|
48
|
+
src="https://res.cdn.office.net/teams-js/2.9.1/js/MicrosoftTeams.min.js"
|
49
|
+
integrity="sha384-xnsUQ1tUqsrutBJl0vuf4/hufzLFWW8ZhGnhItfpQ0/BtWgM2uw6YT6BQ5YaKBSM"
|
50
50
|
crossorigin="anonymous"
|
51
51
|
></script>
|
52
52
|
|
53
53
|
<!-- Microsoft Teams JavaScript API (via npm) -->
|
54
|
-
<script src="node_modules/@microsoft/teams-js@2.9.
|
54
|
+
<script src="node_modules/@microsoft/teams-js@2.9.1/dist/MicrosoftTeams.min.js"></script>
|
55
55
|
|
56
56
|
<!-- Microsoft Teams JavaScript API (via local) -->
|
57
57
|
<script src="MicrosoftTeams.min.js"></script>
|
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}
|
@@ -2647,7 +2647,11 @@ export enum HostName {
|
|
2647
2647
|
/**
|
2648
2648
|
* Teams
|
2649
2649
|
*/
|
2650
|
-
teams = "Teams"
|
2650
|
+
teams = "Teams",
|
2651
|
+
/**
|
2652
|
+
* Modern Teams
|
2653
|
+
*/
|
2654
|
+
teamsModern = "TeamsModern"
|
2651
2655
|
}
|
2652
2656
|
export enum FrameContexts {
|
2653
2657
|
settings = "settings",
|
@@ -4243,7 +4247,15 @@ export namespace chat {
|
|
4243
4247
|
export {};
|
4244
4248
|
|
4245
4249
|
/**
|
4246
|
-
*
|
4250
|
+
* This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.
|
4251
|
+
* Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.
|
4252
|
+
* - URL-based dialogs allow you to specify a URL from which the contents will be shown inside the dialog.
|
4253
|
+
* - For URL dialogs, use the functions and interfaces in the {@link dialog.url} namespace.
|
4254
|
+
* - Adaptive Card-based dialogs allow you to provide JSON describing an Adaptive Card that will be shown inside the dialog.
|
4255
|
+
* - For Adaptive Card dialogs, use the functions and interfaces in the {@link dialog.adaptiveCard} namespace.
|
4256
|
+
*
|
4257
|
+
* @remarks Note that dialogs were previously called "task modules". While they have been renamed for clarity, the functionality has been maintained.
|
4258
|
+
* For more details, see [Dialogs](https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-task-modules)
|
4247
4259
|
*
|
4248
4260
|
* @beta
|
4249
4261
|
*/
|
@@ -4274,6 +4286,9 @@ export namespace dialog {
|
|
4274
4286
|
/**
|
4275
4287
|
* Handler used for receiving results when a dialog closes, either the value passed by {@linkcode url.submit}
|
4276
4288
|
* or an error if the dialog was closed by the user.
|
4289
|
+
*
|
4290
|
+
* @see {@linkcode ISdkResponse}
|
4291
|
+
*
|
4277
4292
|
* @beta
|
4278
4293
|
*/
|
4279
4294
|
type DialogSubmitHandler = (result: ISdkResponse) => void;
|
@@ -4406,14 +4421,11 @@ export namespace dialog {
|
|
4406
4421
|
function getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo: BotUrlDialogInfo): DialogInfo;
|
4407
4422
|
}
|
4408
4423
|
/**
|
4409
|
-
*
|
4410
|
-
*
|
4411
|
-
*
|
4412
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4413
|
-
*
|
4414
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
4424
|
+
* This function currently serves no purpose and should not be used. All functionality that used
|
4425
|
+
* to be covered by this method is now in subcapabilities and those isSupported methods should be
|
4426
|
+
* used directly.
|
4415
4427
|
*
|
4416
|
-
* @
|
4428
|
+
* @hidden
|
4417
4429
|
*/
|
4418
4430
|
function isSupported(): boolean;
|
4419
4431
|
/**
|
@@ -6671,7 +6683,7 @@ export namespace video {
|
|
6671
6683
|
* Represents a video frame
|
6672
6684
|
* @beta
|
6673
6685
|
*/
|
6674
|
-
interface
|
6686
|
+
interface VideoFrame {
|
6675
6687
|
/**
|
6676
6688
|
* Video frame width
|
6677
6689
|
*/
|
@@ -6683,7 +6695,7 @@ export namespace video {
|
|
6683
6695
|
/**
|
6684
6696
|
* Video frame buffer
|
6685
6697
|
*/
|
6686
|
-
|
6698
|
+
data: Uint8ClampedArray;
|
6687
6699
|
/**
|
6688
6700
|
* NV12 luma stride, valid only when video frame format is NV12
|
6689
6701
|
*/
|
@@ -6706,7 +6718,7 @@ export namespace video {
|
|
6706
6718
|
* @beta
|
6707
6719
|
*/
|
6708
6720
|
enum VideoFrameFormat {
|
6709
|
-
NV12 =
|
6721
|
+
NV12 = 0
|
6710
6722
|
}
|
6711
6723
|
/**
|
6712
6724
|
* Video frame configuration supplied to the host to customize the generated video frame parameters, like format
|
@@ -6736,7 +6748,7 @@ export namespace video {
|
|
6736
6748
|
* Video frame call back function definition
|
6737
6749
|
* @beta
|
6738
6750
|
*/
|
6739
|
-
type VideoFrameCallback = (frame:
|
6751
|
+
type VideoFrameCallback = (frame: VideoFrame, notifyVideoFrameProcessed: () => void, notifyError: (errorMessage: string) => void) => void;
|
6740
6752
|
/**
|
6741
6753
|
* Predefined failure reasons for preparing the selected video effect
|
6742
6754
|
* @beta
|
@@ -6789,56 +6801,6 @@ export namespace video {
|
|
6789
6801
|
*
|
6790
6802
|
*/
|
6791
6803
|
function isSupported(): boolean;
|
6792
|
-
/**
|
6793
|
-
* @beta
|
6794
|
-
* Namespace to get video frames from a media stream.
|
6795
|
-
* 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.
|
6796
|
-
*/
|
6797
|
-
namespace mediaStream {
|
6798
|
-
/**
|
6799
|
-
* @beta
|
6800
|
-
* Checks if video.mediaStream capability is supported by the host
|
6801
|
-
* @returns boolean to represent whether the video.medisStream capability is supported
|
6802
|
-
*
|
6803
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
6804
|
-
*
|
6805
|
-
*/
|
6806
|
-
function isSupported(): boolean;
|
6807
|
-
/**
|
6808
|
-
* @beta
|
6809
|
-
* Video frame data extracted from the media stream. More properties may be added in the future.
|
6810
|
-
*/
|
6811
|
-
type MediaStreamFrameData = {
|
6812
|
-
/**
|
6813
|
-
* The video frame from the media stream.
|
6814
|
-
*/
|
6815
|
-
videoFrame: VideoFrame;
|
6816
|
-
};
|
6817
|
-
/**
|
6818
|
-
* @beta
|
6819
|
-
* Video effect change call back function definition.
|
6820
|
-
* The video app should resolve the promise to notify a successfully processed video frame.
|
6821
|
-
* The video app should reject the promise to notify a failure.
|
6822
|
-
*/
|
6823
|
-
type VideoFrameCallback = (receivedVideoFrame: MediaStreamFrameData) => Promise<VideoFrame>;
|
6824
|
-
/**
|
6825
|
-
* @beta
|
6826
|
-
* Register to read the video frames from the media stream provided by the host.
|
6827
|
-
* @param frameCallback - The callback to invoke when recieve a video frame from the media stream.
|
6828
|
-
* @example
|
6829
|
-
* ```typescript
|
6830
|
-
* video.mediaStream.registerForVideoFrame(async (receivedVideoFrame) => {
|
6831
|
-
* const { videoFrame } = receivedVideoFrame;
|
6832
|
-
* try {
|
6833
|
-
* return await processVideoFrame(videoFrame);
|
6834
|
-
* } catch (error) {
|
6835
|
-
* throw error;
|
6836
|
-
* }
|
6837
|
-
* });
|
6838
|
-
* ```
|
6839
|
-
*/
|
6840
|
-
function registerForVideoFrame(frameCallback: VideoFrameCallback): void;
|
6841
|
-
}
|
6842
6804
|
}
|
6843
6805
|
|
6844
6806
|
/**
|
@@ -7519,9 +7481,13 @@ export namespace settings {
|
|
7519
7481
|
export namespace tasks {
|
7520
7482
|
/**
|
7521
7483
|
* @deprecated
|
7522
|
-
* As of 2.8.0
|
7523
|
-
*
|
7524
|
-
*
|
7484
|
+
* As of 2.8.0:
|
7485
|
+
* - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .
|
7486
|
+
* - For url-based dialogs with bot interaction, please use {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
|
7487
|
+
* - For Adaptive Card-based dialogs:
|
7488
|
+
* - In Teams, please continue to use this function until the new functions in {@link dialog.adaptiveCard} have been fully implemented. You can tell at runtime when they are implemented in Teams by checking
|
7489
|
+
* the return value of the {@link dialog.adaptiveCard.isSupported} function. This documentation line will also be removed once they have been fully implemented in Teams.
|
7490
|
+
* - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
|
7525
7491
|
*
|
7526
7492
|
* Allows an app to open the task module.
|
7527
7493
|
*
|
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
|
+
})(self, () => {
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
12
12
|
/******/ var __webpack_modules__ = ({
|
13
13
|
|
@@ -1477,6 +1477,10 @@ var HostName;
|
|
1477
1477
|
* Teams
|
1478
1478
|
*/
|
1479
1479
|
HostName["teams"] = "Teams";
|
1480
|
+
/**
|
1481
|
+
* Modern Teams
|
1482
|
+
*/
|
1483
|
+
HostName["teamsModern"] = "TeamsModern";
|
1480
1484
|
})(HostName || (HostName = {}));
|
1481
1485
|
// Ensure these declarations stay in sync with the framework.
|
1482
1486
|
var FrameContexts;
|
@@ -2151,7 +2155,7 @@ var _minRuntimeConfigToUninitialize = {
|
|
2151
2155
|
};
|
2152
2156
|
|
2153
2157
|
;// CONCATENATED MODULE: ./src/public/version.ts
|
2154
|
-
var version = "2.9.
|
2158
|
+
var version = "2.9.1";
|
2155
2159
|
|
2156
2160
|
;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
|
2157
2161
|
|
@@ -2713,7 +2717,15 @@ var authentication;
|
|
2713
2717
|
|
2714
2718
|
|
2715
2719
|
/**
|
2716
|
-
*
|
2720
|
+
* This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.
|
2721
|
+
* Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.
|
2722
|
+
* - URL-based dialogs allow you to specify a URL from which the contents will be shown inside the dialog.
|
2723
|
+
* - For URL dialogs, use the functions and interfaces in the {@link dialog.url} namespace.
|
2724
|
+
* - Adaptive Card-based dialogs allow you to provide JSON describing an Adaptive Card that will be shown inside the dialog.
|
2725
|
+
* - For Adaptive Card dialogs, use the functions and interfaces in the {@link dialog.adaptiveCard} namespace.
|
2726
|
+
*
|
2727
|
+
* @remarks Note that dialogs were previously called "task modules". While they have been renamed for clarity, the functionality has been maintained.
|
2728
|
+
* For more details, see [Dialogs](https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-task-modules)
|
2717
2729
|
*
|
2718
2730
|
* @beta
|
2719
2731
|
*/
|
@@ -2962,14 +2974,11 @@ var dialog;
|
|
2962
2974
|
url.getDialogInfoFromBotUrlDialogInfo = getDialogInfoFromBotUrlDialogInfo;
|
2963
2975
|
})(url = dialog.url || (dialog.url = {}));
|
2964
2976
|
/**
|
2965
|
-
*
|
2966
|
-
*
|
2967
|
-
*
|
2968
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
2969
|
-
*
|
2970
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
2977
|
+
* This function currently serves no purpose and should not be used. All functionality that used
|
2978
|
+
* to be covered by this method is now in subcapabilities and those isSupported methods should be
|
2979
|
+
* used directly.
|
2971
2980
|
*
|
2972
|
-
* @
|
2981
|
+
* @hidden
|
2973
2982
|
*/
|
2974
2983
|
function isSupported() {
|
2975
2984
|
return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;
|
@@ -7781,53 +7790,6 @@ var profile;
|
|
7781
7790
|
})(profile || (profile = {}));
|
7782
7791
|
|
7783
7792
|
;// CONCATENATED MODULE: ./src/public/video.ts
|
7784
|
-
var video_assign = (undefined && undefined.__assign) || function () {
|
7785
|
-
video_assign = Object.assign || function(t) {
|
7786
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
7787
|
-
s = arguments[i];
|
7788
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7789
|
-
t[p] = s[p];
|
7790
|
-
}
|
7791
|
-
return t;
|
7792
|
-
};
|
7793
|
-
return video_assign.apply(this, arguments);
|
7794
|
-
};
|
7795
|
-
var video_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7796
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
7797
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
7798
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
7799
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7800
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7801
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
7802
|
-
});
|
7803
|
-
};
|
7804
|
-
var video_generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
7805
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
7806
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
7807
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
7808
|
-
function step(op) {
|
7809
|
-
if (f) throw new TypeError("Generator is already executing.");
|
7810
|
-
while (_) try {
|
7811
|
-
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;
|
7812
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
7813
|
-
switch (op[0]) {
|
7814
|
-
case 0: case 1: t = op; break;
|
7815
|
-
case 4: _.label++; return { value: op[1], done: false };
|
7816
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
7817
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
7818
|
-
default:
|
7819
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
7820
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
7821
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
7822
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
7823
|
-
if (t[2]) _.ops.pop();
|
7824
|
-
_.trys.pop(); continue;
|
7825
|
-
}
|
7826
|
-
op = body.call(thisArg, _);
|
7827
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
7828
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
7829
|
-
}
|
7830
|
-
};
|
7831
7793
|
|
7832
7794
|
|
7833
7795
|
|
@@ -7845,7 +7807,7 @@ var video;
|
|
7845
7807
|
*/
|
7846
7808
|
var VideoFrameFormat;
|
7847
7809
|
(function (VideoFrameFormat) {
|
7848
|
-
VideoFrameFormat["NV12"] = "NV12";
|
7810
|
+
VideoFrameFormat[VideoFrameFormat["NV12"] = 0] = "NV12";
|
7849
7811
|
})(VideoFrameFormat = video.VideoFrameFormat || (video.VideoFrameFormat = {}));
|
7850
7812
|
/**
|
7851
7813
|
* Video effect change type enum
|
@@ -7889,14 +7851,10 @@ var video;
|
|
7889
7851
|
if (!isSupported()) {
|
7890
7852
|
throw errorNotSupportedOnPlatform;
|
7891
7853
|
}
|
7892
|
-
registerHandler('video.newVideoFrame',
|
7893
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
7894
|
-
function (videoFrame) {
|
7854
|
+
registerHandler('video.newVideoFrame', function (videoFrame) {
|
7895
7855
|
if (videoFrame) {
|
7896
|
-
|
7897
|
-
|
7898
|
-
var timestamp_1 = videoFrameData.timestamp;
|
7899
|
-
frameCallback(videoFrameData, function () {
|
7856
|
+
var timestamp_1 = videoFrame.timestamp;
|
7857
|
+
frameCallback(videoFrame, function () {
|
7900
7858
|
notifyVideoFrameProcessed(timestamp_1);
|
7901
7859
|
}, notifyError);
|
7902
7860
|
}
|
@@ -7972,165 +7930,6 @@ var video;
|
|
7972
7930
|
return ensureInitialized(runtime) && runtime.supports.video ? true : false;
|
7973
7931
|
}
|
7974
7932
|
video.isSupported = isSupported;
|
7975
|
-
/**
|
7976
|
-
* @beta
|
7977
|
-
* Namespace to get video frames from a media stream.
|
7978
|
-
* 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.
|
7979
|
-
*/
|
7980
|
-
var mediaStream;
|
7981
|
-
(function (mediaStream_1) {
|
7982
|
-
/**
|
7983
|
-
* @beta
|
7984
|
-
* Checks if video.mediaStream capability is supported by the host
|
7985
|
-
* @returns boolean to represent whether the video.medisStream capability is supported
|
7986
|
-
*
|
7987
|
-
* @throws Error if {@linkcode app.initialize} has not successfully completed
|
7988
|
-
*
|
7989
|
-
*/
|
7990
|
-
function isSupported() {
|
7991
|
-
var _a;
|
7992
|
-
return ensureInitialized(runtime) && isTextureStreamAvailable() && !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream);
|
7993
|
-
}
|
7994
|
-
mediaStream_1.isSupported = isSupported;
|
7995
|
-
function isTextureStreamAvailable() {
|
7996
|
-
var _a, _b, _c, _d;
|
7997
|
-
return (typeof window !== 'undefined' &&
|
7998
|
-
!!(((_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)));
|
7999
|
-
}
|
8000
|
-
/**
|
8001
|
-
* @beta
|
8002
|
-
* Register to read the video frames from the media stream provided by the host.
|
8003
|
-
* @param frameCallback - The callback to invoke when recieve a video frame from the media stream.
|
8004
|
-
* @example
|
8005
|
-
* ```typescript
|
8006
|
-
* video.mediaStream.registerForVideoFrame(async (receivedVideoFrame) => {
|
8007
|
-
* const { videoFrame } = receivedVideoFrame;
|
8008
|
-
* try {
|
8009
|
-
* return await processVideoFrame(videoFrame);
|
8010
|
-
* } catch (error) {
|
8011
|
-
* throw error;
|
8012
|
-
* }
|
8013
|
-
* });
|
8014
|
-
* ```
|
8015
|
-
*/
|
8016
|
-
function registerForVideoFrame(frameCallback) {
|
8017
|
-
var _this = this;
|
8018
|
-
ensureInitialized(runtime, FrameContexts.sidePanel);
|
8019
|
-
if (!isSupported()) {
|
8020
|
-
throw errorNotSupportedOnPlatform;
|
8021
|
-
}
|
8022
|
-
registerHandler('video.startVideoExtensibilityVideoStream', function (mediaStreamInfo) { return video_awaiter(_this, void 0, void 0, function () {
|
8023
|
-
var streamId, videoTrack, generator;
|
8024
|
-
var _a, _b;
|
8025
|
-
return video_generator(this, function (_c) {
|
8026
|
-
switch (_c.label) {
|
8027
|
-
case 0:
|
8028
|
-
streamId = mediaStreamInfo.streamId;
|
8029
|
-
return [4 /*yield*/, getInputVideoTrack(streamId)];
|
8030
|
-
case 1:
|
8031
|
-
videoTrack = _c.sent();
|
8032
|
-
generator = createProcessedStreamGenerator(videoTrack, frameCallback);
|
8033
|
-
// register the video track with processed frames back to the stream:
|
8034
|
-
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));
|
8035
|
-
return [2 /*return*/];
|
8036
|
-
}
|
8037
|
-
});
|
8038
|
-
}); });
|
8039
|
-
sendMessageToParent('video.registerForVideoFrame', [
|
8040
|
-
{
|
8041
|
-
format: VideoFrameFormat.NV12,
|
8042
|
-
},
|
8043
|
-
]);
|
8044
|
-
}
|
8045
|
-
mediaStream_1.registerForVideoFrame = registerForVideoFrame;
|
8046
|
-
/**
|
8047
|
-
* Get the video track from the media stream gotten from chrome.webview.getTextureStream(streamId).
|
8048
|
-
*/
|
8049
|
-
function getInputVideoTrack(streamId) {
|
8050
|
-
return video_awaiter(this, void 0, void 0, function () {
|
8051
|
-
var chrome, mediaStream_2, tracks, error_1, errorMsg;
|
8052
|
-
return video_generator(this, function (_a) {
|
8053
|
-
switch (_a.label) {
|
8054
|
-
case 0:
|
8055
|
-
if (typeof window === 'undefined') {
|
8056
|
-
throw errorNotSupportedOnPlatform;
|
8057
|
-
}
|
8058
|
-
chrome = window['chrome'];
|
8059
|
-
_a.label = 1;
|
8060
|
-
case 1:
|
8061
|
-
_a.trys.push([1, 3, , 4]);
|
8062
|
-
return [4 /*yield*/, chrome.webview.getTextureStream(streamId)];
|
8063
|
-
case 2:
|
8064
|
-
mediaStream_2 = _a.sent();
|
8065
|
-
tracks = mediaStream_2.getVideoTracks();
|
8066
|
-
if (tracks.length === 0) {
|
8067
|
-
throw new Error("No video track in stream ".concat(streamId));
|
8068
|
-
}
|
8069
|
-
return [2 /*return*/, tracks[0]];
|
8070
|
-
case 3:
|
8071
|
-
error_1 = _a.sent();
|
8072
|
-
errorMsg = "Failed to get video track from stream ".concat(streamId, ", error: ").concat(error_1);
|
8073
|
-
notifyError(errorMsg);
|
8074
|
-
throw new Error(errorMsg);
|
8075
|
-
case 4: return [2 /*return*/];
|
8076
|
-
}
|
8077
|
-
});
|
8078
|
-
});
|
8079
|
-
}
|
8080
|
-
/**
|
8081
|
-
* The function to create a processed video track from the original video track.
|
8082
|
-
* It reads frames from the video track and pipes them to the video frame callback to process the frames.
|
8083
|
-
* The processed frames are then enqueued to the generator.
|
8084
|
-
* The generator can be registered back to the media stream so that the host can get the processed frames.
|
8085
|
-
*/
|
8086
|
-
function createProcessedStreamGenerator(videoTrack, videoFrameCallback) {
|
8087
|
-
var processor = new MediaStreamTrackProcessor({ track: videoTrack });
|
8088
|
-
var source = processor.readable;
|
8089
|
-
var generator = new MediaStreamTrackGenerator({ kind: 'video' });
|
8090
|
-
var sink = generator.writable;
|
8091
|
-
source
|
8092
|
-
.pipeThrough(new TransformStream({
|
8093
|
-
transform: function (originalFrame, controller) {
|
8094
|
-
return video_awaiter(this, void 0, void 0, function () {
|
8095
|
-
var timestamp, frameProcessedByApp, processedFrame, error_2;
|
8096
|
-
return video_generator(this, function (_a) {
|
8097
|
-
switch (_a.label) {
|
8098
|
-
case 0:
|
8099
|
-
timestamp = originalFrame.timestamp;
|
8100
|
-
if (!(timestamp !== null)) return [3 /*break*/, 5];
|
8101
|
-
_a.label = 1;
|
8102
|
-
case 1:
|
8103
|
-
_a.trys.push([1, 3, , 4]);
|
8104
|
-
return [4 /*yield*/, videoFrameCallback({ videoFrame: originalFrame })];
|
8105
|
-
case 2:
|
8106
|
-
frameProcessedByApp = _a.sent();
|
8107
|
-
processedFrame = new VideoFrame(frameProcessedByApp, {
|
8108
|
-
// we need the timestamp to be unchanged from the oirginal frame, so we explicitly set it here.
|
8109
|
-
timestamp: timestamp,
|
8110
|
-
});
|
8111
|
-
controller.enqueue(processedFrame);
|
8112
|
-
originalFrame.close();
|
8113
|
-
frameProcessedByApp.close();
|
8114
|
-
return [3 /*break*/, 4];
|
8115
|
-
case 3:
|
8116
|
-
error_2 = _a.sent();
|
8117
|
-
originalFrame.close();
|
8118
|
-
notifyError(error_2);
|
8119
|
-
return [3 /*break*/, 4];
|
8120
|
-
case 4: return [3 /*break*/, 6];
|
8121
|
-
case 5:
|
8122
|
-
notifyError('timestamp of the original video frame is null');
|
8123
|
-
_a.label = 6;
|
8124
|
-
case 6: return [2 /*return*/];
|
8125
|
-
}
|
8126
|
-
});
|
8127
|
-
});
|
8128
|
-
},
|
8129
|
-
}))
|
8130
|
-
.pipeTo(sink);
|
8131
|
-
return generator;
|
8132
|
-
}
|
8133
|
-
})(mediaStream = video.mediaStream || (video.mediaStream = {}));
|
8134
7933
|
})(video || (video = {})); //end of video namespace
|
8135
7934
|
|
8136
7935
|
;// CONCATENATED MODULE: ./src/public/search.ts
|
@@ -9033,9 +8832,13 @@ var tasks;
|
|
9033
8832
|
(function (tasks) {
|
9034
8833
|
/**
|
9035
8834
|
* @deprecated
|
9036
|
-
* As of 2.8.0
|
9037
|
-
*
|
9038
|
-
*
|
8835
|
+
* As of 2.8.0:
|
8836
|
+
* - For url-based dialogs, please use {@link dialog.url.open dialog.url.open(urlDialogInfo: UrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void} .
|
8837
|
+
* - For url-based dialogs with bot interaction, please use {@link dialog.url.bot.open dialog.url.bot.open(botUrlDialogInfo: BotUrlDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
|
8838
|
+
* - For Adaptive Card-based dialogs:
|
8839
|
+
* - In Teams, please continue to use this function until the new functions in {@link dialog.adaptiveCard} have been fully implemented. You can tell at runtime when they are implemented in Teams by checking
|
8840
|
+
* the return value of the {@link dialog.adaptiveCard.isSupported} function. This documentation line will also be removed once they have been fully implemented in Teams.
|
8841
|
+
* - In all other hosts, please use {@link dialog.adaptiveCard.open dialog.adaptiveCard.open(cardDialogInfo: CardDialogInfo, submitHandler?: DialogSubmitHandler, messageFromChildHandler?: PostMessageChannel): void}
|
9039
8842
|
*
|
9040
8843
|
* Allows an app to open the task module.
|
9041
8844
|
*
|