@dtelecom/livekit-client 1.12.22 → 1.12.23

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.
@@ -14202,7 +14202,7 @@ function getMatch(exp, ua) {
14202
14202
  return match && match.length >= id && match[id] || '';
14203
14203
  }
14204
14204
 
14205
- var version$1 = "1.12.22";
14205
+ var version$1 = "1.12.23";
14206
14206
 
14207
14207
  const version = version$1;
14208
14208
  const protocolVersion = 9;
@@ -23138,12 +23138,14 @@ class Room extends EventEmitter {
23138
23138
  }
23139
23139
  // also hook unload event
23140
23140
  if (isWeb() && this.options.disconnectOnPageLeave) {
23141
- // capturing both 'pagehide' and 'beforeunload' to capture broadest set of browser behaviors
23141
+ // capture page leave across browser behaviors
23142
23142
  window.addEventListener('pagehide', this.onPageLeave);
23143
- window.addEventListener('beforeunload', this.onPageLeave);
23143
+ if (this.options.disconnectOnPageLeave !== 'pagehide') {
23144
+ window.addEventListener('beforeunload', this.onPageLeave);
23145
+ }
23144
23146
  }
23145
23147
  if (isWeb()) {
23146
- document.addEventListener('freeze', this.onPageLeave);
23148
+ window.addEventListener('freeze', this.onPageLeave);
23147
23149
  (_c = navigator.mediaDevices) === null || _c === void 0 ? void 0 : _c.addEventListener('devicechange', this.handleDeviceChange);
23148
23150
  }
23149
23151
  this.setAndEmitConnectionState(ConnectionState.Connected);