@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260603061415 → 0.8.1-dev.20260604041835

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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  HlsPlayer_default
4
- } from "./chunk-GG2OSSQZ.mjs";
4
+ } from "./chunk-DPFBQY2N.mjs";
5
5
  export {
6
6
  HlsPlayer_default as default
7
7
  };
@@ -51,6 +51,7 @@ var HlsPlayer = React.memo(
51
51
  const [isPosterVisible, setIsPosterVisible] = useState(true);
52
52
  const [isMuted, setIsMuted] = useState(startsMuted);
53
53
  const [isFullscreen, setIsFullscreen] = useState(false);
54
+ const [isBuffering, setIsBuffering] = useState(false);
54
55
  const wasManuallyPausedRef = useRef(false);
55
56
  const inactivityTimerRef = useRef(null);
56
57
  const clickTimerRef = useRef(null);
@@ -163,10 +164,14 @@ var HlsPlayer = React.memo(
163
164
  v.play().catch(console.error).then(() => setIsPlaying(true));
164
165
  }
165
166
  });
167
+ v.addEventListener("playing", () => setIsBuffering(false), { once: true });
168
+ v.addEventListener("error", () => setIsBuffering(false), { once: true });
166
169
  hlsRef.current = hls;
167
170
  } else if (v.canPlayType("application/vnd.apple.mpegurl")) {
168
171
  v.src = chosenSrc;
169
172
  v.load();
173
+ v.addEventListener("playing", () => setIsBuffering(false), { once: true });
174
+ v.addEventListener("error", () => setIsBuffering(false), { once: true });
170
175
  if (autoPlayAfterLoad) {
171
176
  v.play().catch(console.error).then(() => setIsPlaying(true));
172
177
  }
@@ -192,6 +197,7 @@ var HlsPlayer = React.memo(
192
197
  const v = videoRef.current;
193
198
  if (!v) return;
194
199
  if (!hlsInitializedRef.current) {
200
+ setIsBuffering(true);
195
201
  initHls(
196
202
  /* autoPlayAfterLoad */
197
203
  true
@@ -364,7 +370,35 @@ var HlsPlayer = React.memo(
364
370
  transform: scale(1.08);
365
371
  }
366
372
  ` }),
367
- !isPlayOnHover && /* @__PURE__ */ jsx(
373
+ isBuffering && /* @__PURE__ */ jsx(
374
+ "div",
375
+ {
376
+ className: "absolute inset-0 flex items-center justify-center pointer-events-none",
377
+ style: { zIndex: 10 },
378
+ children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
379
+ /* @__PURE__ */ jsx("style", { children: `
380
+ @keyframes hls-bounce {
381
+ 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
382
+ 40% { transform: translateY(-10px); opacity: 1; }
383
+ }
384
+ .hls-dot {
385
+ width: clamp(8px, 1.5vmin, 12px);
386
+ height: clamp(8px, 1.5vmin, 12px);
387
+ border-radius: 50%;
388
+ background: white;
389
+ animation: hls-bounce 1.1s ease-in-out infinite;
390
+ }
391
+ .hls-dot:nth-child(1) { animation-delay: 0s; }
392
+ .hls-dot:nth-child(2) { animation-delay: 0.18s; }
393
+ .hls-dot:nth-child(3) { animation-delay: 0.36s; }
394
+ ` }),
395
+ /* @__PURE__ */ jsx("div", { className: "hls-dot" }),
396
+ /* @__PURE__ */ jsx("div", { className: "hls-dot" }),
397
+ /* @__PURE__ */ jsx("div", { className: "hls-dot" })
398
+ ] })
399
+ }
400
+ ),
401
+ !isPlayOnHover && !isBuffering && /* @__PURE__ */ jsx(
368
402
  "div",
369
403
  {
370
404
  className: "absolute inset-0 flex items-center justify-center pointer-events-none",
package/dist/index.js CHANGED
@@ -215,6 +215,7 @@ var init_HlsPlayer = __esm({
215
215
  const [isPosterVisible, setIsPosterVisible] = (0, import_react4.useState)(true);
216
216
  const [isMuted, setIsMuted] = (0, import_react4.useState)(startsMuted);
217
217
  const [isFullscreen, setIsFullscreen] = (0, import_react4.useState)(false);
218
+ const [isBuffering, setIsBuffering] = (0, import_react4.useState)(false);
218
219
  const wasManuallyPausedRef = (0, import_react4.useRef)(false);
219
220
  const inactivityTimerRef = (0, import_react4.useRef)(null);
220
221
  const clickTimerRef = (0, import_react4.useRef)(null);
@@ -327,10 +328,14 @@ var init_HlsPlayer = __esm({
327
328
  v.play().catch(console.error).then(() => setIsPlaying(true));
328
329
  }
329
330
  });
331
+ v.addEventListener("playing", () => setIsBuffering(false), { once: true });
332
+ v.addEventListener("error", () => setIsBuffering(false), { once: true });
330
333
  hlsRef.current = hls;
331
334
  } else if (v.canPlayType("application/vnd.apple.mpegurl")) {
332
335
  v.src = chosenSrc;
333
336
  v.load();
337
+ v.addEventListener("playing", () => setIsBuffering(false), { once: true });
338
+ v.addEventListener("error", () => setIsBuffering(false), { once: true });
334
339
  if (autoPlayAfterLoad) {
335
340
  v.play().catch(console.error).then(() => setIsPlaying(true));
336
341
  }
@@ -356,6 +361,7 @@ var init_HlsPlayer = __esm({
356
361
  const v = videoRef.current;
357
362
  if (!v) return;
358
363
  if (!hlsInitializedRef.current) {
364
+ setIsBuffering(true);
359
365
  initHls(
360
366
  /* autoPlayAfterLoad */
361
367
  true
@@ -528,7 +534,35 @@ var init_HlsPlayer = __esm({
528
534
  transform: scale(1.08);
529
535
  }
530
536
  ` }),
531
- !isPlayOnHover && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
537
+ isBuffering && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
538
+ "div",
539
+ {
540
+ className: "absolute inset-0 flex items-center justify-center pointer-events-none",
541
+ style: { zIndex: 10 },
542
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
543
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("style", { children: `
544
+ @keyframes hls-bounce {
545
+ 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
546
+ 40% { transform: translateY(-10px); opacity: 1; }
547
+ }
548
+ .hls-dot {
549
+ width: clamp(8px, 1.5vmin, 12px);
550
+ height: clamp(8px, 1.5vmin, 12px);
551
+ border-radius: 50%;
552
+ background: white;
553
+ animation: hls-bounce 1.1s ease-in-out infinite;
554
+ }
555
+ .hls-dot:nth-child(1) { animation-delay: 0s; }
556
+ .hls-dot:nth-child(2) { animation-delay: 0.18s; }
557
+ .hls-dot:nth-child(3) { animation-delay: 0.36s; }
558
+ ` }),
559
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hls-dot" }),
560
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hls-dot" }),
561
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "hls-dot" })
562
+ ] })
563
+ }
564
+ ),
565
+ !isPlayOnHover && !isBuffering && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
532
566
  "div",
533
567
  {
534
568
  className: "absolute inset-0 flex items-center justify-center pointer-events-none",
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HlsPlayer_default
3
- } from "./chunk-GG2OSSQZ.mjs";
3
+ } from "./chunk-DPFBQY2N.mjs";
4
4
  import {
5
5
  Button_default,
6
6
  ClientButton_default,
@@ -2055,7 +2055,7 @@ import React30 from "react";
2055
2055
  // src/components/pageRenderingEngine/nodes/ImageNode.tsx
2056
2056
  import dynamic3 from "next/dynamic";
2057
2057
  import { jsx as jsx39 } from "react/jsx-runtime";
2058
- var HlsPlayer = dynamic3(() => import("./HlsPlayer-TJGNEU53.mjs"), { ssr: false });
2058
+ var HlsPlayer = dynamic3(() => import("./HlsPlayer-JXH6KK7T.mjs"), { ssr: false });
2059
2059
  var getNestedValue = (obj, path) => {
2060
2060
  if (!obj || !path) return void 0;
2061
2061
  return path.split(".").reduce((current, key) => {
@@ -3715,7 +3715,7 @@ var Pagination_default = Pagination;
3715
3715
  // src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
3716
3716
  import dynamic7 from "next/dynamic";
3717
3717
  import { Fragment as Fragment7, jsx as jsx58, jsxs as jsxs31 } from "react/jsx-runtime";
3718
- var HlsPlayer2 = dynamic7(() => import("./HlsPlayer-TJGNEU53.mjs"), { ssr: false });
3718
+ var HlsPlayer2 = dynamic7(() => import("./HlsPlayer-JXH6KK7T.mjs"), { ssr: false });
3719
3719
  var deviceToMediaQuery = (device) => {
3720
3720
  switch (device) {
3721
3721
  case "sm":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acoustte-digital-services/digitalstore-controls-dev",
3
- "version": "0.8.1-dev.20260603061415",
3
+ "version": "0.8.1-dev.20260604041835",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",