@microsoft/teams-js 2.26.0-beta.0 → 2.26.0-beta.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.
@@ -2756,6 +2756,15 @@ export namespace videoEffectsEx {
2756
2756
  * Limited to Microsoft-internal use
2757
2757
  */
2758
2758
  audioInferenceModel?: ArrayBuffer;
2759
+ /**
2760
+ * @hidden
2761
+ * Specifies additional capabilities that should be applied to the video frame
2762
+ * @beta
2763
+ *
2764
+ * @internal
2765
+ * Limited to Microsoft-internal use
2766
+ */
2767
+ requiredCapabilities?: string[];
2759
2768
  }
2760
2769
  /**
2761
2770
  * @hidden
@@ -2806,6 +2815,15 @@ export namespace videoEffectsEx {
2806
2815
  * Limited to Microsoft-internal use
2807
2816
  */
2808
2817
  audioInferenceResult?: Uint8Array;
2818
+ /**
2819
+ * @hidden
2820
+ * Additional metadata determined by capabilities specified in {@linkcode VideoFrameConfig.requiredCapabilities}
2821
+ * @beta
2822
+ *
2823
+ * @internal
2824
+ * Limited to Microsoft-internal use
2825
+ */
2826
+ attributes?: ReadonlyMap<string, Uint8Array>;
2809
2827
  };
2810
2828
  /**
2811
2829
  * @hidden
@@ -1130,7 +1130,7 @@ function isFollowingApiVersionTagFormat(apiVersionTag) {
1130
1130
  }
1131
1131
 
1132
1132
  ;// CONCATENATED MODULE: ./src/artifactsForCDN/validDomains.json
1133
- const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","teams.cloud.microsoft","outlook.cloud.microsoft","m365.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net"]}');
1133
+ const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"]}');
1134
1134
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
1135
1135
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1136
1136
 
@@ -3395,7 +3395,7 @@ const _minRuntimeConfigToUninitialize = {
3395
3395
  * @hidden
3396
3396
  * Package version.
3397
3397
  */
3398
- const version = "2.26.0-beta.0";
3398
+ const version = "2.26.0-beta.1";
3399
3399
 
3400
3400
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
3401
3401
 
@@ -3553,11 +3553,11 @@ function prefetchOriginsFromCDN() {
3553
3553
  });
3554
3554
  }
3555
3555
  function isValidOriginsCacheEmpty() {
3556
- return validOriginsCache.length !== 0;
3556
+ return validOriginsCache.length === 0;
3557
3557
  }
3558
3558
  function getValidOriginsListFromCDN() {
3559
3559
  return __awaiter(this, void 0, void 0, function* () {
3560
- if (isValidOriginsCacheEmpty()) {
3560
+ if (!isValidOriginsCacheEmpty()) {
3561
3561
  return validOriginsCache;
3562
3562
  }
3563
3563
  if (!inServerSideRenderingEnvironment()) {
@@ -10356,6 +10356,7 @@ class OneTextureMetadata {
10356
10356
  // Stream id for audio inference metadata, which is the 4-byte ASCII string "1dia" hardcoded by the host
10357
10357
  // (1dia stands for "audio inference data version 1")
10358
10358
  this.AUDIO_INFERENCE_RESULT_STREAM_ID = 0x31646961;
10359
+ this.ATTRIBUTE_ID_MAP_STREAM_ID = 0x4d444941;
10359
10360
  const metadataDataView = new Uint32Array(metadataBuffer);
10360
10361
  for (let i = 0, index = 0; i < streamCount; i++) {
10361
10362
  const streamId = metadataDataView[index++];
@@ -10368,6 +10369,48 @@ class OneTextureMetadata {
10368
10369
  get audioInferenceResult() {
10369
10370
  return this.metadataMap.get(this.AUDIO_INFERENCE_RESULT_STREAM_ID);
10370
10371
  }
10372
+ /**
10373
+ * @hidden
10374
+ * Additional attributes on the video frame are string-indexed, with their stream Id dynamically generated.
10375
+ * The mapping of attribute Ids to their stream Ids is itself stored as frame metadata with layout:
10376
+ *
10377
+ * | attribute count | attribute stream Id | attribute id | ... |
10378
+ * | :---: | :---: | :---: | :---: |
10379
+ * | 4 bytes | 4 bytes | variable length string (null terminated, 4 byte aligned) | ... |
10380
+ *
10381
+ *
10382
+ * @internal
10383
+ * Limited to Microsoft-internal use
10384
+ */
10385
+ get attributes() {
10386
+ const data = this.metadataMap.get(this.ATTRIBUTE_ID_MAP_STREAM_ID);
10387
+ if (data === undefined) {
10388
+ return undefined;
10389
+ }
10390
+ const map = new Map();
10391
+ const textDecoder = new TextDecoder('utf-8');
10392
+ let offset = 0;
10393
+ const count = data[offset] + (data[++offset] << 8) + (data[++offset] << 16) + (data[++offset] << 24);
10394
+ for (let i = 0; i < count && offset < data.length - 1; i++) {
10395
+ const streamId = data[++offset] + (data[++offset] << 8) + (data[++offset] << 16) + (data[++offset] << 24);
10396
+ // Find start of null-terminator for the subsequent variable-length string entry
10397
+ const nullTerminatorStartIndex = data.findIndex((value, index, _) => {
10398
+ return value == 0 && index > offset;
10399
+ });
10400
+ const attributeId = textDecoder.decode(data.slice(++offset, nullTerminatorStartIndex));
10401
+ // Read attribute value from metadata map
10402
+ const metadata = this.metadataMap.get(streamId);
10403
+ if (metadata !== undefined) {
10404
+ map.set(attributeId, metadata);
10405
+ }
10406
+ // Variable length attribute Id strings are null-terminated to a 4-byte alignment
10407
+ const stringByteLength = nullTerminatorStartIndex - offset;
10408
+ const paddingSize = 4 - (stringByteLength % 4);
10409
+ // Set offset to index of last trailing zero
10410
+ offset = nullTerminatorStartIndex + (paddingSize - 1);
10411
+ }
10412
+ return map;
10413
+ }
10371
10414
  }
10372
10415
  class TransformerWithMetadata {
10373
10416
  constructor(notifyError, videoFrameHandler) {
@@ -10378,8 +10421,8 @@ class TransformerWithMetadata {
10378
10421
  const timestamp = originalFrame.timestamp;
10379
10422
  if (timestamp !== null) {
10380
10423
  try {
10381
- const { videoFrame, metadata: { audioInferenceResult } = {} } = yield this.extractVideoFrameAndMetadata(originalFrame);
10382
- const frameProcessedByApp = yield this.videoFrameHandler({ videoFrame, audioInferenceResult });
10424
+ const { videoFrame, metadata: { audioInferenceResult, attributes } = {} } = yield this.extractVideoFrameAndMetadata(originalFrame);
10425
+ const frameProcessedByApp = yield this.videoFrameHandler({ videoFrame, audioInferenceResult, attributes });
10383
10426
  // the current typescript version(4.6.4) dosn't support webcodecs API fully, we have to do type conversion here.
10384
10427
  const processedFrame = new VideoFrame(frameProcessedByApp, {
10385
10428
  // we need the timestamp to be unchanged from the oirginal frame, so we explicitly set it here.
@@ -10476,6 +10519,7 @@ class TransformerWithMetadata {
10476
10519
  }),
10477
10520
  metadata: {
10478
10521
  audioInferenceResult: this.shouldDiscardAudioInferenceResult ? undefined : metadata.audioInferenceResult,
10522
+ attributes: metadata.attributes,
10479
10523
  },
10480
10524
  };
10481
10525
  });