@vindral/web-sdk 4.2.0-7-g7d6ca07f → 4.2.0-9-g20d8006e

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/react.d.ts CHANGED
@@ -1163,6 +1163,14 @@ declare class Vindral extends Emitter<PublicVindralEvents> {
1163
1163
  * setting targetBufferTime within that range for consistancy if using both min/max.
1164
1164
  */
1165
1165
  set targetBufferTime(bufferTimeMs: number);
1166
+ /**
1167
+ * Update the dynamic buffer time configuration at runtime.
1168
+ * Allows adjusting min and max buffer time without recreating the Vindral instance.
1169
+ */
1170
+ updateBufferTimeConfig(config: {
1171
+ minBufferTime?: number;
1172
+ maxBufferTime?: number;
1173
+ }): void;
1166
1174
  /**
1167
1175
  * The estimated playback latency based on target buffer time, the connection rtt and local playback drift
1168
1176
  */
@@ -1841,7 +1849,7 @@ type ControllerAttributes = (typeof Controller.observedAttributes)[number];
1841
1849
  declare class Controller extends HTMLElement {
1842
1850
  #private;
1843
1851
  static observedAttributes: readonly [
1844
- ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src")[],
1852
+ ...("language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "debug-panel-open" | "target-buffer-time" | "drift" | "playback-latency" | "connection-state")[],
1845
1853
  "url",
1846
1854
  "edge-url",
1847
1855
  "target-buffer-time",
@@ -1964,7 +1972,7 @@ declare class PlayButton extends VindralButton {
1964
1972
  type PlayerAttributes = (typeof Player.observedAttributes)[number];
1965
1973
  declare class Player extends HTMLElement {
1966
1974
  #private;
1967
- static observedAttributes: readonly ("title" | "offline" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "url" | "decoders" | "edge-url" | "target-buffer-time" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "min-buffer-time" | "max-buffer-time" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "stream-to-media-element-enabled" | "ios-media-element-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "webcodecs-hardware-acceleration" | "offscreen-canvas-enabled" | "reconnect-retries" | "auto-instance-enabled" | "advanced-rendition-menu-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1975
+ static observedAttributes: readonly ("title" | "offline" | "advanced" | "poster" | "language" | "channels" | "buffering" | "paused" | "volume" | "muted" | "duration" | "user-interacting" | "is-casting" | "cast-available" | "cast-receiver-name" | "ui-locked" | "hide-ui-on-pause" | "is-fullscreen" | "is-fullscreen-fallback" | "rendition-levels" | "rendition-level" | "max-video-bit-rate" | "max-initial-bit-rate" | "abr-enabled" | "size-based-resolution-cap-enabled" | "channel-id" | "channel-group-id" | "pip-available" | "is-pip" | "airplay-available" | "is-airplaying" | "media" | "languages" | "text-tracks" | "text-track" | "needs-user-input-video" | "needs-user-input-audio" | "authentication-token" | "volume-level" | "cast" | "airplay" | "pip" | "fullscreen" | "vu-meter" | "timeshift" | "timeshift-position" | "poster-src" | "debug-panel-open" | "target-buffer-time" | "drift" | "playback-latency" | "connection-state" | "url" | "decoders" | "min-buffer-time" | "max-buffer-time" | "edge-url" | "cast-receiver-id" | "cast-background" | "log-level" | "max-size" | "max-audio-bit-rate" | "burst-enabled" | "mse-enabled" | "mse-opus-enabled" | "ios-background-play-enabled" | "ios-wake-lock-enabled" | "stream-to-media-element-enabled" | "ios-media-element-enabled" | "telemetry-enabled" | "video-codecs" | "drm-headers" | "drm-queryparams" | "drm-widevine-video-robustness" | "drm-widevine-audio-robustness" | "drm-playready-video-robustness" | "drm-playready-audio-robustness" | "webtransport-enabled" | "webcodecs-hardware-acceleration" | "offscreen-canvas-enabled" | "reconnect-retries" | "auto-instance-enabled" | "advanced-rendition-menu-enabled" | "refresh-poster-enabled" | "stream-poll-enabled")[];
1968
1976
  constructor();
1969
1977
  connectedCallback(): void;
1970
1978
  disconnectedCallback(): void;
@@ -1,5 +1,5 @@
1
- import "./D4BVrOMF.js";
2
- import { t as e } from "./CnCQ_flD.js";
1
+ import "./qbVRZqFN.js";
2
+ import { t as e } from "./Cv0Lr_8z.js";
3
3
  //#region src/vindral-player-component.ts
4
4
  e();
5
5
  //#endregion
package/wVqDCoXH.js ADDED
@@ -0,0 +1,223 @@
1
+ import { n as e } from "./BsfwXDui.js";
2
+ import { a as t, n, r } from "./B7hT-BKr.js";
3
+ //#region ../../libs/utils/src/formatting.ts
4
+ var i = 1e3, a = i * 1e3, o = a * 1e3, s = (e, t, n) => e % t === 0 ? e / t : (e / t).toFixed(n), c = (e, t = 1) => e >= o ? `${s(e, o, t)} Gbit/s` : e >= a ? `${s(e, a, t)} Mbit/s` : e >= i ? `${s(e, i, t)} Kbit/s` : `${e} bit/s`, l = ({ width: e, height: t }) => `${e}x${t}`, u = {
5
+ PAUSED: "paused",
6
+ MUTED: "muted",
7
+ USER_INTERACTING: "user-interacting",
8
+ IS_CASTING: "is-casting",
9
+ CAST_AVAILABLE: "cast-available",
10
+ CAST_RECEIVER_NAME: "cast-receiver-name",
11
+ BUFFERING: "buffering",
12
+ UI_LOCKED: "ui-locked",
13
+ HIDE_UI_ON_PAUSE: "hide-ui-on-pause",
14
+ FULLSCREEN: "is-fullscreen",
15
+ FULLSCREEN_FALLBACK: "is-fullscreen-fallback",
16
+ RENDITION_LEVELS: "rendition-levels",
17
+ RENDITION_LEVEL: "rendition-level",
18
+ MAX_VIDEO_BITRATE: "max-video-bit-rate",
19
+ MAX_INITIAL_BITRATE: "max-initial-bit-rate",
20
+ ABR_ENABLED: "abr-enabled",
21
+ SIZE_BASED_RESOLUTION_CAP_ENABLED: "size-based-resolution-cap-enabled",
22
+ CHANNELS: "channels",
23
+ CHANNEL_ID: "channel-id",
24
+ CHANNEL_GROUP_ID: "channel-group-id",
25
+ PIP_AVAILABLE: "pip-available",
26
+ IS_PIP: "is-pip",
27
+ AIRPLAY_AVAILABLE: "airplay-available",
28
+ IS_AIRPLAYING: "is-airplaying",
29
+ MEDIA: "media",
30
+ LANGUAGES: "languages",
31
+ LANGUAGE: "language",
32
+ TEXT_TRACKS: "text-tracks",
33
+ TEXT_TRACK: "text-track",
34
+ NEEDS_USER_INPUT_VIDEO: "needs-user-input-video",
35
+ NEEDS_USER_INPUT_AUDIO: "needs-user-input-audio",
36
+ AUTHENTICATION_TOKEN: "authentication-token",
37
+ VOLUME: "volume",
38
+ VOLUME_LEVEL: "volume-level",
39
+ CAST_ENABLED: "cast",
40
+ AIRPLAY_ENABLED: "airplay",
41
+ PIP_ENABLED: "pip",
42
+ FULLSCREEN_ENABLED: "fullscreen",
43
+ VU_METER_ENABLED: "vu-meter",
44
+ TIMESHIFT_ENABLED: "timeshift",
45
+ TIMESHIFT_POSITION: "timeshift-position",
46
+ POSTER_SRC: "poster-src",
47
+ DURATION: "duration",
48
+ DEBUG_PANEL_OPEN: "debug-panel-open",
49
+ TARGET_BUFFER_TIME: "target-buffer-time",
50
+ DRIFT: "drift",
51
+ PLAYBACK_LATENCY: "playback-latency",
52
+ CONNECTION_STATE: "connection-state"
53
+ }, d = Object.values(u), f = {
54
+ PLAY: "play",
55
+ PAUSE: "pause",
56
+ MUTE: "mute",
57
+ UNMUTE: "unmute",
58
+ LOCK_UI: "lock-ui",
59
+ UNLOCK_UI: "unlock-ui",
60
+ ENTER_FULLSCREEN: "enter-fullscreen",
61
+ EXIT_FULLSCREEN: "exit-fullscreen",
62
+ SET_RENDITION: "set-rendition",
63
+ SET_ABR_MODE: "set-abr-mode",
64
+ SET_SIZE_BASED_RESOLUTION_CAP_MODE: "set-size-based-resolution-cap-mode",
65
+ CHANNEL_GRID_OPENED: "channel-grid-opened",
66
+ CHANNEL_GRID_CLOSED: "channel-grid-closed",
67
+ ENTER_PIP: "enter-pip",
68
+ EXIT_PIP: "exit-pip",
69
+ REQUEST_AIRPLAY: "request-airplay",
70
+ SET_LANGUAGE: "set-language",
71
+ SET_TEXT_TRACK: "set-text-track",
72
+ REQUEST_USER_INPUT: "request-user-input",
73
+ SET_VOLUME: "set-volume",
74
+ SEEK: "seek",
75
+ GO_LIVE: "go-live",
76
+ TOGGLE_DEBUG_PANEL: "toggle-debug-panel",
77
+ SET_TARGET_BUFFER_TIME: "set-target-buffer-time"
78
+ };
79
+ //#endregion
80
+ //#region ../../libs/player-next/src/utils/vindralAttributesUtils.ts
81
+ function p(e) {
82
+ return e === "audio" || e === "video" || e === "audio+video" ? e : "audio+video";
83
+ }
84
+ function m(e) {
85
+ return e === "trace" || e === "debug" || e === "info" || e === "warn" || e === "error" || e === "off" ? e : "off";
86
+ }
87
+ function h(e) {
88
+ if (e === null) return;
89
+ let t = e.split(",").map((e) => e.trim()).filter((e) => e === "h264" || e === "av1");
90
+ if (t.length !== 0) return t;
91
+ }
92
+ function g(e) {
93
+ if (e !== null) try {
94
+ let t = JSON.parse(e);
95
+ if (typeof t == "object" && t) {
96
+ let e = t;
97
+ if (typeof e.width == "number" && typeof e.height == "number") return e;
98
+ }
99
+ } catch (e) {
100
+ return;
101
+ }
102
+ }
103
+ function _(e) {
104
+ if (e !== null) try {
105
+ let t = JSON.parse(e);
106
+ if (typeof t == "object" && t) return t;
107
+ } catch (e) {
108
+ return;
109
+ }
110
+ }
111
+ function v(e) {
112
+ if (e === null) return;
113
+ let t = parseFloat(e);
114
+ return isNaN(t) ? void 0 : t;
115
+ }
116
+ function y(e) {
117
+ return typeof e == "string";
118
+ }
119
+ function b(e, t) {
120
+ if (e === null) return t == null ? void 0 : t;
121
+ let n = e.toLowerCase();
122
+ return n === "false" ? !1 : n === "true" || n === "" || t == null ? !0 : t;
123
+ }
124
+ function x(e, t) {
125
+ return e === null ? t == null ? void 0 : t : e === "" || e.toLowerCase() === "true" ? !0 : e.toLowerCase() === "false" ? !1 : e;
126
+ }
127
+ function S(e) {
128
+ if (e === null) return;
129
+ let t = {}, n = e.split(",");
130
+ for (let e of n) {
131
+ let [n, r] = e.split(":");
132
+ n && r && (t[n.trim()] = r.trim());
133
+ }
134
+ return Object.keys(t).length > 0 ? t : void 0;
135
+ }
136
+ function C(e) {
137
+ if (e === null) return;
138
+ let t = e.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
139
+ return t.length > 0 ? t : void 0;
140
+ }
141
+ //#endregion
142
+ //#region ../../libs/player-next/src/components/VindralButton.ts
143
+ var w = document.createElement("template");
144
+ w.innerHTML = "\n <style>\n :host {\n cursor: pointer;\n color: var(--fg-strong);\n padding: var(--button-padding);\n background: transparent;\n transition: background 0.2s linear;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host(:focus-visible) {\n box-shadow: inset 0 0 0 2px var(--fg-strong);\n outline: 0;\n }\n\n :host(:where(:focus)) {\n box-shadow: none;\n outline: 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n :host(:hover) {\n background: rgba(255, 255, 255, 0.15);\n }\n }\n\n :host(:active) {\n background: rgba(255, 255, 255, 0.25);\n }\n\n :host(:active) svg {\n scale: 0.9;\n }\n\n :host([disabled]) {\n opacity: 0.5;\n background: transparent;\n }\n\n slot > svg {\n display: block;\n width: var(--button-icon-size);\n height: var(--button-icon-size);\n }\n </style>\n";
145
+ var T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap(), k = class extends HTMLElement {
146
+ constructor() {
147
+ super(), t(this, T, null), t(this, E, (e) => {
148
+ this.handleClick(e);
149
+ }), t(this, D, (e) => {
150
+ let { key: t } = e;
151
+ if (!this.keysUsed.includes(t)) {
152
+ this.removeEventListener("keyup", n(D, this));
153
+ return;
154
+ }
155
+ this.handleClick(e);
156
+ }), t(this, O, (e) => {
157
+ let { metaKey: t, altKey: r, key: i } = e;
158
+ if (t || r || !this.keysUsed.includes(i)) {
159
+ this.removeEventListener("keyup", n(D, this));
160
+ return;
161
+ }
162
+ this.addEventListener("keyup", n(D, this), { once: !0 });
163
+ }), this.attachShadow({ mode: "open" }).appendChild(w.content.cloneNode(!0));
164
+ }
165
+ get keysUsed() {
166
+ return ["Enter", " "];
167
+ }
168
+ connectedCallback() {
169
+ var e;
170
+ r(T, this, this.closest("vindral-controller")), (e = n(T, this)) == null || e.connectListener(this), this.hasAttribute("disabled") || this.enable(), this.setAttribute("role", "button");
171
+ }
172
+ enable() {
173
+ this.addEventListener("click", n(E, this)), this.addEventListener("keydown", n(O, this)), this.tabIndex = 0;
174
+ }
175
+ disable() {
176
+ this.removeEventListener("click", n(E, this)), this.removeEventListener("keydown", n(O, this)), this.removeEventListener("keyup", n(D, this)), this.tabIndex = -1;
177
+ }
178
+ disconnectedCallback() {
179
+ var e;
180
+ (e = n(T, this)) == null || e.disconnectListener(this);
181
+ }
182
+ attributeChangedCallback(e, t, n) {
183
+ e === "disabled" && (y(n) ? this.disable() : this.enable());
184
+ }
185
+ };
186
+ e(k, "observedAttributes", ["disabled"]);
187
+ //#endregion
188
+ //#region \0@oxc-project+runtime@0.115.0/helpers/getPrototypeOf.js
189
+ function A(e) {
190
+ return A = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
191
+ return e.__proto__ || Object.getPrototypeOf(e);
192
+ }, A(e);
193
+ }
194
+ //#endregion
195
+ //#region \0@oxc-project+runtime@0.115.0/helpers/superPropBase.js
196
+ function j(e, t) {
197
+ for (; !{}.hasOwnProperty.call(e, t) && (e = A(e)) !== null;);
198
+ return e;
199
+ }
200
+ //#endregion
201
+ //#region \0@oxc-project+runtime@0.115.0/helpers/get.js
202
+ function M() {
203
+ return M = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(e, t, n) {
204
+ var r = j(e, t);
205
+ if (r) {
206
+ var i = Object.getOwnPropertyDescriptor(r, t);
207
+ return i.get ? i.get.call(arguments.length < 3 ? e : n) : i.value;
208
+ }
209
+ }, M.apply(null, arguments);
210
+ }
211
+ //#endregion
212
+ //#region \0@oxc-project+runtime@0.115.0/helpers/superPropGet.js
213
+ function N(e, t, n, r) {
214
+ var i = M(A(1 & r ? e.prototype : e), t, n);
215
+ return 2 & r && typeof i == "function" ? function(e) {
216
+ return i.apply(n, e);
217
+ } : i;
218
+ }
219
+ //#endregion
220
+ //#region ../../libs/player-next/src/constants.ts
221
+ var P = 5e3;
222
+ //#endregion
223
+ export { d as _, _ as a, m as c, p as d, v as f, u as g, f as h, y as i, S as l, h as m, N as n, b as o, C as p, k as r, x as s, P as t, g as u, c as v, l as y };