@vindral/web-sdk 4.1.2 → 4.1.3

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.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.1.2",
2
+ "version": "4.1.3",
3
3
  "name": "@vindral/web-sdk",
4
4
  "main": "./legacy.umd.js",
5
5
  "module": "./legacy.es.js",
package/player.d.ts CHANGED
@@ -995,11 +995,20 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
995
995
  */
996
996
  get channelCurrentTime(): number;
997
997
  /**
998
- * The current target buffer time in milliseconds
998
+ * The current target buffer time in milliseconds.
999
+ *
1000
+ * Initially, this will always be equal to `minBufferTime`.
1001
+ * Only when using a separate `maxBufferTime`, the `targetBufferTime` will be able to vary between min and max.
1002
+ *
999
1003
  */
1000
1004
  get targetBufferTime(): number;
1001
1005
  /**
1002
- * Set the current target buffer time in milliseconds
1006
+ * Set the current target buffer time in milliseconds.
1007
+ *
1008
+ * Note that setting this will not respect min/max buffer time values.
1009
+ * For instance with `{ minBufferTime: 500, maxBufferTime: 3000 }, you can still set `targetBufferTime` to 100 ms.`
1010
+ * The dynamic buffer will still work in respect to the originally set values when needed. Therefore we recommend
1011
+ * setting targetBufferTime within that range for consistancy if using both min/max.
1003
1012
  */
1004
1013
  set targetBufferTime(bufferTimeMs: number);
1005
1014
  /**
package/player.js CHANGED
@@ -24,10 +24,10 @@ var G = (d, a, t) => new Promise((i, s) => {
24
24
  }, u = (v) => v.done ? i(v.value) : Promise.resolve(v.value).then(o, p);
25
25
  u((t = t.apply(d, a)).next());
26
26
  });
27
- import { L as jr, V as Vr, i as Yr, A as Jr, C as Qr, a as Wr } from "./ZD9OGvpf.js";
27
+ import { L as jr, V as Vr, i as Yr, A as Jr, C as Qr, a as Wr } from "./DykhWWFG.js";
28
28
  import { E as li } from "./Bx7s5QdT.js";
29
29
  import { CastSender as Zr } from "./cast-sender.js";
30
- import { A as to, d as eo } from "./hRzek83o.js";
30
+ import { A as to, d as eo } from "./Bs3ZbgIy.js";
31
31
  const Xi = 1e3, ji = Xi * 1e3, $s = ji * 1e3, Bi = (d, a, t) => d % a === 0 ? d / a : (d / a).toFixed(t), io = (d, a = 1) => d >= $s ? `${Bi(d, $s, a)} Gbit/s` : d >= ji ? `${Bi(d, ji, a)} Mbit/s` : d >= Xi ? `${Bi(d, Xi, a)} Kbit/s` : `${d} bit/s`, so = ({ width: d, height: a }) => `${d}x${a}`, no = ({
32
32
  title: d,
33
33
  subTitle: a = "Live stream",
@@ -1247,7 +1247,7 @@ class uo extends li {
1247
1247
  l(this, Li, () => G(this, null, function* () {
1248
1248
  yield this.element.requestPictureInPicture();
1249
1249
  }));
1250
- l(this, Ti, () => G(this, null, function* () {
1250
+ l(this, Ti, () => G(null, null, function* () {
1251
1251
  yield document.exitPictureInPicture();
1252
1252
  }));
1253
1253
  l(this, Yt, () => !!this.element.requestPictureInPicture && !!document.pictureInPictureEnabled);
@@ -1617,17 +1617,20 @@ Sn.innerHTML = /* HTML */
1617
1617
  right: 0;
1618
1618
  transition: opacity 0.5s;
1619
1619
  user-select: none;
1620
- pointer-events: auto;
1621
-
1622
- // Ensure the #ui element is above the video element on Safari
1623
- z-index: 1;
1620
+ pointer-events: none;
1624
1621
  }
1625
1622
 
1626
1623
  #ui > * {
1627
- pointer-events: auto;
1628
1624
  display: var(--ui-display);
1629
1625
  }
1630
1626
 
1627
+ #ui > slot::slotted(*) {
1628
+ pointer-events: auto;
1629
+ z-index: 10;
1630
+ // Ensure the #ui element is above the video element on Safari
1631
+ // and that we can layer things under, between, and above ui and video
1632
+ }
1633
+
1631
1634
  #video {
1632
1635
  cursor: none;
1633
1636
  display: flex;
@@ -1635,6 +1638,10 @@ Sn.innerHTML = /* HTML */
1635
1638
  z-index: 0;
1636
1639
  }
1637
1640
 
1641
+ :host([user-interacting]) #video {
1642
+ cursor: auto;
1643
+ }
1644
+
1638
1645
  #video > canvas {
1639
1646
  object-fit: contain;
1640
1647
  }
@@ -1645,12 +1652,11 @@ Sn.innerHTML = /* HTML */
1645
1652
  flex-grow: 1;
1646
1653
  }
1647
1654
 
1648
- slot#top-bar {
1655
+ #top-bar::slotted(*) {
1649
1656
  background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
1650
1657
  padding: var(--control-padding);
1651
1658
  }
1652
-
1653
- slot#bottom-bar {
1659
+ #bottom-bar::slotted(*) {
1654
1660
  padding: var(--control-padding);
1655
1661
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
1656
1662
  }
@@ -2838,7 +2844,7 @@ class wo extends li {
2838
2844
  }
2839
2845
  start(t = 5e3) {
2840
2846
  e(this, lt) && clearInterval(e(this, lt)), c(this, At, !1), c(this, Pt, !1), r(this, H, ys).call(this), r(this, H, Es).call(this), c(this, lt, window.setInterval(() => {
2841
- !e(this, Pt) && !e(this, se).infiniteReconnect && !e(this, kt) && e(this, yt) && c(this, kt, window.setTimeout(() => r(this, H, sr).call(this), 5 * 60 * 1e3)), !e(this, Pt) && e(this, yt) && r(this, H, Es).call(this);
2847
+ !e(this, Pt) && !e(this, se).infiniteReconnect && !e(this, kt) && e(this, yt) && c(this, kt, window.setTimeout(() => r(this, H, sr).call(this), 300 * 1e3)), !e(this, Pt) && e(this, yt) && r(this, H, Es).call(this);
2842
2848
  }, t));
2843
2849
  }
2844
2850
  stop() {
@@ -2913,6 +2919,11 @@ const Io = new RegExp(
2913
2919
  }
2914
2920
  }
2915
2921
 
2922
+ vindral-scroll-overlay {
2923
+ z-index: 20;
2924
+ // needs to be higher than bottom bar/UI
2925
+ }
2926
+
2916
2927
  :host([${X.OFFLINE}]) {
2917
2928
  aspect-ratio: 16 / 9;
2918
2929
  vindral-controller {
@@ -3531,6 +3542,7 @@ Er.innerHTML = /* HTML */
3531
3542
  pointer-events: auto;
3532
3543
  scroll-snap-align: start;
3533
3544
  min-height: 1px;
3545
+ -webkit-tap-highlight-color: transparent;
3534
3546
  }
3535
3547
 
3536
3548
  slot#content {
package/react.d.ts CHANGED
@@ -997,11 +997,20 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
997
997
  */
998
998
  get channelCurrentTime(): number;
999
999
  /**
1000
- * The current target buffer time in milliseconds
1000
+ * The current target buffer time in milliseconds.
1001
+ *
1002
+ * Initially, this will always be equal to `minBufferTime`.
1003
+ * Only when using a separate `maxBufferTime`, the `targetBufferTime` will be able to vary between min and max.
1004
+ *
1001
1005
  */
1002
1006
  get targetBufferTime(): number;
1003
1007
  /**
1004
- * Set the current target buffer time in milliseconds
1008
+ * Set the current target buffer time in milliseconds.
1009
+ *
1010
+ * Note that setting this will not respect min/max buffer time values.
1011
+ * For instance with `{ minBufferTime: 500, maxBufferTime: 3000 }, you can still set `targetBufferTime` to 100 ms.`
1012
+ * The dynamic buffer will still work in respect to the originally set values when needed. Therefore we recommend
1013
+ * setting targetBufferTime within that range for consistancy if using both min/max.
1005
1014
  */
1006
1015
  set targetBufferTime(bufferTimeMs: number);
1007
1016
  /**
@@ -27,10 +27,10 @@ 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 "./ZD9OGvpf.js";
31
- var hA = function() {
30
+ import { F as RA, d as JA, n as kA } from "./DykhWWFG.js";
31
+ var hA = (function() {
32
32
  var B = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0;
33
- return function(g) {
33
+ return (function(g) {
34
34
  g = g || {};
35
35
  var A;
36
36
  A || (A = typeof g != "undefined" ? g : {});
@@ -175,7 +175,7 @@ var hA = function() {
175
175
  } catch (Q) {
176
176
  return S("Module.instantiateWasm callback failed with error: " + Q), !1;
177
177
  }
178
- return function() {
178
+ return (function() {
179
179
  return L || typeof WebAssembly.instantiateStreaming != "function" || V(s) || typeof fetch != "function" ? i(C) : fetch(s, { credentials: "same-origin" }).then(function(Q) {
180
180
  return WebAssembly.instantiateStreaming(Q, G).then(
181
181
  C,
@@ -184,7 +184,7 @@ var hA = function() {
184
184
  }
185
185
  );
186
186
  });
187
- }().catch(k), {};
187
+ })().catch(k), {};
188
188
  })(), A.___wasm_call_ctors = function() {
189
189
  return (A.___wasm_call_ctors = A.asm.h).apply(null, arguments);
190
190
  }, A._opus_decoder_create = function() {
@@ -223,8 +223,8 @@ var hA = function() {
223
223
  }
224
224
  if (A.run = l, A.preInit) for (typeof A.preInit == "function" && (A.preInit = [A.preInit]); 0 < A.preInit.length; ) A.preInit.pop()();
225
225
  return l(), g.ready;
226
- };
227
- }(), QA = /* @__PURE__ */ ((B) => (B[B.OK = 0] = "OK", B[B["Bad argument"] = -1] = "Bad argument", B[B["Buffer too small"] = -2] = "Buffer too small", B[B["Internal error"] = -3] = "Internal error", B[B["Invalid packet"] = -4] = "Invalid packet", B[B.Unimplemented = -5] = "Unimplemented", B[B["Invalid state"] = -6] = "Invalid state", B[B["Memory allocation fail"] = -7] = "Memory allocation fail", B))(QA || {});
226
+ });
227
+ })(), QA = /* @__PURE__ */ ((B) => (B[B.OK = 0] = "OK", B[B["Bad argument"] = -1] = "Bad argument", B[B["Buffer too small"] = -2] = "Buffer too small", B[B["Internal error"] = -3] = "Internal error", B[B["Invalid packet"] = -4] = "Invalid packet", B[B.Unimplemented = -5] = "Unimplemented", B[B["Invalid state"] = -6] = "Invalid state", B[B["Memory allocation fail"] = -7] = "Memory allocation fail", B))(QA || {});
228
228
  const w = class w {
229
229
  constructor(g, A, J) {
230
230
  // = 120ms
@@ -265,7 +265,7 @@ const w = class w {
265
265
  );
266
266
  }
267
267
  };
268
- E(w, "MAX_OPUS_BUFFER", 1e3 * 1e3), E(w, "MAX_SAMPLES", 6 * 960), E(w, "create", (g, A) => X(w, null, function* () {
268
+ E(w, "MAX_OPUS_BUFFER", 1e3 * 1e3), E(w, "MAX_SAMPLES", 6 * 960), E(w, "create", (g, A) => X(null, null, function* () {
269
269
  return new w(yield hA(), g, A);
270
270
  }));
271
271
  let m = w;
@@ -303,7 +303,7 @@ const d = class d {
303
303
  return this.errors.pop();
304
304
  }
305
305
  };
306
- E(d, "create", (g, A) => X(d, null, function* () {
306
+ E(d, "create", (g, A) => X(null, null, function* () {
307
307
  return new d(yield m.create(g, A));
308
308
  }));
309
309
  let BA = d;