@opentok/client 2.31.0-alpha.57 → 2.31.0-alpha.58

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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.31.0 6b11a8616
2
+ * @license OpenTok.js 2.31.0 2ff03b19e
3
3
  *
4
4
  * Copyright (c) 2010-2025 TokBox, Inc.
5
5
  * Subject to the applicable Software Development Kit (SDK) License Agreement:
6
6
  * https://www.vonage.com/legal/communications-apis/terms-of-use/
7
7
  *
8
- * Date: Fri, 03 Oct 2025 07:26:08 GMT
8
+ * Date: Fri, 03 Oct 2025 09:53:32 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -8605,7 +8605,7 @@ function staticConfigFactory(_temp) {
8605
8605
  _ref$axios = _ref.axios,
8606
8606
  axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
8607
8607
  _ref$properties = _ref.properties,
8608
- properties = _ref$properties === void 0 ? {"version":"v2.31.0","buildHash":"6b11a8616","minimumVersion":{"firefox":52,"chrome":49},"debug":false,"websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com","vonageApiURL":""} : _ref$properties;
8608
+ properties = _ref$properties === void 0 ? {"version":"v2.31.0","buildHash":"2ff03b19e","minimumVersion":{"firefox":52,"chrome":49},"debug":false,"websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com","vonageApiURL":""} : _ref$properties;
8609
8609
  /** @type builtInConfig */
8610
8610
  const builtInConfig = (0, _cloneDeep.default)(properties);
8611
8611
  /**
@@ -76338,14 +76338,14 @@ const createMOSScoreHelper = () => ({
76338
76338
  rtcStats.video.roundTripTime = stat.totalRoundTripTime;
76339
76339
  }
76340
76340
  if (stat.type === 'inbound-rtp') {
76341
- var _subscriber$stream;
76341
+ var _subscriber$stream, _subscriber$stream2;
76342
76342
  const currVideoStats = stat;
76343
76343
  rtcStats.video.packetLoss = calculatePacketsLostPercentage(currVideoStats);
76344
76344
  if (lastVideoStats) {
76345
76345
  rtcStats.video.bitrate = calculateBitrate(currVideoStats, lastVideoStats);
76346
76346
  rtcStats.video.bufferDelay = calculateJitterBufferMovingAverage(currVideoStats, lastVideoStats);
76347
76347
  }
76348
- const actualDimensions = (_subscriber$stream = subscriber.stream) == null ? void 0 : _subscriber$stream.videoDimensions;
76348
+ const actualDimensions = subscriber == null ? void 0 : (_subscriber$stream = subscriber.stream) == null ? void 0 : _subscriber$stream.videoDimensions;
76349
76349
  if (actualDimensions) {
76350
76350
  rtcStats.video.width = actualDimensions == null ? void 0 : actualDimensions.width;
76351
76351
  rtcStats.video.height = actualDimensions == null ? void 0 : actualDimensions.height;
@@ -76355,8 +76355,16 @@ const createMOSScoreHelper = () => ({
76355
76355
  rtcStats.video.expectedWidth = subscriber == null ? void 0 : subscriber._preferredResolution.width;
76356
76356
  rtcStats.video.expectedHeight = subscriber == null ? void 0 : subscriber._preferredResolution.height;
76357
76357
  }
76358
+ if (['screen', 'custom'].includes(subscriber == null ? void 0 : (_subscriber$stream2 = subscriber.stream) == null ? void 0 : _subscriber$stream2.videoType)) {
76359
+ // We cannot guarantee a high frameRate in 'screen' or 'custom' since content can be
76360
+ // static, thus we can expect a low frameRate in this case. However rtcscore will
76361
+ // be dragged by low frameRate. In this case low frameRate is fine, and we avoid a
76362
+ // false bad score, by setting expectedFrameRate to currentFrameRate.
76363
+ rtcStats.video.expectedFrameRate = currVideoStats.framesPerSecond;
76364
+ } else {
76365
+ rtcStats.video.expectedFrameRate = subscriber == null ? void 0 : subscriber._preferredFrameRate;
76366
+ }
76358
76367
  rtcStats.video.frameRate = currVideoStats.framesPerSecond;
76359
- rtcStats.video.expectedFrameRate = subscriber == null ? void 0 : subscriber._preferredFrameRate;
76360
76368
  lastVideoStats = currVideoStats;
76361
76369
  }
76362
76370
  }