@opentok/client 2.30.4-alpha.1 → 2.30.5-alpha.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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.30.4 9b483aef6
2
+ * @license OpenTok.js 2.30.5 ee13e838e
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: Mon, 14 Jul 2025 18:14:41 GMT
8
+ * Date: Mon, 21 Jul 2025 17:53:34 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -8679,7 +8679,7 @@ const logging = (0, _log.default)('StaticConfig');
8679
8679
  */
8680
8680
 
8681
8681
  /** @type builtInConfig */
8682
- const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.4","buildHash":"9b483aef6","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"});
8682
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.5","buildHash":"ee13e838e","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"});
8683
8683
  const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
8684
8684
  const liveConfigMap = {
8685
8685
  apiUrl: 'apiURL',
@@ -72928,33 +72928,45 @@ function waitForVideoToBePlaying(_ref) {
72928
72928
  const videoElementFacade = deps.videoElementFacade || defaultVideoElementFacade;
72929
72929
  const isVideoFrameBlack = deps.isVideoFrameBlack || _isVideoFrameBlack.default;
72930
72930
  const videoElementFacadeEvents = deps.videoElementFacadeEvents || (0, _eventHelper.default)(videoElementFacade);
72931
+ let timeoutReturnValue = false;
72932
+ let requestCallbackId;
72931
72933
  const promise = new Promise(resolve => {
72932
72934
  // eslint-disable-next-line consistent-return
72933
72935
  const onVideoPlaybackHandler = videoPlaybackEvent => {
72936
+ // When the video is playing, we resolve with the event at timeout.
72937
+ timeoutReturnValue = videoPlaybackEvent;
72938
+
72939
+ // Clean up event listeners - we only needed to listen until the first playback event
72940
+ videoElementFacadeEvents.removeAll();
72934
72941
  if (!isBufferedStream || !env.isChromium) {
72935
72942
  // If there is no video and we're not subscribed to video, or if we're using a non-Chromium browser,
72936
72943
  // resolve immediately because the video frame callback will never be called or because the bug is not present on non-Chromium browsers.
72937
72944
  return resolve(videoPlaybackEvent);
72938
72945
  }
72939
- const videoFrameCallback = (_, metadata) => {
72946
+ const videoFrameCallback = () => {
72940
72947
  // During an AMR transition or any new stream bind, we check that a real video frame is displayed for Chromium browsers
72941
72948
  // before switching streams to eliminate the screen flicker. See VIDCS-3570.
72942
72949
  const hasBlackVideoFrame = isVideoFrameBlack(videoElementFacade);
72943
- const hasMaxWaitTimeElapsed = metadata.mediaTime > maxWaitTime / 1000 - 1;
72944
- if (!hasBlackVideoFrame || hasMaxWaitTimeElapsed) {
72945
- // If we have a real video frame, or if we've waited 4s (maybe a webcam cover is down), we proceed.
72950
+ if (!hasBlackVideoFrame) {
72951
+ // If we have a real video frame, we proceed.
72946
72952
  return resolve(videoPlaybackEvent);
72947
72953
  }
72948
72954
 
72949
72955
  // If we haven't seen a non-black video frame, we re-register the callback.
72950
- return videoElementFacade.requestVideoFrameCallback(videoFrameCallback);
72956
+ requestCallbackId = videoElementFacade.requestVideoFrameCallback(videoFrameCallback);
72957
+ return requestCallbackId;
72951
72958
  };
72952
- videoElementFacade.requestVideoFrameCallback(videoFrameCallback);
72959
+ requestCallbackId = videoElementFacade.requestVideoFrameCallback(videoFrameCallback);
72953
72960
  };
72954
72961
  videoElementFacadeEvents.on('timeupdate', onVideoPlaybackHandler);
72955
72962
  videoElementFacadeEvents.on('loadedmetadata', onVideoPlaybackHandler);
72956
72963
  });
72957
- return (0, _promiseFinally.default)((0, _pTimeout.default)(promise, maxWaitTime, () => false), () => videoElementFacadeEvents.removeAll());
72964
+ return (0, _promiseFinally.default)((0, _pTimeout.default)(promise, maxWaitTime, () => timeoutReturnValue), () => {
72965
+ videoElementFacadeEvents.removeAll();
72966
+ if (requestCallbackId) {
72967
+ videoElementFacade.cancelVideoFrameCallback(requestCallbackId);
72968
+ }
72969
+ });
72958
72970
  }
72959
72971
  var _default = waitForVideoToBePlaying;
72960
72972
  exports.default = _default;