@opentok/client 2.31.0-alpha.39 → 2.31.0-alpha.40

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 0812edbb6
2
+ * @license OpenTok.js 2.31.0 4fa8a2be5
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: Tue, 09 Sep 2025 08:06:49 GMT
8
+ * Date: Tue, 09 Sep 2025 13:28:09 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -8692,7 +8692,7 @@ function staticConfigFactory(_temp) {
8692
8692
  _ref$axios = _ref.axios,
8693
8693
  axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
8694
8694
  _ref$properties = _ref.properties,
8695
- properties = _ref$properties === void 0 ? {"version":"v2.31.0","buildHash":"0812edbb6","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;
8695
+ properties = _ref$properties === void 0 ? {"version":"v2.31.0","buildHash":"4fa8a2be5","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;
8696
8696
  /** @type builtInConfig */
8697
8697
  const builtInConfig = (0, _cloneDeep.default)(properties);
8698
8698
  /**
@@ -18935,30 +18935,40 @@ function PublisherFactory(_ref) {
18935
18935
  return webRTCStream.getAudioTracks().length > 0 && webRTCStream.getAudioTracks().reduce((isEnabled, track) => isEnabled && !track.muted && track.enabled && track.readyState !== 'ended', properties.publishAudio);
18936
18936
  };
18937
18937
  const refreshAudioVideoUI = activeReason => {
18938
+ const containsAudio = hasAudio();
18939
+ const containsVideo = hasVideo();
18938
18940
  if (widgetView) {
18939
- widgetView.audioOnly(!hasVideo());
18940
- widgetView.showPoster(!hasVideo());
18941
+ widgetView.audioOnly(!containsVideo);
18942
+ widgetView.showPoster(!containsVideo);
18941
18943
  }
18942
18944
  if (chromeMixin) {
18943
- chromeMixin.setAudioOnly(!hasVideo() && hasAudio());
18945
+ chromeMixin.setAudioOnly(!containsVideo && containsAudio);
18944
18946
  }
18945
18947
  if (this.stream) {
18946
18948
  let congestionLevel;
18947
- if (pendingRumorAudioFallbackMessage && hasVideo()) {
18949
+ if (pendingRumorAudioFallbackMessage && containsVideo) {
18948
18950
  congestionLevel = _congestionLevels.CongestionLevels.LOW;
18949
18951
  pendingRumorAudioFallbackMessage = false;
18950
18952
  }
18951
18953
  this.stream.setChannelActiveState({
18952
18954
  channelType: 'audio',
18953
- activeState: hasAudio(),
18955
+ activeState: containsAudio,
18954
18956
  activeReason
18955
18957
  });
18956
18958
  this.stream.setChannelActiveState({
18957
18959
  channelType: 'video',
18958
- activeState: hasVideo(),
18960
+ activeState: containsVideo,
18959
18961
  activeReason,
18960
18962
  congestionLevel
18961
18963
  });
18964
+ // Only update audio and video state immediately when it is false, otherwise Rumor will
18965
+ // update the state when properly publishing audio and video.
18966
+ if (!containsAudio) {
18967
+ this.stream.hasAudio = containsAudio;
18968
+ }
18969
+ if (!containsVideo) {
18970
+ this.stream.hasVideo = containsVideo;
18971
+ }
18962
18972
  } else {
18963
18973
  // Make sure we add a listener for refreshAudioVideoUI only one time.
18964
18974
  this.off('publishComplete', refreshAudioVideoUI);