@vindral/web-sdk 4.1.8-5-gfb5ffadf → 4.1.8-6-g43df7939

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.
@@ -27,7 +27,7 @@ var X = (B, g, A) => new Promise((J, k) => {
27
27
  }, o = (h) => h.done ? J(h.value) : Promise.resolve(h.value).then(y, a);
28
28
  o((A = A.apply(B, g)).next());
29
29
  });
30
- import { F as RA, d as JA, n as kA } from "./De8zVLJ6.js";
30
+ import { F as RA, d as JA, n as kA } from "./CDb-S27g.js";
31
31
  var hA = (function() {
32
32
  var B = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0;
33
33
  return (function(g) {
package/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as C, e as I, f as _, a as O, C as D, D as T, I as a, N as A, V as s, g as r } from "./De8zVLJ6.js";
1
+ import { c as C, e as I, f as _, a as O, C as D, D as T, I as a, N as A, V as s, g as r } from "./CDb-S27g.js";
2
2
  export {
3
3
  C as AUTHENTICATION_EXPIRED_CODE,
4
4
  I as AUTHENTICATION_FAILED_CODE,
package/legacy.es.js CHANGED
@@ -8594,19 +8594,25 @@ class jQ {
8594
8594
  this.emitter.emit("video decode rate", this.videoDecodeRate());
8595
8595
  });
8596
8596
  I(this, "updateBufferState", () => {
8597
- var B, o;
8598
8597
  let A;
8599
- if (this.trackContexts.forEach((C) => {
8600
- var Q, a, E, h;
8598
+ if (this.trackContexts.forEach((B) => {
8599
+ var o, C, Q, a;
8601
8600
  if (!A)
8602
- A = C.buffer;
8601
+ A = B.buffer;
8603
8602
  else {
8604
- const d = (a = (Q = C.buffer[C.buffer.length - 1]) == null ? void 0 : Q.end) != null ? a : 0;
8605
- ((h = (E = A[A.length - 1]) == null ? void 0 : E.end) != null ? h : 0) > d && (A = C.buffer);
8603
+ const E = (C = (o = B.buffer[B.buffer.length - 1]) == null ? void 0 : o.end) != null ? C : 0;
8604
+ ((a = (Q = A[A.length - 1]) == null ? void 0 : Q.end) != null ? a : 0) > E && (A = B.buffer);
8606
8605
  }
8607
8606
  }), !A)
8608
8607
  return;
8609
- const t = this.playbackSource.currentTime, e = (o = (B = A[A.length - 1]) == null ? void 0 : B.end) != null ? o : 0, g = t < e ? "playing" : "buffering";
8608
+ const t = this.playbackSource.currentTime;
8609
+ let e = !0;
8610
+ this.trackContexts.forEach((B) => {
8611
+ B.buffer.some(
8612
+ (C) => C.start <= t && t < C.end
8613
+ ) || (e = !1);
8614
+ });
8615
+ const g = e ? "playing" : "buffering";
8610
8616
  this.emitter.emit("buffer state", {
8611
8617
  buffered: A,
8612
8618
  currentTime: this.playbackSource.currentTime,
@@ -10380,9 +10386,11 @@ const jo = class jo {
10380
10386
  needsInputForAudioCount: this.needsInputForAudioCount,
10381
10387
  needsInputForVideoCount: this.needsInputForVideoCount
10382
10388
  }));
10383
- I(this, "onBufferedStateChanged", ({ buffered: A, isPaused: t }) => {
10384
- const e = this.clockSource.currentTime, g = A.some((E) => E.start < e && e < E.end), B = A[A.length - 1], o = B ? B.end - B.start >= this.targetBufferTime : !1, C = B ? Math.max(0, B.end - e) / this.targetBufferTime : 0, Q = t ? "paused" : g ? "playing" : "buffering", a = this.state;
10385
- this.currentTimeIsInRange !== g && !g ? (this.lastBufferStateEvent = "drained", this.emitter.emit("buffer state event", this.lastBufferStateEvent)) : g && o && this.lastBufferStateEvent === "drained" && (this.lastBufferStateEvent = "filled", this.emitter.emit("buffer state event", this.lastBufferStateEvent)), Q === "playing" && !this.firstFrameTime && (this.firstFrameTime = Date.now()), this.currentTimeIsInRange = g, this.state = Q, this.bufferFullness = g ? C : 0, a !== Q && this.emitter.emit("playback state", Q), this.emitter.emit("buffer fullness", this.bufferFullness);
10389
+ I(this, "onBufferedStateChanged", ({ buffered: A, isPaused: t, playbackState: e }) => {
10390
+ const g = this.clockSource.currentTime, B = A.some((h) => h.start <= g && g < h.end), o = A[A.length - 1], C = o ? o.end - o.start >= this.targetBufferTime : !1, Q = o ? Math.max(0, o.end - g) / this.targetBufferTime : 0;
10391
+ let a = t ? "paused" : e;
10392
+ const E = this.state;
10393
+ this.currentTimeIsInRange !== B && !B ? (this.lastBufferStateEvent = "drained", this.emitter.emit("buffer state event", this.lastBufferStateEvent)) : B && C && this.lastBufferStateEvent === "drained" && (this.lastBufferStateEvent = "filled", this.emitter.emit("buffer state event", this.lastBufferStateEvent)), a === "playing" && !this.firstFrameTime && (this.firstFrameTime = Date.now()), this.currentTimeIsInRange = B, this.state = a, this.bufferFullness = B ? Q : 0, E !== a && this.emitter.emit("playback state", a), this.emitter.emit("buffer fullness", this.bufferFullness);
10386
10394
  });
10387
10395
  I(this, "onNeedsUserInput", ({ forAudio: A, forVideo: t }) => {
10388
10396
  A && this.needsInputForAudioCount++, t && this.needsInputForVideoCount++;
@@ -11936,7 +11944,7 @@ const Ht = class Ht extends At {
11936
11944
  const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
11937
11945
  return w({
11938
11946
  uptime: Date.now() - this.createdAt,
11939
- version: "4.1.8-5-gfb5ffadf",
11947
+ version: "4.1.8-6-g43df7939",
11940
11948
  clientId: this.clientId,
11941
11949
  sessionId: this.sessionId,
11942
11950
  channelId: this.channelId,