@mebius-io/web 0.4.3 → 0.4.5

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.
@@ -42974,7 +42974,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
42974
42974
  var MAX_DRIFT_S = 2;
42975
42975
  var EDGE_MARGIN_S = 0.4;
42976
42976
  var AUDIO_RETRY_MS = 2500;
42977
- function stalledAtZero(video, ms) {
42977
+ function stalledWithData(video, ms) {
42978
42978
  if (video.currentTime > 0) return Promise.resolve(false);
42979
42979
  return new Promise((resolve) => {
42980
42980
  const done = (stalled) => {
@@ -42985,7 +42985,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
42985
42985
  const onTime = () => {
42986
42986
  if (video.currentTime > 0) done(false);
42987
42987
  };
42988
- const timer = setTimeout(() => done(true), ms);
42988
+ const timer = setTimeout(() => done(video.buffered.length > 0 && video.currentTime === 0), ms);
42989
42989
  video.addEventListener("timeupdate", onTime);
42990
42990
  });
42991
42991
  }
@@ -43036,7 +43036,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
43036
43036
  this.attachPlayer(flvjs, video, url, true);
43037
43037
  const firstPlay = playWithAutoplayFallback(video);
43038
43038
  firstPlay.catch(() => void 0);
43039
- if (await stalledAtZero(video, AUDIO_RETRY_MS)) {
43039
+ if (await stalledWithData(video, AUDIO_RETRY_MS)) {
43040
43040
  this.teardownPlayer();
43041
43041
  this.attachPlayer(flvjs, video, url, false);
43042
43042
  this.mutedByPolicy = (await playWithAutoplayFallback(video)).mutedByPolicy;
@@ -43113,7 +43113,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
43113
43113
  }
43114
43114
 
43115
43115
  // src/internal/telemetry.ts
43116
- var SDK_VERSION = "web/0.4.3";
43116
+ var SDK_VERSION = "web/0.4.5";
43117
43117
  var FLUSH_INTERVAL_MS = 15e3;
43118
43118
  var MAX_BATCH = 64;
43119
43119
  function describeDevice() {
@@ -43368,6 +43368,9 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
43368
43368
  }
43369
43369
  await candidate.stop().catch(() => void 0);
43370
43370
  }
43371
+ this.elementListeners?.abort();
43372
+ this.elementListeners = null;
43373
+ if (ELEMENT_OWNER.get(video) === this) ELEMENT_OWNER.delete(video);
43371
43374
  this.video = null;
43372
43375
  throw lastError ?? mebiusError("CONNECTION_FAILED", "No Mebius route could play this stream.");
43373
43376
  }
@@ -43387,10 +43390,25 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
43387
43390
  this.video = null;
43388
43391
  this.playing = false;
43389
43392
  }
43390
- /** Set output volume in the range 0..1. */
43393
+ /**
43394
+ * Set output volume in the range 0..1.
43395
+ *
43396
+ * Any volume above zero also unmutes. Playback often starts muted — the
43397
+ * element may carry `muted` in the app's own markup, and the SDK itself mutes
43398
+ * and retries when the browser refuses to autoplay with sound — and
43399
+ * `video.volume` has no audible effect while `muted` is set. Setting volume
43400
+ * without clearing it meant an app whose only audio control was a slider
43401
+ * could never produce sound: the value moved, the stream stayed silent, and
43402
+ * nothing reported a problem.
43403
+ *
43404
+ * Volume 0 mutes rather than merely turning the level down, so a UI that
43405
+ * drags to zero also survives a later unmute at the element level.
43406
+ */
43391
43407
  setVolume(volume) {
43392
43408
  const v = Math.min(1, Math.max(0, volume));
43393
- if (this.video) this.video.volume = v;
43409
+ if (!this.video) return;
43410
+ this.video.volume = v;
43411
+ this.video.muted = v === 0;
43394
43412
  }
43395
43413
  attach(transport) {
43396
43414
  transport.onEnded(() => {