softbuilders-react-video-player 1.2.17 → 1.2.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/dist/components/BigPlayButton/index.d.ts +2 -1
  2. package/dist/components/BigPlayButton/index.js +4 -4
  3. package/dist/components/BigPlayButton/index.js.map +1 -1
  4. package/dist/components/BigPlayButton/index.tsx +13 -5
  5. package/dist/components/ControlBar/index.js +7 -7
  6. package/dist/components/ControlBar/index.js.map +1 -1
  7. package/dist/components/ControlBar/index.tsx +40 -41
  8. package/dist/components/Slider/index.d.ts +3 -1
  9. package/dist/components/Slider/index.js +9 -3
  10. package/dist/components/Slider/index.js.map +1 -1
  11. package/dist/components/Slider/index.tsx +13 -2
  12. package/dist/components/SoftBuildersVideoPlayer/index.js +2 -1
  13. package/dist/components/SoftBuildersVideoPlayer/index.js.map +1 -1
  14. package/dist/components/SoftBuildersVideoPlayer/index.tsx +2 -1
  15. package/dist/components/TimeSlider/index.js +25 -10
  16. package/dist/components/TimeSlider/index.js.map +1 -1
  17. package/dist/components/TimeSlider/index.tsx +27 -11
  18. package/dist/components/VideoPlayerComponent/index.js +26 -4
  19. package/dist/components/VideoPlayerComponent/index.js.map +1 -1
  20. package/dist/components/VideoPlayerComponent/index.tsx +35 -4
  21. package/dist/components/VideoPlayerComponent/style/style.css +17 -1
  22. package/dist/components/VolumeSlider/index.js +36 -3
  23. package/dist/components/VolumeSlider/index.js.map +1 -1
  24. package/dist/components/VolumeSlider/index.tsx +38 -2
  25. package/dist/components/icons/SkillamiIcon.d.ts +3 -0
  26. package/dist/components/icons/SkillamiIcon.js +4 -0
  27. package/dist/components/icons/SkillamiIcon.js.map +1 -0
  28. package/dist/components/icons/SkillamiIcon.tsx +25 -0
  29. package/dist/components/icons/index.d.ts +1 -0
  30. package/dist/components/icons/index.js +1 -0
  31. package/dist/components/icons/index.js.map +1 -1
  32. package/dist/components/icons/index.ts +1 -0
  33. package/dist/images/index.d.ts +1 -0
  34. package/dist/images/index.js +1 -0
  35. package/dist/images/index.js.map +1 -1
  36. package/dist/index.css +30 -0
  37. package/dist/index.mjs +318 -209
  38. package/dist/styles/tailwind.css +15 -0
  39. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -166,26 +166,37 @@ var Slider = (_a) => {
166
166
  max = 100,
167
167
  className,
168
168
  handleSliderClick = () => {
169
- }
169
+ },
170
+ setClicked,
171
+ onMouseMove
170
172
  } = _b, rest = __objRest(_b, [
171
173
  "value",
172
174
  "handleValueChange",
173
175
  "min",
174
176
  "max",
175
177
  "className",
176
- "handleSliderClick"
178
+ "handleSliderClick",
179
+ "setClicked",
180
+ "onMouseMove"
177
181
  ]);
178
182
  return /* @__PURE__ */ jsx3(
179
183
  "input",
180
184
  __spreadValues({
181
185
  type: "range",
182
186
  min,
183
- onMouseDown: (e) => e.stopPropagation(),
187
+ onMouseMove: (e) => onMouseMove && onMouseMove(e),
188
+ onMouseDown: (e) => {
189
+ e.stopPropagation();
190
+ setClicked && setClicked(true);
191
+ },
184
192
  onClick: (e) => {
185
193
  e.stopPropagation();
186
194
  handleSliderClick(e);
187
195
  },
188
- onMouseUp: (e) => e.stopPropagation(),
196
+ onMouseUp: (e) => {
197
+ e.stopPropagation();
198
+ setClicked && setClicked(false);
199
+ },
189
200
  max,
190
201
  value,
191
202
  onChange: (e) => {
@@ -422,9 +433,47 @@ var SvgSettingsIcon = (props) => /* @__PURE__ */ jsx15(
422
433
  );
423
434
  var SettingsIcon_default = SvgSettingsIcon;
424
435
 
425
- // src/components/icons/SubIcon.tsx
436
+ // src/components/icons/SkillamiIcon.tsx
426
437
  import { jsx as jsx16, jsxs as jsxs2 } from "react/jsx-runtime";
427
- var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
438
+ var SvgSkillamiIcon = (props) => /* @__PURE__ */ jsxs2(
439
+ "svg",
440
+ __spreadProps(__spreadValues({
441
+ xmlns: "http://www.w3.org/2000/svg",
442
+ fill: "none",
443
+ viewBox: "0 0 45 46",
444
+ width: "1em",
445
+ height: "1em"
446
+ }, props), {
447
+ children: [
448
+ /* @__PURE__ */ jsx16(
449
+ "path",
450
+ {
451
+ fill: "#fff",
452
+ d: "m22.736 37.857-11.924-3.255-3.194-12.153a.99.99 0 0 0-1.213-.714c-.53.145-.843.7-.7 1.236l3.343 12.715a.991.991 0 0 0 .7.714l12.476 3.406a.985.985 0 0 0 1.213-.713 1.01 1.01 0 0 0-.7-1.236M44.733 25.943 39.51 6.074a1 1 0 0 0-.7-.714L19.308.033a.98.98 0 0 0-.957.26L9.389 9.428a1.02 1.02 0 0 0 0 1.428.976.976 0 0 0 1.402 0l8.56-8.717 18.39 5.024 4.93 18.741-8.56 8.724a1.02 1.02 0 0 0 0 1.428.977.977 0 0 0 1.4 0l8.963-9.133c.249-.254.348-.627.256-.975z"
453
+ }
454
+ ),
455
+ /* @__PURE__ */ jsx16(
456
+ "path",
457
+ {
458
+ fill: "#fff",
459
+ d: "m24.323 30.829-7.735-2.113-2.074-7.883a.99.99 0 0 0-1.213-.714c-.53.145-.842.7-.7 1.236l2.223 8.445a.991.991 0 0 0 .7.714l8.287 2.265a.985.985 0 0 0 1.212-.714 1.01 1.01 0 0 0-.7-1.236M15.887 15.86l5.573-5.68 4.278 1.168a.985.985 0 0 0 1.213-.714 1.01 1.01 0 0 0-.7-1.236l-4.83-1.32a.98.98 0 0 0-.957.262l-5.979 6.092a1.02 1.02 0 0 0 0 1.428.977.977 0 0 0 1.402 0M29.206 30.858a.976.976 0 0 0 1.4 0l5.98-6.093c.248-.253.348-.627.255-.975l-1.294-4.921a.99.99 0 0 0-1.213-.715c-.53.145-.843.7-.7 1.236l1.145 4.36-5.574 5.68a1.02 1.02 0 0 0 0 1.428"
460
+ }
461
+ ),
462
+ /* @__PURE__ */ jsx16(
463
+ "path",
464
+ {
465
+ fill: "#F26C21",
466
+ d: "m29.383 36.008-2.99-11 2.745-2.798-1.007-3.83 2.45-2.498 3.76 1.026 3.56-3.628L36.6 8.322l-4.865-1.327-3.56 3.628 1.007 3.831-2.45 2.497-3.76-1.026-2.745 2.799-10.794-3.049-1.007-3.834-4.865-1.327L0 14.142l1.302 4.959 4.865 1.326 2.745-2.798 10.794 3.048 1.007 3.835 3.762 1.025 2.991 11-2.745 2.798 1.302 4.959 4.865 1.326 3.56-3.628-1.302-4.958-3.763-1.03zM32.328 9.25l2.653.725.712 2.704-1.942 1.979-2.653-.725-.712-2.704zM5.573 18.173l-2.653-.725-.711-2.704 1.941-1.979 2.653.725.712 2.704zm16.761 4.686-.71-2.704 1.941-1.979 2.653.725.711 2.704-1.941 1.979zm7.963 20.507-2.653-.725-.711-2.704 1.942-1.979 2.653.725.711 2.704z"
467
+ }
468
+ )
469
+ ]
470
+ })
471
+ );
472
+ var SkillamiIcon_default = SvgSkillamiIcon;
473
+
474
+ // src/components/icons/SubIcon.tsx
475
+ import { jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
476
+ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs3(
428
477
  "svg",
429
478
  __spreadProps(__spreadValues({
430
479
  xmlns: "http://www.w3.org/2000/svg",
@@ -434,7 +483,7 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
434
483
  viewBox: "0 0 15 15"
435
484
  }, props), {
436
485
  children: [
437
- /* @__PURE__ */ jsx16(
486
+ /* @__PURE__ */ jsx17(
438
487
  "path",
439
488
  {
440
489
  stroke: "#D1D5DB",
@@ -444,7 +493,7 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
444
493
  d: "M1.25 7.5c0-2.487 0-3.731.658-4.561q.159-.2.346-.367c.785-.697 1.96-.697 4.309-.697h1.875c2.349 0 3.523 0 4.307.697q.19.168.347.367c.658.83.658 2.074.658 4.561s0 3.731-.658 4.561q-.157.2-.347.367c-.784.697-1.957.697-4.307.697H6.562c-2.349 0-3.523 0-4.308-.697a3 3 0 0 1-.346-.367c-.658-.83-.658-2.073-.658-4.561"
445
494
  }
446
495
  ),
447
- /* @__PURE__ */ jsx16(
496
+ /* @__PURE__ */ jsx17(
448
497
  "path",
449
498
  {
450
499
  stroke: "#D1D5DB",
@@ -460,14 +509,14 @@ var SvgSubIcon = (props) => /* @__PURE__ */ jsxs2(
460
509
  var SubIcon_default = SvgSubIcon;
461
510
 
462
511
  // src/components/icons/SubtitlesIcon.tsx
463
- import { jsx as jsx17, jsxs as jsxs3 } from "react/jsx-runtime";
512
+ import { jsx as jsx18, jsxs as jsxs4 } from "react/jsx-runtime";
464
513
 
465
514
  // src/components/icons/UnmuteIcon.tsx
466
- import { jsx as jsx18 } from "react/jsx-runtime";
515
+ import { jsx as jsx19 } from "react/jsx-runtime";
467
516
 
468
517
  // src/components/icons/VolumeHigh.tsx
469
- import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
470
- var SvgVolumeHigh = (props) => /* @__PURE__ */ jsxs4(
518
+ import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
519
+ var SvgVolumeHigh = (props) => /* @__PURE__ */ jsxs5(
471
520
  "svg",
472
521
  __spreadProps(__spreadValues({
473
522
  xmlns: "http://www.w3.org/2000/svg",
@@ -477,16 +526,16 @@ var SvgVolumeHigh = (props) => /* @__PURE__ */ jsxs4(
477
526
  viewBox: "0 0 512 512"
478
527
  }, props), {
479
528
  children: [
480
- /* @__PURE__ */ jsx19("path", { d: "M264 416.19a23.92 23.92 0 0 1-14.21-4.69l-.66-.51-91.46-75H88a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.65l91.46-75 .66-.51A24 24 0 0 1 288 119.83v272.34a24 24 0 0 1-24 24ZM352 336a16 16 0 0 1-14.29-23.18c9.49-18.9 14.3-38 14.3-56.82 0-19.36-4.66-37.92-14.25-56.73a16 16 0 0 1 28.5-14.54C378.2 208.16 384 231.47 384 256c0 23.83-6 47.78-17.7 71.18A16 16 0 0 1 352 336" }),
481
- /* @__PURE__ */ jsx19("path", { d: "M400 384a16 16 0 0 1-13.87-24C405 327.05 416 299.45 416 256c0-44.12-10.94-71.52-29.83-103.95A16 16 0 0 1 413.83 136C434.92 172.16 448 204.88 448 256c0 50.36-13.06 83.24-34.12 120a16 16 0 0 1-13.88 8" })
529
+ /* @__PURE__ */ jsx20("path", { d: "M264 416.19a23.92 23.92 0 0 1-14.21-4.69l-.66-.51-91.46-75H88a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.65l91.46-75 .66-.51A24 24 0 0 1 288 119.83v272.34a24 24 0 0 1-24 24ZM352 336a16 16 0 0 1-14.29-23.18c9.49-18.9 14.3-38 14.3-56.82 0-19.36-4.66-37.92-14.25-56.73a16 16 0 0 1 28.5-14.54C378.2 208.16 384 231.47 384 256c0 23.83-6 47.78-17.7 71.18A16 16 0 0 1 352 336" }),
530
+ /* @__PURE__ */ jsx20("path", { d: "M400 384a16 16 0 0 1-13.87-24C405 327.05 416 299.45 416 256c0-44.12-10.94-71.52-29.83-103.95A16 16 0 0 1 413.83 136C434.92 172.16 448 204.88 448 256c0 50.36-13.06 83.24-34.12 120a16 16 0 0 1-13.88 8" })
482
531
  ]
483
532
  })
484
533
  );
485
534
  var VolumeHigh_default = SvgVolumeHigh;
486
535
 
487
536
  // src/components/icons/VolumeLow.tsx
488
- import { jsx as jsx20 } from "react/jsx-runtime";
489
- var SvgVolumeLow = (props) => /* @__PURE__ */ jsx20(
537
+ import { jsx as jsx21 } from "react/jsx-runtime";
538
+ var SvgVolumeLow = (props) => /* @__PURE__ */ jsx21(
490
539
  "svg",
491
540
  __spreadProps(__spreadValues({
492
541
  xmlns: "http://www.w3.org/2000/svg",
@@ -495,14 +544,14 @@ var SvgVolumeLow = (props) => /* @__PURE__ */ jsx20(
495
544
  fill: "#fff",
496
545
  viewBox: "0 0 512 512"
497
546
  }, props), {
498
- children: /* @__PURE__ */ jsx20("path", { d: "M296 416.19a23.92 23.92 0 0 1-14.21-4.69l-.66-.51-91.46-75H120a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.65l91.46-75 .66-.51A24 24 0 0 1 320 119.83v272.34a24 24 0 0 1-24 24ZM384 336a16 16 0 0 1-14.29-23.18c9.49-18.9 14.3-38 14.3-56.82 0-19.36-4.66-37.92-14.25-56.73a16 16 0 0 1 28.5-14.54C410.2 208.16 416 231.47 416 256c0 23.83-6 47.78-17.7 71.18A16 16 0 0 1 384 336" })
547
+ children: /* @__PURE__ */ jsx21("path", { d: "M296 416.19a23.92 23.92 0 0 1-14.21-4.69l-.66-.51-91.46-75H120a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.65l91.46-75 .66-.51A24 24 0 0 1 320 119.83v272.34a24 24 0 0 1-24 24ZM384 336a16 16 0 0 1-14.29-23.18c9.49-18.9 14.3-38 14.3-56.82 0-19.36-4.66-37.92-14.25-56.73a16 16 0 0 1 28.5-14.54C410.2 208.16 416 231.47 416 256c0 23.83-6 47.78-17.7 71.18A16 16 0 0 1 384 336" })
499
548
  })
500
549
  );
501
550
  var VolumeLow_default = SvgVolumeLow;
502
551
 
503
552
  // src/components/icons/VolumeMute.tsx
504
- import { jsx as jsx21, jsxs as jsxs5 } from "react/jsx-runtime";
505
- var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs5(
553
+ import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
554
+ var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs6(
506
555
  "svg",
507
556
  __spreadProps(__spreadValues({
508
557
  xmlns: "http://www.w3.org/2000/svg",
@@ -512,7 +561,7 @@ var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs5(
512
561
  viewBox: "0 0 512 512"
513
562
  }, props), {
514
563
  children: [
515
- /* @__PURE__ */ jsx21(
564
+ /* @__PURE__ */ jsx22(
516
565
  "path",
517
566
  {
518
567
  d: "M416 432 64 80",
@@ -525,16 +574,16 @@ var SvgVolumeMute = (props) => /* @__PURE__ */ jsxs5(
525
574
  }
526
575
  }
527
576
  ),
528
- /* @__PURE__ */ jsx21("path", { d: "M243.33 98.86a23.89 23.89 0 0 0-25.55 1.82l-.66.51-28.52 23.35a8 8 0 0 0-.59 11.85l54.33 54.33a8 8 0 0 0 13.66-5.66v-64.49a24.51 24.51 0 0 0-12.67-21.71M251.33 335.29 96.69 180.69A16 16 0 0 0 85.38 176H56a24 24 0 0 0-24 24v112a24 24 0 0 0 24 24h69.76l92 75.31a23.9 23.9 0 0 0 25.87 1.69A24.51 24.51 0 0 0 256 391.45v-44.86a16 16 0 0 0-4.67-11.3M352 256c0-24.56-5.81-47.87-17.75-71.27a16 16 0 1 0-28.5 14.55C315.34 218.06 320 236.62 320 256q0 4-.31 8.13a8 8 0 0 0 2.32 6.25l14.36 14.36a8 8 0 0 0 13.55-4.31A146 146 0 0 0 352 256M416 256c0-51.18-13.08-83.89-34.18-120.06a16 16 0 0 0-27.64 16.12C373.07 184.44 384 211.83 384 256c0 23.83-3.29 42.88-9.37 60.65a8 8 0 0 0 1.9 8.26L389 337.4a8 8 0 0 0 13.13-2.79C411 311.76 416 287.26 416 256" }),
529
- /* @__PURE__ */ jsx21("path", { d: "M480 256c0-74.25-20.19-121.11-50.51-168.61a16 16 0 1 0-27 17.22C429.82 147.38 448 189.5 448 256c0 46.19-8.43 80.27-22.43 110.53a8 8 0 0 0 1.59 9l11.92 11.92a8 8 0 0 0 12.92-2.16C471.6 344.9 480 305 480 256" })
577
+ /* @__PURE__ */ jsx22("path", { d: "M243.33 98.86a23.89 23.89 0 0 0-25.55 1.82l-.66.51-28.52 23.35a8 8 0 0 0-.59 11.85l54.33 54.33a8 8 0 0 0 13.66-5.66v-64.49a24.51 24.51 0 0 0-12.67-21.71M251.33 335.29 96.69 180.69A16 16 0 0 0 85.38 176H56a24 24 0 0 0-24 24v112a24 24 0 0 0 24 24h69.76l92 75.31a23.9 23.9 0 0 0 25.87 1.69A24.51 24.51 0 0 0 256 391.45v-44.86a16 16 0 0 0-4.67-11.3M352 256c0-24.56-5.81-47.87-17.75-71.27a16 16 0 1 0-28.5 14.55C315.34 218.06 320 236.62 320 256q0 4-.31 8.13a8 8 0 0 0 2.32 6.25l14.36 14.36a8 8 0 0 0 13.55-4.31A146 146 0 0 0 352 256M416 256c0-51.18-13.08-83.89-34.18-120.06a16 16 0 0 0-27.64 16.12C373.07 184.44 384 211.83 384 256c0 23.83-3.29 42.88-9.37 60.65a8 8 0 0 0 1.9 8.26L389 337.4a8 8 0 0 0 13.13-2.79C411 311.76 416 287.26 416 256" }),
578
+ /* @__PURE__ */ jsx22("path", { d: "M480 256c0-74.25-20.19-121.11-50.51-168.61a16 16 0 1 0-27 17.22C429.82 147.38 448 189.5 448 256c0 46.19-8.43 80.27-22.43 110.53a8 8 0 0 0 1.59 9l11.92 11.92a8 8 0 0 0 12.92-2.16C471.6 344.9 480 305 480 256" })
530
579
  ]
531
580
  })
532
581
  );
533
582
  var VolumeMute_default = SvgVolumeMute;
534
583
 
535
584
  // src/components/icons/VolumeVLow.tsx
536
- import { jsx as jsx22 } from "react/jsx-runtime";
537
- var SvgVolumeVLow = (props) => /* @__PURE__ */ jsx22(
585
+ import { jsx as jsx23 } from "react/jsx-runtime";
586
+ var SvgVolumeVLow = (props) => /* @__PURE__ */ jsx23(
538
587
  "svg",
539
588
  __spreadProps(__spreadValues({
540
589
  xmlns: "http://www.w3.org/2000/svg",
@@ -543,13 +592,13 @@ var SvgVolumeVLow = (props) => /* @__PURE__ */ jsx22(
543
592
  fill: "#fff",
544
593
  viewBox: "0 0 512 512"
545
594
  }, props), {
546
- children: /* @__PURE__ */ jsx22("path", { d: "M344 416a23.92 23.92 0 0 1-14.21-4.69c-.23-.16-.44-.33-.66-.51l-91.46-74.9H168a24 24 0 0 1-24-24V200.07a24 24 0 0 1 24-24h69.65l91.46-74.9c.22-.18.43-.35.66-.51A24 24 0 0 1 368 120v272a24 24 0 0 1-24 24" })
595
+ children: /* @__PURE__ */ jsx23("path", { d: "M344 416a23.92 23.92 0 0 1-14.21-4.69c-.23-.16-.44-.33-.66-.51l-91.46-74.9H168a24 24 0 0 1-24-24V200.07a24 24 0 0 1 24-24h69.65l91.46-74.9c.22-.18.43-.35.66-.51A24 24 0 0 1 368 120v272a24 24 0 0 1-24 24" })
547
596
  })
548
597
  );
549
598
  var VolumeVLow_default = SvgVolumeVLow;
550
599
 
551
600
  // src/components/VolumeSlider/index.tsx
552
- import { jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
601
+ import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
553
602
  var MIN = 0;
554
603
  var MAX = 100;
555
604
  var VolumeSlider = ({
@@ -562,6 +611,7 @@ var VolumeSlider = ({
562
611
  const { player } = useSoftBuildersVideoPlayerContext();
563
612
  const [isVisible, setVisible] = useState2(false);
564
613
  const [volume, setVolume] = useState2(0);
614
+ const [isClicked, setClicked] = useState2(false);
565
615
  useEffect2(() => {
566
616
  const updateVolumeState = () => {
567
617
  const currentVolume = (player == null ? void 0 : player.muted()) ? 0 : Number((player == null ? void 0 : player.volume()) || 0) * 100;
@@ -577,8 +627,15 @@ var VolumeSlider = ({
577
627
  e.stopPropagation();
578
628
  const slider = e.currentTarget;
579
629
  const rect = slider.getBoundingClientRect();
580
- const offsetX = e.clientY - rect.top;
581
- const newVolume = offsetX / rect.height * 100;
630
+ let offsetX;
631
+ let newVolume;
632
+ if (!isTrailer && width > 400) {
633
+ offsetX = e.clientY - rect.bottom;
634
+ newVolume = offsetX / rect.height * -100;
635
+ } else {
636
+ offsetX = e.clientY - rect.top;
637
+ newVolume = offsetX / rect.height * 100;
638
+ }
582
639
  setVolume(newVolume);
583
640
  player == null ? void 0 : player.volume(newVolume / 100);
584
641
  if (newVolume === 0) {
@@ -587,6 +644,28 @@ var VolumeSlider = ({
587
644
  player == null ? void 0 : player.muted(false);
588
645
  }
589
646
  };
647
+ const onMouseMove = (e) => {
648
+ if (isClicked) {
649
+ const slider = e.currentTarget;
650
+ const rect = slider.getBoundingClientRect();
651
+ let offsetX;
652
+ let newVolume;
653
+ if (!isTrailer && width > 400) {
654
+ offsetX = e.clientY - rect.bottom;
655
+ newVolume = offsetX / rect.height * -100;
656
+ } else {
657
+ offsetX = e.clientY - rect.top;
658
+ newVolume = offsetX / rect.height * 100;
659
+ }
660
+ setVolume(newVolume);
661
+ player == null ? void 0 : player.volume(newVolume / 100);
662
+ if (newVolume === 0) {
663
+ player == null ? void 0 : player.muted(true);
664
+ } else {
665
+ player == null ? void 0 : player.muted(false);
666
+ }
667
+ }
668
+ };
590
669
  const timeoutRef = React2.useRef(null);
591
670
  useEffect2(() => {
592
671
  setVisible(false);
@@ -625,33 +704,33 @@ var VolumeSlider = ({
625
704
  setVolume(0);
626
705
  player == null ? void 0 : player.muted(true);
627
706
  };
628
- return /* @__PURE__ */ jsxs6(
707
+ return /* @__PURE__ */ jsxs7(
629
708
  "div",
630
709
  {
631
710
  className: `sb-flex ${isVisible ? "" : ""} ${width > 400 && !isTrailer ? "sb-flex-col-reverse" : `sb-flex-col ${isTrailer ? "sb-justify-start" : ""}`} sb-items-center sb-gap-1 sb-h-full`,
632
711
  children: [
633
- /* @__PURE__ */ jsx23(
712
+ /* @__PURE__ */ jsx24(
634
713
  "div",
635
714
  {
636
715
  className: `sb-flex sb-relative ${width < 400 || isTrailer ? "-sb-top-1" : "sb-top-1"}`,
637
716
  onClick: toggleVisibility,
638
717
  onDoubleClick: handleDoubleClick,
639
- children: volume == 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */ jsx23(
718
+ children: volume == 0 || (player == null ? void 0 : player.muted()) ? /* @__PURE__ */ jsx24(
640
719
  VolumeMute_default,
641
720
  {
642
721
  className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
643
722
  }
644
- ) : volume < 25 ? /* @__PURE__ */ jsx23(
723
+ ) : volume < 25 ? /* @__PURE__ */ jsx24(
645
724
  VolumeVLow_default,
646
725
  {
647
726
  className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
648
727
  }
649
- ) : volume < 50 ? /* @__PURE__ */ jsx23(
728
+ ) : volume < 50 ? /* @__PURE__ */ jsx24(
650
729
  VolumeLow_default,
651
730
  {
652
731
  className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
653
732
  }
654
- ) : /* @__PURE__ */ jsx23(
733
+ ) : /* @__PURE__ */ jsx24(
655
734
  VolumeHigh_default,
656
735
  {
657
736
  className: `sb-w-3 sb-h-3 ${width < 400 || isTrailer ? "" : ""} sb-h-5 sb-w-5`
@@ -659,19 +738,21 @@ var VolumeSlider = ({
659
738
  )
660
739
  }
661
740
  ),
662
- /* @__PURE__ */ jsx23("div", { className: "sb-flex sb-items-center sb-justify-center", children: /* @__PURE__ */ jsx23(
741
+ /* @__PURE__ */ jsx24("div", { className: "sb-flex sb-items-center sb-justify-center", children: /* @__PURE__ */ jsx24(
663
742
  "div",
664
743
  {
665
744
  className: ` sb-transition-all sb-ease-in-out sb-duration-500 ${isVisible ? "sb-w-[22px] sb-opacity-100 sb-visible" : "sb-w-[22px] sb-opacity-0 sb-invisible"} ${width > 400 && !isTrailer ? "-sb-rotate-90 -sb-translate-y-1" : "sb-rotate-90 sb-translate-y-1"} sb-relative`,
666
- children: /* @__PURE__ */ jsx23(
745
+ children: /* @__PURE__ */ jsx24(
667
746
  Slider_default,
668
747
  {
748
+ onMouseMove: (e) => onMouseMove(e),
669
749
  value: volume,
670
750
  handleValueChange,
671
751
  min: MIN,
672
752
  max: MAX,
673
753
  className: "!sb-w-16 ",
674
- handleSliderClick: handleVolumeSliderClick
754
+ handleSliderClick: handleVolumeSliderClick,
755
+ setClicked
675
756
  }
676
757
  )
677
758
  }
@@ -687,7 +768,7 @@ import { useEffect as useEffect4, useState as useState4 } from "react";
687
768
 
688
769
  // src/components/MenuButton/index.tsx
689
770
  import { useCallback, useEffect as useEffect3, useRef, useState as useState3 } from "react";
690
- import { jsx as jsx24, jsxs as jsxs7 } from "react/jsx-runtime";
771
+ import { jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
691
772
  var MenuButton = ({
692
773
  buttonContent,
693
774
  menuContent,
@@ -722,14 +803,14 @@ var MenuButton = ({
722
803
  useEffect3(() => {
723
804
  setNoteOpen && setNoteOpen(isOpen);
724
805
  }, [isOpen]);
725
- return /* @__PURE__ */ jsxs7(
806
+ return /* @__PURE__ */ jsxs8(
726
807
  "div",
727
808
  {
728
809
  onMouseEnter,
729
810
  onMouseLeave,
730
811
  className: "sb-relative sb-flex sb-items-end",
731
812
  children: [
732
- /* @__PURE__ */ jsx24(
813
+ /* @__PURE__ */ jsx25(
733
814
  "button",
734
815
  {
735
816
  ref: buttonRef,
@@ -745,7 +826,7 @@ var MenuButton = ({
745
826
  children: buttonContent
746
827
  }
747
828
  ),
748
- !disablePopUp && isOpen && /* @__PURE__ */ jsx24(
829
+ !disablePopUp && isOpen && /* @__PURE__ */ jsx25(
749
830
  "div",
750
831
  {
751
832
  ref: menuRef,
@@ -763,7 +844,7 @@ var MenuButton = ({
763
844
  var MenuButton_default = MenuButton;
764
845
 
765
846
  // src/components/QualityMenu/index.tsx
766
- import { jsx as jsx25, jsxs as jsxs8 } from "react/jsx-runtime";
847
+ import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
767
848
  var QualityOption = ({
768
849
  isSelected,
769
850
  quality,
@@ -771,19 +852,19 @@ var QualityOption = ({
771
852
  width,
772
853
  isTrailer
773
854
  }) => {
774
- return /* @__PURE__ */ jsx25(
855
+ return /* @__PURE__ */ jsx26(
775
856
  "button",
776
857
  {
777
858
  className: `hover:sb-text-orange-500 ${width > 400 && !isTrailer ? "sb-p-2" : "sp-pb-1"}`,
778
859
  onClick,
779
- children: /* @__PURE__ */ jsxs8("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
780
- /* @__PURE__ */ jsx25("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx25(
860
+ children: /* @__PURE__ */ jsxs9("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
861
+ /* @__PURE__ */ jsx26("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx26(
781
862
  CheckedIcon_default,
782
863
  {
783
864
  className: `${width > 400 && !isTrailer ? "sb-w-5 sb-h-5" : "sb-w-3 sb-h-3"}`
784
865
  }
785
- ) : /* @__PURE__ */ jsx25("div", {}) }),
786
- /* @__PURE__ */ jsx25("p", { className: "sb-text-left sb-col-span-9", children: quality == null ? void 0 : quality.label })
866
+ ) : /* @__PURE__ */ jsx26("div", {}) }),
867
+ /* @__PURE__ */ jsx26("p", { className: "sb-text-left sb-col-span-9", children: quality == null ? void 0 : quality.label })
787
868
  ] })
788
869
  }
789
870
  );
@@ -812,25 +893,25 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
812
893
  }
813
894
  }
814
895
  }, [player]);
815
- return /* @__PURE__ */ jsx25(
896
+ return /* @__PURE__ */ jsx26(
816
897
  MenuButton_default,
817
898
  {
818
899
  classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
819
900
  onClick: (e, isOpen) => {
820
901
  onClick && onClick(e, isOpen);
821
902
  },
822
- buttonContent: /* @__PURE__ */ jsx25(SettingsIcon_default, { className: "sb-w-3 sb-h-3" }),
823
- menuContent: /* @__PURE__ */ jsx25(
903
+ buttonContent: /* @__PURE__ */ jsx26(SettingsIcon_default, { className: "sb-w-3 sb-h-3" }),
904
+ menuContent: /* @__PURE__ */ jsx26(
824
905
  "div",
825
906
  {
826
907
  className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 && !isTrailer ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
827
- children: /* @__PURE__ */ jsxs8("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
828
- /* @__PURE__ */ jsxs8(
908
+ children: /* @__PURE__ */ jsxs9("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
909
+ /* @__PURE__ */ jsxs9(
829
910
  "div",
830
911
  {
831
912
  className: `sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-start sb-relative sb-top-2`,
832
913
  children: [
833
- /* @__PURE__ */ jsx25(
914
+ /* @__PURE__ */ jsx26(
834
915
  "button",
835
916
  {
836
917
  onClick: () => {
@@ -839,16 +920,16 @@ var QualityMenu = ({ width, onClick, isTrailer }) => {
839
920
  }
840
921
  },
841
922
  className: "hover:sb-scale-150",
842
- children: /* @__PURE__ */ jsx25(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
923
+ children: /* @__PURE__ */ jsx26(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
843
924
  }
844
925
  ),
845
- /* @__PURE__ */ jsx25("h3", { children: "Quality" })
926
+ /* @__PURE__ */ jsx26("h3", { children: "Quality" })
846
927
  ]
847
928
  }
848
929
  ),
849
- /* @__PURE__ */ jsx25("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
850
- /* @__PURE__ */ jsx25("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities == null ? void 0 : qualities.map((q, i) => {
851
- return /* @__PURE__ */ jsx25(
930
+ /* @__PURE__ */ jsx26("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
931
+ /* @__PURE__ */ jsx26("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start ", children: qualities == null ? void 0 : qualities.map((q, i) => {
932
+ return /* @__PURE__ */ jsx26(
852
933
  QualityOption,
853
934
  {
854
935
  width,
@@ -884,7 +965,7 @@ var QualityMenu_default = QualityMenu;
884
965
 
885
966
  // src/components/CreateNoteMenu/index.tsx
886
967
  import React5, { useState as useState5 } from "react";
887
- import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
968
+ import { jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
888
969
  var CreateNoteMenu = ({
889
970
  handleSaveNoteAction,
890
971
  width,
@@ -907,7 +988,7 @@ var CreateNoteMenu = ({
907
988
  );
908
989
  }
909
990
  };
910
- return /* @__PURE__ */ jsx26(
991
+ return /* @__PURE__ */ jsx27(
911
992
  MenuButton_default,
912
993
  {
913
994
  onMouseEnter,
@@ -916,21 +997,21 @@ var CreateNoteMenu = ({
916
997
  noteButtonClick,
917
998
  setNoteOpen,
918
999
  classContainer: `${width < 400 ? "!sb-top-8 -sb-left-[9.75rem]" : ""}`,
919
- buttonContent: /* @__PURE__ */ jsx26(ClosedNoteIcon_default, { className: "sb-w-3 sb-h-3" }),
920
- menuContent: /* @__PURE__ */ jsx26(
1000
+ buttonContent: /* @__PURE__ */ jsx27(ClosedNoteIcon_default, { className: "sb-w-3 sb-h-3" }),
1001
+ menuContent: /* @__PURE__ */ jsx27(
921
1002
  "div",
922
1003
  {
923
1004
  className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 ? " sb-py-5 sb-w-[220px]" : "sb-py-1 sb-w-[150px]"}`,
924
- children: /* @__PURE__ */ jsxs9(
1005
+ children: /* @__PURE__ */ jsxs10(
925
1006
  "div",
926
1007
  {
927
1008
  className: "sb-flex sb-flex-col sb-gap-3 sb-items-center sb-justify-center",
928
1009
  onClick: (e) => e.stopPropagation(),
929
1010
  children: [
930
- /* @__PURE__ */ jsx26("h3", { className: "sb-px-5", children: "Add Note" }),
931
- /* @__PURE__ */ jsx26("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
932
- /* @__PURE__ */ jsxs9("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-4 sb-items-start", children: [
933
- /* @__PURE__ */ jsx26(
1011
+ /* @__PURE__ */ jsx27("h3", { className: "sb-px-5", children: "Add Note" }),
1012
+ /* @__PURE__ */ jsx27("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
1013
+ /* @__PURE__ */ jsxs10("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-4 sb-items-start", children: [
1014
+ /* @__PURE__ */ jsx27(
934
1015
  "input",
935
1016
  {
936
1017
  onClick: (e) => e.stopPropagation(),
@@ -943,7 +1024,7 @@ var CreateNoteMenu = ({
943
1024
  className: "sb-text-white placeholder:sb-text-white sb-w-full sb-bg-transparent sb-px-4 sb-py-3 sb-border sb-border-[#AAAAAA] sb-rounded-md"
944
1025
  }
945
1026
  ),
946
- /* @__PURE__ */ jsx26("button", { className: "sb-w-full", onClick: handleSaveNote, children: /* @__PURE__ */ jsx26("div", { className: "sb-px-4 sb-py-3 sb-text-center sb-font-bold sb-bg-orange-500 sb-rounded-md", children: "Save" }) })
1027
+ /* @__PURE__ */ jsx27("button", { className: "sb-w-full", onClick: handleSaveNote, children: /* @__PURE__ */ jsx27("div", { className: "sb-px-4 sb-py-3 sb-text-center sb-font-bold sb-bg-orange-500 sb-rounded-md", children: "Save" }) })
947
1028
  ] })
948
1029
  ]
949
1030
  }
@@ -962,10 +1043,10 @@ import { useEffect as useEffect6, useState as useState7 } from "react";
962
1043
  import { useState as useState6 } from "react";
963
1044
 
964
1045
  // src/components/Tooltip/index.tsx
965
- import { jsx as jsx27 } from "react/jsx-runtime";
1046
+ import { jsx as jsx28 } from "react/jsx-runtime";
966
1047
  var Tooltip = ({ open, children }) => {
967
1048
  if (!open) return null;
968
- return /* @__PURE__ */ jsx27(
1049
+ return /* @__PURE__ */ jsx28(
969
1050
  "div",
970
1051
  {
971
1052
  className: "sb-absolute sb-bottom-full sb-mb-2 sb-left-1/2 sb-transform sb--translate-x-1/2 sb-z-10 sb-whitespace-nowrap",
@@ -976,14 +1057,14 @@ var Tooltip = ({ open, children }) => {
976
1057
  var Tooltip_default = Tooltip;
977
1058
 
978
1059
  // src/components/NoteTooltip/index.tsx
979
- import { jsx as jsx28, jsxs as jsxs10 } from "react/jsx-runtime";
1060
+ import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
980
1061
  var NoteTooltip = ({ note }) => {
981
1062
  const [open, setOpen] = useState6(false);
982
1063
  const { currentTime, player } = useSoftBuildersVideoPlayerContext();
983
1064
  const handleValueChange = () => {
984
1065
  player == null ? void 0 : player.currentTime(note.time);
985
1066
  };
986
- return /* @__PURE__ */ jsx28(
1067
+ return /* @__PURE__ */ jsx29(
987
1068
  "div",
988
1069
  {
989
1070
  onClick: handleValueChange,
@@ -991,9 +1072,9 @@ var NoteTooltip = ({ note }) => {
991
1072
  style: { left: `${note == null ? void 0 : note.percentage}%` },
992
1073
  onMouseEnter: () => setOpen(true),
993
1074
  onMouseLeave: () => setOpen(false),
994
- children: /* @__PURE__ */ jsx28("div", { className: "sb-relative", children: /* @__PURE__ */ jsx28(Tooltip_default, { open, children: /* @__PURE__ */ jsxs10("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
995
- /* @__PURE__ */ jsx28("p", { children: note == null ? void 0 : note.label }),
996
- /* @__PURE__ */ jsx28("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })
1075
+ children: /* @__PURE__ */ jsx29("div", { className: "sb-relative", children: /* @__PURE__ */ jsx29(Tooltip_default, { open, children: /* @__PURE__ */ jsxs11("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
1076
+ /* @__PURE__ */ jsx29("p", { children: note == null ? void 0 : note.label }),
1077
+ /* @__PURE__ */ jsx29("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: durationFormater(note.time) })
997
1078
  ] }) }) })
998
1079
  }
999
1080
  );
@@ -1001,7 +1082,7 @@ var NoteTooltip = ({ note }) => {
1001
1082
  var NoteTooltip_default = NoteTooltip;
1002
1083
 
1003
1084
  // src/components/NotesPanal/index.tsx
1004
- import { jsx as jsx29 } from "react/jsx-runtime";
1085
+ import { jsx as jsx30 } from "react/jsx-runtime";
1005
1086
  var NotesPanal = ({ notes }) => {
1006
1087
  const [ns, setNs] = useState7([]);
1007
1088
  const { duration } = useSoftBuildersVideoPlayerContext();
@@ -1014,7 +1095,7 @@ var NotesPanal = ({ notes }) => {
1014
1095
  });
1015
1096
  newNs && setNs(newNs);
1016
1097
  }, [notes, duration]);
1017
- return /* @__PURE__ */ jsx29("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => /* @__PURE__ */ jsx29(NoteTooltip_default, { note: n }, `note-${i}-${n.time}`)) });
1098
+ return /* @__PURE__ */ jsx30("div", { id: "notes-panal", className: "sb-w-full sb-h-full sb-relative ", children: ns.map((n, i) => /* @__PURE__ */ jsx30(NoteTooltip_default, { note: n }, `note-${i}-${n.time}`)) });
1018
1099
  };
1019
1100
  var NotesPanal_default = NotesPanal;
1020
1101
 
@@ -1023,7 +1104,7 @@ import { useEffect as useEffect8, useState as useState9 } from "react";
1023
1104
 
1024
1105
  // src/components/ChapterTooltip/index.tsx
1025
1106
  import { useEffect as useEffect7, useState as useState8 } from "react";
1026
- import { jsx as jsx30, jsxs as jsxs11 } from "react/jsx-runtime";
1107
+ import { jsx as jsx31, jsxs as jsxs12 } from "react/jsx-runtime";
1027
1108
  var ChapterTooltip = ({ chapter }) => {
1028
1109
  const { player } = useSoftBuildersVideoPlayerContext();
1029
1110
  const [open, setOpen] = useState8(false);
@@ -1045,7 +1126,7 @@ var ChapterTooltip = ({ chapter }) => {
1045
1126
  const clickedTime = chapter.startTime + clickPercentage * (chapter.endTime - chapter.startTime);
1046
1127
  player == null ? void 0 : player.currentTime(clickedTime);
1047
1128
  };
1048
- return /* @__PURE__ */ jsx30(
1129
+ return /* @__PURE__ */ jsx31(
1049
1130
  "div",
1050
1131
  {
1051
1132
  id: `ii-section-${chapter.title}`,
@@ -1056,15 +1137,15 @@ var ChapterTooltip = ({ chapter }) => {
1056
1137
  },
1057
1138
  onMouseEnter: () => setOpen(true),
1058
1139
  onMouseLeave: () => setOpen(false),
1059
- children: /* @__PURE__ */ jsx30(
1140
+ children: /* @__PURE__ */ jsx31(
1060
1141
  "button",
1061
1142
  {
1062
1143
  id: `section-${chapter.title}`,
1063
1144
  className: "sb-h-full sb-w-full",
1064
1145
  onClick: handleClickChapter,
1065
- children: /* @__PURE__ */ jsx30("div", { className: "sb-relative sb-flex sb-h-full sb-w-full sb-justify-between sb-items-center", children: /* @__PURE__ */ jsx30(Tooltip_default, { open, children: /* @__PURE__ */ jsxs11("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
1066
- /* @__PURE__ */ jsx30("p", { children: chapter.title }),
1067
- /* @__PURE__ */ jsxs11("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: [
1146
+ children: /* @__PURE__ */ jsx31("div", { className: "sb-relative sb-flex sb-h-full sb-w-full sb-justify-between sb-items-center", children: /* @__PURE__ */ jsx31(Tooltip_default, { open, children: /* @__PURE__ */ jsxs12("div", { className: "sb-flex sb-flex-col sb-gap-2 sb-items-center", children: [
1147
+ /* @__PURE__ */ jsx31("p", { children: chapter.title }),
1148
+ /* @__PURE__ */ jsxs12("p", { className: "sb-p-2 sb-bg-[#303030] sb-bg-opacity-50 sb-rounded-md", children: [
1068
1149
  durationFormater(chapter.startTime),
1069
1150
  " -",
1070
1151
  " ",
@@ -1079,7 +1160,7 @@ var ChapterTooltip = ({ chapter }) => {
1079
1160
  var ChapterTooltip_default = ChapterTooltip;
1080
1161
 
1081
1162
  // src/components/ChaptersPanal/index.tsx
1082
- import { jsx as jsx31 } from "react/jsx-runtime";
1163
+ import { jsx as jsx32 } from "react/jsx-runtime";
1083
1164
  var ChaptersPanal = ({ chapters }) => {
1084
1165
  const [cs, setCs] = useState9([]);
1085
1166
  const { duration } = useSoftBuildersVideoPlayerContext();
@@ -1094,19 +1175,20 @@ var ChaptersPanal = ({ chapters }) => {
1094
1175
  });
1095
1176
  newCs && setCs(newCs);
1096
1177
  }, [chapters, duration]);
1097
- return /* @__PURE__ */ jsx31("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => /* @__PURE__ */ jsx31(ChapterTooltip_default, { chapter: c }, `chapter-${i}-${c.startTime}`)) });
1178
+ return /* @__PURE__ */ jsx32("div", { id: "chapters-panal", className: "sb-w-full sb-h-full sb-relative ", children: cs.map((c, i) => /* @__PURE__ */ jsx32(ChapterTooltip_default, { chapter: c }, `chapter-${i}-${c.startTime}`)) });
1098
1179
  };
1099
1180
  var ChaptersPanal_default = ChaptersPanal;
1100
1181
 
1101
1182
  // src/components/TimeSlider/index.tsx
1102
1183
  import { useEffect as useEffect9, useState as useState10 } from "react";
1103
- import { jsx as jsx32, jsxs as jsxs12 } from "react/jsx-runtime";
1184
+ import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
1104
1185
  var MIN2 = 0;
1105
1186
  var MAX2 = 100;
1106
1187
  var DEFERENCE = Math.abs(MAX2 - MIN2);
1107
1188
  var BAR_PERCENTAGE_WIDTH = 0.5;
1108
1189
  var TimeSlider = ({ chapters }) => {
1109
1190
  const [timeSlider, setTimeSlider] = useState10(0);
1191
+ const [isClicked, setClicked] = useState10(false);
1110
1192
  const { player, duration, downloadedBufferPercentage } = useSoftBuildersVideoPlayerContext();
1111
1193
  const handleValueChange = (e) => {
1112
1194
  const newTimeSlider = Number(e.target.value);
@@ -1114,14 +1196,16 @@ var TimeSlider = ({ chapters }) => {
1114
1196
  const time = newTimeSlider * duration / DEFERENCE;
1115
1197
  player == null ? void 0 : player.currentTime(time);
1116
1198
  };
1117
- const handleSliderClick = (e) => {
1118
- const slider = e.currentTarget;
1119
- const rect = slider.getBoundingClientRect();
1120
- const offsetX = e.clientX - rect.left;
1121
- const newTimeSlider = offsetX / rect.width * DEFERENCE;
1122
- const time = newTimeSlider * duration / DEFERENCE;
1123
- player == null ? void 0 : player.currentTime(time);
1124
- setTimeSlider(newTimeSlider);
1199
+ const onMouseMove = (e) => {
1200
+ if (isClicked) {
1201
+ const slider = e.currentTarget;
1202
+ const rect = slider.getBoundingClientRect();
1203
+ const offsetX = e.clientX - rect.left;
1204
+ const newTimeSlider = offsetX / rect.width * DEFERENCE;
1205
+ const time = newTimeSlider * duration / DEFERENCE;
1206
+ player == null ? void 0 : player.currentTime(time);
1207
+ setTimeSlider(newTimeSlider);
1208
+ }
1125
1209
  };
1126
1210
  useEffect9(() => {
1127
1211
  const intervalId = setInterval(() => {
@@ -1149,13 +1233,14 @@ var TimeSlider = ({ chapters }) => {
1149
1233
  arr.push(`black 100%`);
1150
1234
  setMaskCuttes(arr.toString());
1151
1235
  }, [chapters, duration]);
1152
- return /* @__PURE__ */ jsxs12("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [
1153
- /* @__PURE__ */ jsx32("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: /* @__PURE__ */ jsx32(
1236
+ return /* @__PURE__ */ jsxs13("div", { className: " sb-w-full sb-h-2 sb-flex sb-items-center sb-justify-center", children: [
1237
+ /* @__PURE__ */ jsx33("div", { className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-z-10", children: /* @__PURE__ */ jsx33(
1154
1238
  Slider_default,
1155
1239
  {
1240
+ onMouseMove: (e) => onMouseMove(e),
1241
+ setClicked,
1156
1242
  value: timeSlider,
1157
1243
  handleValueChange,
1158
- handleSliderClick,
1159
1244
  min: MIN2,
1160
1245
  max: MAX2,
1161
1246
  style: {
@@ -1163,7 +1248,7 @@ var TimeSlider = ({ chapters }) => {
1163
1248
  }
1164
1249
  }
1165
1250
  ) }),
1166
- /* @__PURE__ */ jsx32(
1251
+ /* @__PURE__ */ jsx33(
1167
1252
  "div",
1168
1253
  {
1169
1254
  className: "sb-absolute sb-top-0 sb-left-0 sb-w-full sb-h-2 sb-bg-slate-400 sb-rounded-md",
@@ -1193,24 +1278,24 @@ var TimeSlider = ({ chapters }) => {
1193
1278
  var TimeSlider_default = TimeSlider;
1194
1279
 
1195
1280
  // src/components/TimeSliderContainer/index.tsx
1196
- import { jsx as jsx33, jsxs as jsxs13 } from "react/jsx-runtime";
1281
+ import { jsx as jsx34, jsxs as jsxs14 } from "react/jsx-runtime";
1197
1282
  var TimeSliderContainer = ({ notes, chapters }) => {
1198
- return /* @__PURE__ */ jsxs13(
1283
+ return /* @__PURE__ */ jsxs14(
1199
1284
  "div",
1200
1285
  {
1201
1286
  id: "time-slider-container",
1202
1287
  className: "sb-w-full sb-relative sb-flex sb-items-center sb-justify-center",
1203
1288
  children: [
1204
- /* @__PURE__ */ jsx33(
1289
+ /* @__PURE__ */ jsx34(
1205
1290
  "div",
1206
1291
  {
1207
1292
  id: "notes-panal",
1208
1293
  className: "sb-absolute sb-w-full sb-h-full sb-top-[27%] sb-left-0",
1209
- children: /* @__PURE__ */ jsx33(NotesPanal_default, { notes })
1294
+ children: /* @__PURE__ */ jsx34(NotesPanal_default, { notes })
1210
1295
  }
1211
1296
  ),
1212
- /* @__PURE__ */ jsx33("div", { className: "sb-absolute sb-w-full sb-h-full sb-top-0 sb-left-0", children: /* @__PURE__ */ jsx33(ChaptersPanal_default, { chapters }) }),
1213
- /* @__PURE__ */ jsx33(TimeSlider_default, { chapters })
1297
+ /* @__PURE__ */ jsx34("div", { className: "sb-absolute sb-w-full sb-h-full sb-top-0 sb-left-0", children: /* @__PURE__ */ jsx34(ChaptersPanal_default, { chapters }) }),
1298
+ /* @__PURE__ */ jsx34(TimeSlider_default, { chapters })
1214
1299
  ]
1215
1300
  }
1216
1301
  );
@@ -1219,7 +1304,7 @@ var TimeSliderContainer_default = TimeSliderContainer;
1219
1304
 
1220
1305
  // src/components/BufferTracker/index.tsx
1221
1306
  import { useEffect as useEffect10 } from "react";
1222
- import { Fragment, jsx as jsx34 } from "react/jsx-runtime";
1307
+ import { Fragment, jsx as jsx35 } from "react/jsx-runtime";
1223
1308
  var BufferTracker = () => {
1224
1309
  const { player, setDownloadedBufferTimeufferTime } = useSoftBuildersVideoPlayerContext();
1225
1310
  useEffect10(() => {
@@ -1228,13 +1313,13 @@ var BufferTracker = () => {
1228
1313
  }, 1e3);
1229
1314
  return () => clearInterval(intervalId);
1230
1315
  }, [player]);
1231
- return /* @__PURE__ */ jsx34(Fragment, {});
1316
+ return /* @__PURE__ */ jsx35(Fragment, {});
1232
1317
  };
1233
1318
  var BufferTracker_default = BufferTracker;
1234
1319
 
1235
1320
  // src/components/CurrentTimeTracker/index.tsx
1236
1321
  import { useEffect as useEffect11 } from "react";
1237
- import { Fragment as Fragment2, jsx as jsx35 } from "react/jsx-runtime";
1322
+ import { Fragment as Fragment2, jsx as jsx36 } from "react/jsx-runtime";
1238
1323
  var CurrentTimeTracker = () => {
1239
1324
  const { setCurrentTime, player } = useSoftBuildersVideoPlayerContext();
1240
1325
  useEffect11(() => {
@@ -1243,19 +1328,19 @@ var CurrentTimeTracker = () => {
1243
1328
  }, 500);
1244
1329
  return () => clearInterval(intervalId);
1245
1330
  }, [player]);
1246
- return /* @__PURE__ */ jsx35(Fragment2, {});
1331
+ return /* @__PURE__ */ jsx36(Fragment2, {});
1247
1332
  };
1248
1333
  var CurrentTimeTracker_default = CurrentTimeTracker;
1249
1334
 
1250
1335
  // src/components/SubtitleMenu/index.tsx
1251
1336
  import { useEffect as useEffect12, useState as useState11 } from "react";
1252
- import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
1337
+ import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
1253
1338
  var SubtitleOption = ({
1254
1339
  isSelected,
1255
1340
  subtitle,
1256
1341
  onClick
1257
1342
  }) => {
1258
- return /* @__PURE__ */ jsx36(
1343
+ return /* @__PURE__ */ jsx37(
1259
1344
  "button",
1260
1345
  {
1261
1346
  className: "hover:sb-text-orange-500 sb-p-2",
@@ -1263,9 +1348,9 @@ var SubtitleOption = ({
1263
1348
  e.stopPropagation();
1264
1349
  onClick(e);
1265
1350
  },
1266
- children: /* @__PURE__ */ jsxs14("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
1267
- /* @__PURE__ */ jsx36("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx36(CheckedIcon_default, { className: "sb-w-5 sb-h-5" }) : /* @__PURE__ */ jsx36("div", {}) }),
1268
- /* @__PURE__ */ jsx36("p", { className: "sb-text-left sb-col-span-9", children: subtitle.label })
1351
+ children: /* @__PURE__ */ jsxs15("div", { className: "sb-grid sb-grid-cols-12 sb-items-center sb-gap-2", children: [
1352
+ /* @__PURE__ */ jsx37("div", { className: "sb-col-span-3", children: isSelected ? /* @__PURE__ */ jsx37(CheckedIcon_default, { className: "sb-w-5 sb-h-5" }) : /* @__PURE__ */ jsx37("div", {}) }),
1353
+ /* @__PURE__ */ jsx37("p", { className: "sb-text-left sb-col-span-9", children: subtitle.label })
1269
1354
  ] })
1270
1355
  }
1271
1356
  );
@@ -1298,7 +1383,7 @@ var SubtitleMenu = ({
1298
1383
  setSubtitles(textTracks);
1299
1384
  }
1300
1385
  }, [player]);
1301
- return /* @__PURE__ */ jsx36(
1386
+ return /* @__PURE__ */ jsx37(
1302
1387
  MenuButton_default,
1303
1388
  {
1304
1389
  onMouseEnter,
@@ -1307,14 +1392,14 @@ var SubtitleMenu = ({
1307
1392
  onClick && onClick(e, isOpen);
1308
1393
  },
1309
1394
  classContainer: `${width < 400 || isTrailer ? "!sb-top-8 -sb-left-9" : ""}`,
1310
- buttonContent: /* @__PURE__ */ jsx36(SubIcon_default, { className: "sb-w-4 sb-h-4 sb-text-white " }),
1311
- menuContent: /* @__PURE__ */ jsx36(
1395
+ buttonContent: /* @__PURE__ */ jsx37(SubIcon_default, { className: "sb-w-4 sb-h-4 sb-text-white " }),
1396
+ menuContent: /* @__PURE__ */ jsx37(
1312
1397
  "div",
1313
1398
  {
1314
1399
  className: `sb-rounded-md sb-bg-[#303030] sb-bg-opacity-50 ${width > 400 && !isTrailer ? "sb-w-[150px] sb-py-5" : "sb-w-[90px] sb-items-center sb-justify-center sb-py-1"}`,
1315
- children: /* @__PURE__ */ jsxs14("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
1316
- /* @__PURE__ */ jsxs14("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-center sb-justify-center", children: [
1317
- /* @__PURE__ */ jsx36(
1400
+ children: /* @__PURE__ */ jsxs15("div", { className: "sb-flex sb-flex-col sb-gap-3", children: [
1401
+ /* @__PURE__ */ jsxs15("div", { className: "sb-px-5 sb-flex sb-flex-row sb-gap-3 sb-items-center sb-justify-center", children: [
1402
+ /* @__PURE__ */ jsx37(
1318
1403
  "button",
1319
1404
  {
1320
1405
  onClick: () => {
@@ -1323,14 +1408,14 @@ var SubtitleMenu = ({
1323
1408
  }
1324
1409
  },
1325
1410
  className: "hover:sb-scale-150",
1326
- children: /* @__PURE__ */ jsx36(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
1411
+ children: /* @__PURE__ */ jsx37(LeftArrowIcon_default, { className: "sb-w-3 sb-h-3" })
1327
1412
  }
1328
1413
  ),
1329
- /* @__PURE__ */ jsx36("h3", { children: "Subtitle" })
1414
+ /* @__PURE__ */ jsx37("h3", { children: "Subtitle" })
1330
1415
  ] }),
1331
- /* @__PURE__ */ jsx36("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
1332
- /* @__PURE__ */ jsx36("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start", children: subtitles.map((q, i) => {
1333
- return /* @__PURE__ */ jsx36(
1416
+ /* @__PURE__ */ jsx37("div", { className: "sb-w-full sb-h-[.1px] sb-bg-[#AAAAAA] sb-bg-opacity-70" }),
1417
+ /* @__PURE__ */ jsx37("div", { className: "sb-px-5 sb-flex sb-flex-col sb-gap-3 sb-items-start", children: subtitles.map((q, i) => {
1418
+ return /* @__PURE__ */ jsx37(
1334
1419
  SubtitleOption,
1335
1420
  {
1336
1421
  isSelected: q.mode === "showing",
@@ -1355,7 +1440,7 @@ var SubtitleMenu_default = SubtitleMenu;
1355
1440
 
1356
1441
  // src/components/Tooltip/GlobalTooltip.tsx
1357
1442
  import { useState as useState12 } from "react";
1358
- import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
1443
+ import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
1359
1444
  var TooltipModal = ({
1360
1445
  content,
1361
1446
  children,
@@ -1365,13 +1450,13 @@ var TooltipModal = ({
1365
1450
  const [isOpen, setIsOpen] = useState12(false);
1366
1451
  const showTooltip = () => setIsOpen(true);
1367
1452
  const hideTooltip = () => setIsOpen(false);
1368
- return /* @__PURE__ */ jsxs15(
1453
+ return /* @__PURE__ */ jsxs16(
1369
1454
  "div",
1370
1455
  {
1371
1456
  className: "tooltip-container",
1372
1457
  style: { position: "relative", display: "inline-block" },
1373
1458
  children: [
1374
- /* @__PURE__ */ jsx37(
1459
+ /* @__PURE__ */ jsx38(
1375
1460
  "div",
1376
1461
  {
1377
1462
  onMouseEnter: showTooltip,
@@ -1380,7 +1465,7 @@ var TooltipModal = ({
1380
1465
  children
1381
1466
  }
1382
1467
  ),
1383
- isOpen && /* @__PURE__ */ jsx37(
1468
+ isOpen && /* @__PURE__ */ jsx38(
1384
1469
  "div",
1385
1470
  {
1386
1471
  className: `sb-tooltip-modal sb-text-orange-900 sb-my-2 ${width > 400 ? "!sb-bottom-[105%]" : "!sb-top-[105%]"}`,
@@ -1405,7 +1490,7 @@ var TooltipModal = ({
1405
1490
  var GlobalTooltip_default = TooltipModal;
1406
1491
 
1407
1492
  // src/components/ControlBar/index.tsx
1408
- import { Fragment as Fragment3, jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
1493
+ import { jsx as jsx39, jsxs as jsxs17 } from "react/jsx-runtime";
1409
1494
  var ControlBar = ({
1410
1495
  player,
1411
1496
  isPaused,
@@ -1456,67 +1541,64 @@ var ControlBar = ({
1456
1541
  useEffect13(() => {
1457
1542
  setDuration(duration);
1458
1543
  }, [duration]);
1459
- return /* @__PURE__ */ jsxs16(
1544
+ return /* @__PURE__ */ jsxs17(
1460
1545
  "div",
1461
1546
  {
1462
1547
  className: ` !sb-px-4 sb-flex sb-pt-2 sb-justify-center sb-gap-3 sb-w-full sb-h-full ${width > 400 && !isTrailer ? "sb-absolute sb-bottom-1 sb-items-end sb-mb-1 sb-pb-2 " : "sb-items-start"} sb-pb-2`,
1463
1548
  children: [
1464
- /* @__PURE__ */ jsx38(BufferTracker_default, {}),
1465
- /* @__PURE__ */ jsx38(CurrentTimeTracker_default, {}),
1466
- !isTrailer && /* @__PURE__ */ jsxs16(Fragment3, { children: [
1467
- " ",
1468
- /* @__PURE__ */ jsx38(
1469
- "button",
1470
- {
1471
- onClick: () => {
1472
- seek(-seekStep);
1473
- },
1474
- children: /* @__PURE__ */ jsx38(
1475
- GlobalTooltip_default,
1476
- {
1477
- width,
1478
- content: /* @__PURE__ */ jsx38("p", { children: "Backward 5 sec" }),
1479
- isLeft: true,
1480
- children: /* @__PURE__ */ jsx38(BackwardIcon_default, { className: "sb-w-3 sb-h-3" })
1481
- }
1482
- )
1483
- }
1484
- ),
1485
- /* @__PURE__ */ jsx38("button", { onClick: togglePlay, children: /* @__PURE__ */ jsx38(
1486
- GlobalTooltip_default,
1487
- {
1488
- width,
1489
- content: /* @__PURE__ */ jsx38("p", { children: isPaused ? "Play" : "pause" }),
1490
- isLeft: true,
1491
- children: isPaused ? /* @__PURE__ */ jsx38(PlayIcon_default, { className: "sb-w-3 sb-h-3" }) : /* @__PURE__ */ jsx38(PauseIcon_default, { className: "sb-w-3 sb-h-3" })
1492
- }
1493
- ) }),
1494
- /* @__PURE__ */ jsx38(
1495
- "button",
1496
- {
1497
- onClick: (e) => {
1498
- e.preventDefault();
1499
- seek(seekStep);
1500
- },
1501
- children: /* @__PURE__ */ jsx38(
1502
- GlobalTooltip_default,
1503
- {
1504
- width,
1505
- content: /* @__PURE__ */ jsx38("p", { children: "Forward 5 sec" }),
1506
- isLeft: true,
1507
- children: /* @__PURE__ */ jsx38(ForwardIcon_default, { className: "sb-w-3 sb-h-3" })
1508
- }
1509
- )
1510
- }
1511
- )
1512
- ] }),
1549
+ /* @__PURE__ */ jsx39(BufferTracker_default, {}),
1550
+ /* @__PURE__ */ jsx39(CurrentTimeTracker_default, {}),
1551
+ !isTrailer && /* @__PURE__ */ jsx39(
1552
+ "button",
1553
+ {
1554
+ onClick: () => {
1555
+ seek(-seekStep);
1556
+ },
1557
+ children: /* @__PURE__ */ jsx39(
1558
+ GlobalTooltip_default,
1559
+ {
1560
+ width,
1561
+ content: /* @__PURE__ */ jsx39("p", { children: "Backward 5 sec" }),
1562
+ isLeft: true,
1563
+ children: /* @__PURE__ */ jsx39(BackwardIcon_default, { className: "sb-w-3 sb-h-3" })
1564
+ }
1565
+ )
1566
+ }
1567
+ ),
1568
+ /* @__PURE__ */ jsx39("button", { onClick: togglePlay, children: /* @__PURE__ */ jsx39(
1569
+ GlobalTooltip_default,
1570
+ {
1571
+ width,
1572
+ content: /* @__PURE__ */ jsx39("p", { children: isPaused ? "Play" : "pause" }),
1573
+ isLeft: true,
1574
+ children: isPaused ? /* @__PURE__ */ jsx39(PlayIcon_default, { className: "sb-w-3 sb-h-3" }) : /* @__PURE__ */ jsx39(PauseIcon_default, { className: "sb-w-3 sb-h-3" })
1575
+ }
1576
+ ) }),
1577
+ !isTrailer && /* @__PURE__ */ jsx39(
1578
+ "button",
1579
+ {
1580
+ onClick: (e) => {
1581
+ e.preventDefault();
1582
+ seek(seekStep);
1583
+ },
1584
+ children: /* @__PURE__ */ jsx39(
1585
+ GlobalTooltip_default,
1586
+ {
1587
+ width,
1588
+ content: /* @__PURE__ */ jsx39("p", { children: "Forward 5 sec" }),
1589
+ isLeft: true,
1590
+ children: /* @__PURE__ */ jsx39(ForwardIcon_default, { className: "sb-w-3 sb-h-3" })
1591
+ }
1592
+ )
1593
+ }
1594
+ ),
1513
1595
  // isSeeking ||
1514
1596
  // width > 400 &&
1515
- /* @__PURE__ */ jsx38(
1597
+ /* @__PURE__ */ jsx39(
1516
1598
  "div",
1517
1599
  {
1518
1600
  className: `${width < 400 && !isTrailer ? "sb-flex-1 sb-ml-0 sb-mr-0" : "sb-w-full"}`,
1519
- children: /* @__PURE__ */ jsxs16(
1601
+ children: /* @__PURE__ */ jsxs17(
1520
1602
  "div",
1521
1603
  {
1522
1604
  style: width < 400 && !isTrailer ? {
@@ -1526,15 +1608,15 @@ var ControlBar = ({
1526
1608
  } : { width: "98%" },
1527
1609
  className: `flex gap-2 ${width < 400 && !isTrailer ? "absolute sb-top-1" : "-sb-translate-y-0 sb-w-full"} hover:sb-w-[45%] `,
1528
1610
  children: [
1529
- /* @__PURE__ */ jsx38(CurrentTimeLabel_default, {}),
1530
- /* @__PURE__ */ jsx38(TimeSliderContainer_default, { chapters, notes }),
1531
- /* @__PURE__ */ jsx38("p", { children: durationFormater(duration) })
1611
+ /* @__PURE__ */ jsx39(CurrentTimeLabel_default, {}),
1612
+ /* @__PURE__ */ jsx39(TimeSliderContainer_default, { chapters, notes }),
1613
+ /* @__PURE__ */ jsx39("p", { children: durationFormater(duration) })
1532
1614
  ]
1533
1615
  }
1534
1616
  )
1535
1617
  }
1536
1618
  ),
1537
- /* @__PURE__ */ jsx38("div", { className: "sb-h-full", children: /* @__PURE__ */ jsx38(
1619
+ /* @__PURE__ */ jsx39("div", { className: "sb-h-full", children: /* @__PURE__ */ jsx39(
1538
1620
  VolumeSlider_default,
1539
1621
  {
1540
1622
  isTrailer,
@@ -1544,7 +1626,7 @@ var ControlBar = ({
1544
1626
  handleControlDisplayTimer
1545
1627
  }
1546
1628
  ) }),
1547
- /* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Quality" }), children: /* @__PURE__ */ jsx38(
1629
+ /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Quality" }), children: /* @__PURE__ */ jsx39(
1548
1630
  QualityMenu_default,
1549
1631
  {
1550
1632
  isTrailer,
@@ -1555,7 +1637,7 @@ var ControlBar = ({
1555
1637
  }
1556
1638
  }
1557
1639
  ) }),
1558
- disableNote && /* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Create note" }), children: /* @__PURE__ */ jsx38(
1640
+ disableNote && /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Create note" }), children: /* @__PURE__ */ jsx39(
1559
1641
  CreateNoteMenu_default,
1560
1642
  {
1561
1643
  handleSaveNoteAction,
@@ -1570,7 +1652,7 @@ var ControlBar = ({
1570
1652
  }
1571
1653
  }
1572
1654
  ) }),
1573
- /* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Subtitle" }), children: /* @__PURE__ */ jsx38(
1655
+ /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Subtitle" }), children: /* @__PURE__ */ jsx39(
1574
1656
  SubtitleMenu_default,
1575
1657
  {
1576
1658
  isTrailer,
@@ -1581,7 +1663,7 @@ var ControlBar = ({
1581
1663
  }
1582
1664
  }
1583
1665
  ) }),
1584
- /* @__PURE__ */ jsx38(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx38("p", { children: "Full screen" }), children: /* @__PURE__ */ jsx38(
1666
+ /* @__PURE__ */ jsx39(GlobalTooltip_default, { width, content: /* @__PURE__ */ jsx39("p", { children: "Full screen" }), children: /* @__PURE__ */ jsx39(
1585
1667
  "button",
1586
1668
  {
1587
1669
  onClick: (e) => {
@@ -1593,7 +1675,7 @@ var ControlBar = ({
1593
1675
  player == null ? void 0 : player.requestFullscreen();
1594
1676
  }
1595
1677
  },
1596
- children: /* @__PURE__ */ jsx38(FullScreenIcon_default, { className: "sb-w-3 sb-h-3" })
1678
+ children: /* @__PURE__ */ jsx39(FullScreenIcon_default, { className: "sb-w-3 sb-h-3" })
1597
1679
  }
1598
1680
  ) })
1599
1681
  ]
@@ -1606,36 +1688,40 @@ var ControlBar_default = ControlBar;
1606
1688
  import { isEqual } from "lodash";
1607
1689
 
1608
1690
  // src/components/BigPlayButton/index.tsx
1609
- import { jsx as jsx39 } from "react/jsx-runtime";
1691
+ import { jsx as jsx40, jsxs as jsxs18 } from "react/jsx-runtime";
1610
1692
  var BigPlayButton = ({
1611
1693
  player,
1612
1694
  isPaused,
1613
1695
  setIsPaused,
1614
1696
  height,
1615
1697
  id,
1616
- heightValue
1698
+ heightValue,
1699
+ isLoading
1617
1700
  }) => {
1618
1701
  const togglePlay = () => {
1619
1702
  if (isPaused) player == null ? void 0 : player.play();
1620
1703
  else player == null ? void 0 : player.pause();
1621
1704
  setIsPaused(!isPaused);
1622
1705
  };
1623
- return /* @__PURE__ */ jsx39(
1706
+ return /* @__PURE__ */ jsx40(
1624
1707
  "div",
1625
1708
  {
1626
1709
  style: __spreadValues({}, height && heightValue ? { position: "absolute", top: `-${(heightValue - height) / 2}px` } : {}),
1627
1710
  onClick: togglePlay,
1628
- className: ` sb-w-16 sb-h-16 sb-rounded-full sb-bg-white/30 sb-backdrop-blur-lg sb-flex sb-items-center sb-justify-center`,
1629
- children: isPaused ? /* @__PURE__ */ jsx39(PlayIcon_default, { className: "sb-w-4 sb-h-4" }) : /* @__PURE__ */ jsx39(PauseIcon_default, { className: "sb-w-4 sb-h-4" })
1711
+ className: ` sb-w-16 sb-h-16 sb-rounded-full ${!isLoading ? "sb-bg-white/30 sb-backdrop-blur-lg" : ""} sb-flex sb-items-center sb-justify-center`,
1712
+ children: isPaused || isLoading ? /* @__PURE__ */ jsxs18("div", { children: [
1713
+ !isLoading && /* @__PURE__ */ jsx40(PlayIcon_default, { className: "sb-w-4 sb-h-4" }),
1714
+ isLoading && /* @__PURE__ */ jsx40(SkillamiIcon_default, { className: " sb-w-16 sb-h-16 sb-animate-spin sb-absolute -sb-top-2 -sb-right-2 " })
1715
+ ] }) : /* @__PURE__ */ jsx40(PauseIcon_default, { className: "sb-w-4 sb-h-4" })
1630
1716
  }
1631
1717
  );
1632
1718
  };
1633
1719
  var BigPlayButton_default = BigPlayButton;
1634
1720
 
1635
1721
  // src/components/VideoPlayerComponent/index.tsx
1636
- import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs17 } from "react/jsx-runtime";
1722
+ import { Fragment as Fragment3, jsx as jsx41, jsxs as jsxs19 } from "react/jsx-runtime";
1637
1723
  var bigPlayButtonRoot = {};
1638
- var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", height, heightValue) => {
1724
+ var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", height, heightValue, isLoading) => {
1639
1725
  const container = document.getElementById(`video-container-${id}`);
1640
1726
  if (container) {
1641
1727
  container.style.height = "100%";
@@ -1646,14 +1732,15 @@ var renderBigPlayButton = (id, player, isPaused, setIsPaused, opacity = "100", h
1646
1732
  bigPlayButtonRoot[id] = ReactDOM.createRoot(element);
1647
1733
  }
1648
1734
  bigPlayButtonRoot[id].render(
1649
- /* @__PURE__ */ jsx40(
1735
+ /* @__PURE__ */ jsx41(
1650
1736
  BigPlayButton_default,
1651
1737
  {
1652
1738
  player,
1653
1739
  isPaused,
1654
1740
  setIsPaused,
1655
1741
  height,
1656
- heightValue
1742
+ heightValue,
1743
+ isLoading
1657
1744
  }
1658
1745
  )
1659
1746
  );
@@ -1678,7 +1765,7 @@ var renderControlBar = (id, player, isPaused, setIsPaused, duration, notes, chap
1678
1765
  element.style.height = "100%";
1679
1766
  element.style.alignItems = "flex-end";
1680
1767
  controlBarRoot[id].render(
1681
- /* @__PURE__ */ jsx40(SoftBuildersVideoPlayerProvider, { children: /* @__PURE__ */ jsx40(
1768
+ /* @__PURE__ */ jsx41(SoftBuildersVideoPlayerProvider, { children: /* @__PURE__ */ jsx41(
1682
1769
  ControlBar_default,
1683
1770
  {
1684
1771
  id,
@@ -1736,6 +1823,7 @@ var VideoPlayerComponent = forwardRef(
1736
1823
  const [isHovered, setIsHovered] = useState14(false);
1737
1824
  const [isNoteOpen, setNoteOpen] = useState14(false);
1738
1825
  const [heightValue, setHeightValue] = useState14(0);
1826
+ const [isLoading, setIsloading] = useState14(false);
1739
1827
  const onReady = (player) => {
1740
1828
  if (playerRef) {
1741
1829
  playerRef.current = player;
@@ -1885,12 +1973,13 @@ var VideoPlayerComponent = forwardRef(
1885
1973
  setIsPaused,
1886
1974
  opacity,
1887
1975
  height,
1888
- heightValue
1976
+ heightValue,
1977
+ isLoading
1889
1978
  );
1890
1979
  }, 500);
1891
1980
  return () => clearTimeout(playButtonTimeout);
1892
1981
  }
1893
- }, [isPaused, opacity, isReady, id, height, heightValue]);
1982
+ }, [isPaused, opacity, isReady, id, height, heightValue, isLoading]);
1894
1983
  useEffect14(() => {
1895
1984
  if (playerRef.current) {
1896
1985
  const intervalId = setInterval(() => {
@@ -2020,7 +2109,27 @@ var VideoPlayerComponent = forwardRef(
2020
2109
  if (controlBar) {
2021
2110
  resizeObserver.observe(controlBar);
2022
2111
  }
2023
- return /* @__PURE__ */ jsx40(Fragment4, { children: /* @__PURE__ */ jsxs17(
2112
+ function debounce(func, delay) {
2113
+ let timeoutId;
2114
+ return function(arg) {
2115
+ if (timeoutId) {
2116
+ clearTimeout(timeoutId);
2117
+ }
2118
+ timeoutId = setTimeout(() => {
2119
+ func(arg);
2120
+ }, delay);
2121
+ };
2122
+ }
2123
+ if (playerRef.current) {
2124
+ playerRef.current.on("waiting", function() {
2125
+ console.log("The player is buffering...");
2126
+ debounce((arg) => setIsloading(arg), 300)(true);
2127
+ });
2128
+ playerRef.current.on("playing", function() {
2129
+ debounce((arg) => setIsloading(arg), 300)(false);
2130
+ });
2131
+ }
2132
+ return /* @__PURE__ */ jsx41(Fragment3, { children: /* @__PURE__ */ jsxs19(
2024
2133
  "div",
2025
2134
  {
2026
2135
  ref: videoRefs,
@@ -2032,7 +2141,7 @@ var VideoPlayerComponent = forwardRef(
2032
2141
  onMouseEnter: () => setIsHovered(true),
2033
2142
  onMouseLeave: () => setIsHovered(false),
2034
2143
  children: [
2035
- bottomRedBar && /* @__PURE__ */ jsx40(
2144
+ bottomRedBar && /* @__PURE__ */ jsx41(
2036
2145
  "div",
2037
2146
  {
2038
2147
  ref: childRef,
@@ -2043,12 +2152,12 @@ var VideoPlayerComponent = forwardRef(
2043
2152
  }
2044
2153
  }
2045
2154
  ),
2046
- /* @__PURE__ */ jsx40(
2155
+ /* @__PURE__ */ jsx41(
2047
2156
  "div",
2048
2157
  {
2049
2158
  className: "hover:sb-cursor-pointer sb-w-full sb-h-full",
2050
2159
  "data-vjs-player": true,
2051
- children: /* @__PURE__ */ jsx40(
2160
+ children: /* @__PURE__ */ jsx41(
2052
2161
  "div",
2053
2162
  {
2054
2163
  onClick: handlePlayerClick,
@@ -2068,7 +2177,7 @@ var VideoPlayerComponent_default = VideoPlayerComponent;
2068
2177
  // src/components/SoftBuildersVideoPlayer/index.tsx
2069
2178
  import { isEqual as isEqual2 } from "lodash";
2070
2179
  import { v4 as uuidv4 } from "uuid";
2071
- import { jsx as jsx41 } from "react/jsx-runtime";
2180
+ import { jsx as jsx42 } from "react/jsx-runtime";
2072
2181
  var DEFAULT_OPTIONS = {
2073
2182
  autoplay: false,
2074
2183
  controls: true,
@@ -2137,7 +2246,7 @@ var Component = forwardRef2(
2137
2246
  useEffect15(() => {
2138
2247
  setUuid(uuidv4());
2139
2248
  }, []);
2140
- return /* @__PURE__ */ jsx41(
2249
+ return /* @__PURE__ */ jsx42(
2141
2250
  VideoPlayerComponent_default,
2142
2251
  {
2143
2252
  id: uuid,
@@ -2160,7 +2269,7 @@ var Component = forwardRef2(
2160
2269
  }
2161
2270
  );
2162
2271
  var SoftBuildersVideoPlayer = memo(Component, (prevProps, nextProps) => {
2163
- return isEqual2(prevProps.options, nextProps.options) && prevProps.notes === nextProps.notes && prevProps.chapters === nextProps.chapters && prevProps.startTime === nextProps.startTime;
2272
+ return isEqual2(prevProps.options, nextProps.options) && prevProps.notes === nextProps.notes && prevProps.chapters === nextProps.chapters && prevProps.startTime === nextProps.startTime && prevProps.height === nextProps.height;
2164
2273
  });
2165
2274
  var SoftBuildersVideoPlayer_default = SoftBuildersVideoPlayer;
2166
2275