suada-components 1.2.0 → 1.3.0

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.
Files changed (86) hide show
  1. package/dist/components/Button/Button.js +1 -1
  2. package/dist/components/Button/Button.js.map +1 -1
  3. package/dist/components/{DailyMotion-BM__Vhyo.js → DailyMotion-BRR94A6R.js} +1 -1
  4. package/dist/components/{DailyMotion-CxLlr0cR.esm.js → DailyMotion-fTfJbAKR.esm.js} +1 -1
  5. package/dist/components/{Facebook-Zkq5Dmij.js → Facebook-BYAo-2rH.js} +1 -1
  6. package/dist/components/{Facebook-DjA6gknl.esm.js → Facebook-g8siL1GN.esm.js} +1 -1
  7. package/dist/components/{FilePlayer-C-z4wNAs.esm.js → FilePlayer--e_TvukB.esm.js} +1 -1
  8. package/dist/components/{FilePlayer-PgJJpyg0.js → FilePlayer-CBlW9Z-Z.js} +1 -1
  9. package/dist/components/{Kaltura-B50rwAlx.esm.js → Kaltura-CgG6fwG2.esm.js} +1 -1
  10. package/dist/components/{Kaltura-Btu7etAO.js → Kaltura-Cw4p4d7w.js} +1 -1
  11. package/dist/components/{Mixcloud-DCuoGh8X.esm.js → Mixcloud-1pcndu_p.esm.js} +1 -1
  12. package/dist/components/{Mixcloud-CpyWM87F.js → Mixcloud-FU7dfnB-.js} +1 -1
  13. package/dist/components/{Mux-DQjOzSHN.js → Mux-CFgk1TgE.js} +1 -1
  14. package/dist/components/{Mux-Bj4ELcFh.esm.js → Mux-bOE4IGCQ.esm.js} +1 -1
  15. package/dist/components/Pagination/Pagination.d.ts +1 -1
  16. package/dist/components/Pagination/Pagination.js +2 -2
  17. package/dist/components/Pagination/Pagination.js.map +1 -1
  18. package/dist/components/Pagination/Pagination.stories.js +2 -0
  19. package/dist/components/Pagination/Pagination.stories.js.map +1 -1
  20. package/dist/components/Pagination/pagination.interface.d.ts +1 -0
  21. package/dist/components/Pagination/styled-components.d.ts +3 -1
  22. package/dist/components/Pagination/styled-components.js +7 -1
  23. package/dist/components/Pagination/styled-components.js.map +1 -1
  24. package/dist/components/{Preview-M0CQw6-7.js → Preview-CFFnVBFk.js} +1 -1
  25. package/dist/components/{Preview-Cgl2b2Yo.esm.js → Preview-ZZ8yCxMr.esm.js} +1 -1
  26. package/dist/components/{SoundCloud-BQ1Bv-Ms.esm.js → SoundCloud-1OvUzexh.esm.js} +1 -1
  27. package/dist/components/{SoundCloud-D8ulCoOA.js → SoundCloud-BsdovEa4.js} +1 -1
  28. package/dist/components/{Streamable-C_gvjkdy.js → Streamable-C18bUmk1.js} +1 -1
  29. package/dist/components/{Streamable-DTv6vm7m.esm.js → Streamable-DkZbzMhq.esm.js} +1 -1
  30. package/dist/components/{Twitch-RxI4d-d5.js → Twitch-BwMnK2K5.js} +1 -1
  31. package/dist/components/{Twitch-BrQFLQcf.esm.js → Twitch-CAR5VDqo.esm.js} +1 -1
  32. package/dist/components/VideoPlayer/Controls/Controls.interface.d.ts +4 -0
  33. package/dist/components/VideoPlayer/Controls/Controls.js +87 -4
  34. package/dist/components/VideoPlayer/Controls/Controls.js.map +1 -1
  35. package/dist/components/VideoPlayer/Controls/Controls.styles.d.ts +1 -0
  36. package/dist/components/VideoPlayer/Controls/Controls.styles.js +6 -5
  37. package/dist/components/VideoPlayer/Controls/Controls.styles.js.map +1 -1
  38. package/dist/components/VideoPlayer/Player.d.ts +2 -1
  39. package/dist/components/VideoPlayer/Player.interface.d.ts +6 -1
  40. package/dist/components/VideoPlayer/Player.js +44 -23
  41. package/dist/components/VideoPlayer/Player.js.map +1 -1
  42. package/dist/components/VideoPlayer/Player.styles.d.ts +2 -0
  43. package/dist/components/VideoPlayer/Player.styles.js +21 -0
  44. package/dist/components/VideoPlayer/Player.styles.js.map +1 -1
  45. package/dist/components/VideoPlayer/VideoPlayer.stories.d.ts +3 -0
  46. package/dist/components/VideoPlayer/VideoPlayer.stories.js +35 -0
  47. package/dist/components/VideoPlayer/VideoPlayer.stories.js.map +1 -1
  48. package/dist/components/VideoPlayer/useHlsSubtitles.d.ts +12 -0
  49. package/dist/components/VideoPlayer/useHlsSubtitles.js +73 -0
  50. package/dist/components/VideoPlayer/useHlsSubtitles.js.map +1 -0
  51. package/dist/components/VideoPlayer/usePlayerControls.js +52 -41
  52. package/dist/components/VideoPlayer/usePlayerControls.js.map +1 -1
  53. package/dist/components/{Vidyard-BCPvgfz4.esm.js → Vidyard-Dj__VHEu.esm.js} +1 -1
  54. package/dist/components/{Vidyard-uAwNCpw7.js → Vidyard-DjdEjiba.js} +1 -1
  55. package/dist/components/{Vimeo-BfnFWKlr.js → Vimeo-B2sdU2eb.js} +1 -1
  56. package/dist/components/{Vimeo-Ocs8S_PZ.esm.js → Vimeo-B6eklZts.esm.js} +1 -1
  57. package/dist/components/{Wistia-DU_Kavg4.js → Wistia-D8WmgJRA.js} +1 -1
  58. package/dist/components/{Wistia-CjqtkoU1.esm.js → Wistia-T3lTN9f9.esm.js} +1 -1
  59. package/dist/components/{YouTube-uIBmVRVn.js → YouTube-DpQU6ZH9.js} +1 -1
  60. package/dist/components/{YouTube-CBwRsGZb.esm.js → YouTube-DvS99YSi.esm.js} +1 -1
  61. package/dist/components/components/Pagination/Pagination.d.ts +1 -1
  62. package/dist/components/components/Pagination/pagination.interface.d.ts +1 -0
  63. package/dist/components/components/Pagination/styled-components.d.ts +3 -1
  64. package/dist/components/components/VideoPlayer/Controls/Controls.interface.d.ts +4 -0
  65. package/dist/components/components/VideoPlayer/Controls/Controls.styles.d.ts +1 -0
  66. package/dist/components/components/VideoPlayer/Player.d.ts +2 -1
  67. package/dist/components/components/VideoPlayer/Player.interface.d.ts +6 -1
  68. package/dist/components/components/VideoPlayer/Player.styles.d.ts +2 -0
  69. package/dist/components/components/VideoPlayer/useHlsSubtitles.d.ts +12 -0
  70. package/dist/components/{index-KXbxnyZn.esm.js → index-C_u0zRwP.esm.js} +325 -127
  71. package/dist/components/{index-Dwz3FwAA.js → index-D4JJ3W7g.js} +325 -127
  72. package/dist/components/index.esm.js +1 -1
  73. package/dist/icons/DownloadIcon.js +2 -2
  74. package/dist/icons/DownloadIcon.js.map +1 -1
  75. package/dist/icons/components/Pagination/Pagination.d.ts +1 -1
  76. package/dist/icons/components/Pagination/pagination.interface.d.ts +1 -0
  77. package/dist/icons/components/Pagination/styled-components.d.ts +3 -1
  78. package/dist/icons/components/VideoPlayer/Controls/Controls.interface.d.ts +4 -0
  79. package/dist/icons/components/VideoPlayer/Controls/Controls.styles.d.ts +1 -0
  80. package/dist/icons/components/VideoPlayer/Player.d.ts +2 -1
  81. package/dist/icons/components/VideoPlayer/Player.interface.d.ts +6 -1
  82. package/dist/icons/components/VideoPlayer/Player.styles.d.ts +2 -0
  83. package/dist/icons/components/VideoPlayer/useHlsSubtitles.d.ts +12 -0
  84. package/dist/icons/index.esm.js +5 -3
  85. package/dist/main.js.map +1 -1
  86. package/package.json +1 -1
@@ -2425,7 +2425,7 @@ var Button$1 = function Button(_a) {
2425
2425
  style: customStyles,
2426
2426
  onClick: onClick,
2427
2427
  type: htmlType,
2428
- className: className,
2428
+ className: "".concat(className, " button-theme-color"),
2429
2429
  children: [iconLeft, label, iconRight]
2430
2430
  });
2431
2431
  };
@@ -32371,7 +32371,7 @@ var StylesCardWrapper = dt.div(templateObject_10$2 || (templateObject_10$2 = __m
32371
32371
  });
32372
32372
  var StyledChecked = dt.div(templateObject_11$2 || (templateObject_11$2 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n background-color: rgb(0 0 0 / 23%);\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n background-color: rgb(0 0 0 / 23%);\n"])));
32373
32373
  dt.div(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject(["\n position: relative;\n cursor: pointer;\n .icon_button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n"], ["\n position: relative;\n cursor: pointer;\n .icon_button {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n"])));
32374
- var CourseStatusContainer = dt.div(templateObject_13$1 || (templateObject_13$1 = __makeTemplateObject(["\n color: #fff;\n height: 32px;\n padding: 4px 12px;\n text-transform: capitalize;\n border-radius: 4px;\n background: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n color: #fff;\n height: 32px;\n padding: 4px 12px;\n text-transform: capitalize;\n border-radius: 4px;\n background: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_a) {
32374
+ var CourseStatusContainer = dt.div(templateObject_13$2 || (templateObject_13$2 = __makeTemplateObject(["\n color: #fff;\n height: 32px;\n padding: 4px 12px;\n text-transform: capitalize;\n border-radius: 4px;\n background: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n color: #fff;\n height: 32px;\n padding: 4px 12px;\n text-transform: capitalize;\n border-radius: 4px;\n background: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n"])), function (_a) {
32375
32375
  var $status = _a.$status;
32376
32376
  return !$status ? '#EA382A' : '#00905E';
32377
32377
  });
@@ -32426,7 +32426,7 @@ var GridItem = dt.div(templateObject_32 || (templateObject_32 = __makeTemplateOb
32426
32426
  var $isFromUser = _a.$isFromUser;
32427
32427
  return $isFromUser && "\n figure {\n position: relative;\n &:after {\n content: 'View Analytics';\n position: absolute;\n top: 0;\n opacity: 0;\n color: #06c68f;\n left: 0;\n font-size: 24px;\n font-weight: 700;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.9);\n width: 100%;\n height: 100%;\n transition: opacity 0.3s ease;\n z-index: 10;\n }\n }\n\n &:hover {\n figure {\n &:after {\n opacity: 1;\n }\n }\n }\n " || '';
32428
32428
  });
32429
- var templateObject_1$o, templateObject_2$j, templateObject_3$f, templateObject_4$c, templateObject_5$8, templateObject_6$7, templateObject_7$5, templateObject_8$4, templateObject_9$3, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$1, templateObject_14$1, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21$1, templateObject_22$1, templateObject_23$1, templateObject_24$1, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32;
32429
+ var templateObject_1$o, templateObject_2$j, templateObject_3$f, templateObject_4$c, templateObject_5$8, templateObject_6$7, templateObject_7$5, templateObject_8$4, templateObject_9$3, templateObject_10$2, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$1, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21$1, templateObject_22$1, templateObject_23$1, templateObject_24$1, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32;
32430
32430
 
32431
32431
  var TooltipHeight$1 = function TooltipHeight(_a) {
32432
32432
  var text = _a.text,
@@ -34740,7 +34740,9 @@ DocumentAttachment.displayName = 'DocumentAttachment';
34740
34740
  var DownloadIcon = /*#__PURE__*/forwardRef(function (_a, ref) {
34741
34741
  var className = _a.className,
34742
34742
  onClick = _a.onClick,
34743
- props = __rest(_a, ["className", "onClick"]);
34743
+ _b = _a.fill,
34744
+ fill = _b === void 0 ? '#FFFFFF' : _b,
34745
+ props = __rest(_a, ["className", "onClick", "fill"]);
34744
34746
  return jsxRuntimeExports.jsxs("svg", __assign({
34745
34747
  ref: ref,
34746
34748
  width: '24',
@@ -34753,10 +34755,10 @@ var DownloadIcon = /*#__PURE__*/forwardRef(function (_a, ref) {
34753
34755
  }, props, {
34754
34756
  children: [jsxRuntimeExports.jsx("path", {
34755
34757
  d: 'M19.5 18V21H4.5V18H3V21C3 21.3978 3.15804 21.7794 3.43934 22.0607C3.72064 22.342 4.10218 22.5 4.5 22.5H19.5C19.8978 22.5 20.2794 22.342 20.5607 22.0607C20.842 21.7794 21 21.3978 21 21V18H19.5Z',
34756
- fill: '#020210'
34758
+ fill: fill
34757
34759
  }), jsxRuntimeExports.jsx("path", {
34758
34760
  d: 'M19.5 10.5L18.4425 9.4425L12.75 15.1275V1.5H11.25V15.1275L5.5575 9.4425L4.5 10.5L12 18L19.5 10.5Z',
34759
- fill: '#020210'
34761
+ fill: fill
34760
34762
  })]
34761
34763
  }));
34762
34764
  });
@@ -42810,7 +42812,7 @@ var ItemContainer = dt.div(templateObject_11$1 || (templateObject_11$1 = __makeT
42810
42812
  return width || '100%';
42811
42813
  });
42812
42814
  dt.div(templateObject_12$1 || (templateObject_12$1 = __makeTemplateObject(["\n width: 390px;\n"], ["\n width: 390px;\n"])));
42813
- var CancelButton = dt.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n position: absolute;\n right: ", ";\n top: ", ";\n cursor: pointer;\n"], ["\n position: absolute;\n right: ", ";\n top: ", ";\n cursor: pointer;\n"])), function (_a) {
42815
+ var CancelButton = dt.div(templateObject_13$1 || (templateObject_13$1 = __makeTemplateObject(["\n position: absolute;\n right: ", ";\n top: ", ";\n cursor: pointer;\n"], ["\n position: absolute;\n right: ", ";\n top: ", ";\n cursor: pointer;\n"])), function (_a) {
42814
42816
  var right = _a.right;
42815
42817
  return right || '-13px';
42816
42818
  }, function (_a) {
@@ -42841,7 +42843,7 @@ var Title = dt.h2(templateObject_24 || (templateObject_24 = __makeTemplateObject
42841
42843
  var $required = _a.$required;
42842
42844
  return $required ? "\n &::after {\n content: '*';\n color: red;\n margin-left: 3px;\n }\n " : '';
42843
42845
  });
42844
- var templateObject_1$j, templateObject_2$e, templateObject_3$a, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$3, templateObject_8$2, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24;
42846
+ var templateObject_1$j, templateObject_2$e, templateObject_3$a, templateObject_4$7, templateObject_5$6, templateObject_6$5, templateObject_7$3, templateObject_8$2, templateObject_9$1, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24;
42845
42847
 
42846
42848
  var InsertDriveFile = {};
42847
42849
 
@@ -61137,7 +61139,13 @@ var Checkbox = function Checkbox(_a) {
61137
61139
  });
61138
61140
  };
61139
61141
 
61140
- var PaginationWrapper = dt.div(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 20px;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n\n .MuiPagination-ul {\n flex-wrap: nowrap;\n }\n .MuiPaginationItem-root {\n background: #ffffff;\n border: 1px solid #e7e9ed !important;\n border-radius: 4px !important;\n width: 32px !important;\n height: 32px !important;\n padding: 6px 6px !important;\n\n &:hover {\n border: 1px solid #cdccd0;\n background-color: #ffffff;\n }\n\n &.Mui-selected {\n background: #08c694;\n color: white;\n\n &:hover {\n background: #08c694;\n border: none;\n }\n }\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 20px;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n\n .MuiPagination-ul {\n flex-wrap: nowrap;\n }\n .MuiPaginationItem-root {\n background: #ffffff;\n border: 1px solid #e7e9ed !important;\n border-radius: 4px !important;\n width: 32px !important;\n height: 32px !important;\n padding: 6px 6px !important;\n\n &:hover {\n border: 1px solid #cdccd0;\n background-color: #ffffff;\n }\n\n &.Mui-selected {\n background: #08c694;\n color: white;\n\n &:hover {\n background: #08c694;\n border: none;\n }\n }\n }\n"])));
61142
+ var PaginationWrapper = dt.div(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 20px;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n\n .MuiPagination-ul {\n flex-wrap: nowrap;\n }\n .MuiPaginationItem-root {\n background: #ffffff;\n border: 1px solid #e7e9ed !important;\n border-radius: 4px !important;\n width: 32px !important;\n height: 32px !important;\n padding: 6px 6px !important;\n\n &:hover {\n border: 1px solid #cdccd0;\n background-color: #ffffff;\n }\n\n &.Mui-selected {\n background: ", ";\n color: white;\n\n &:hover {\n background: ", ";\n border: none;\n }\n }\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 20px;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n\n .MuiPagination-ul {\n flex-wrap: nowrap;\n }\n .MuiPaginationItem-root {\n background: #ffffff;\n border: 1px solid #e7e9ed !important;\n border-radius: 4px !important;\n width: 32px !important;\n height: 32px !important;\n padding: 6px 6px !important;\n\n &:hover {\n border: 1px solid #cdccd0;\n background-color: #ffffff;\n }\n\n &.Mui-selected {\n background: ", ";\n color: white;\n\n &:hover {\n background: ", ";\n border: none;\n }\n }\n }\n"])), function (_a) {
61143
+ var $themeColor = _a.$themeColor;
61144
+ return $themeColor || '#08c694';
61145
+ }, function (_a) {
61146
+ var $themeColor = _a.$themeColor;
61147
+ return $themeColor || '#08c694';
61148
+ });
61141
61149
  var templateObject_1$e;
61142
61150
 
61143
61151
  var Pagination = function Pagination(_a) {
@@ -61145,8 +61153,10 @@ var Pagination = function Pagination(_a) {
61145
61153
  totalPages = _a.totalPages,
61146
61154
  handleChange = _a.handleChange,
61147
61155
  perPage = _a.perPage,
61156
+ themeColor = _a.themeColor,
61148
61157
  handlePerPageChange = _a.handlePerPageChange;
61149
61158
  return jsxRuntimeExports.jsxs(PaginationWrapper, {
61159
+ "$themeColor": themeColor,
61150
61160
  children: [perPage && jsxRuntimeExports.jsxs(Select$1, {
61151
61161
  variant: 'standard',
61152
61162
  "native": true,
@@ -81389,7 +81399,7 @@ function requirePlayers () {
81389
81399
  canPlay: import_patterns.canPlay.youtube,
81390
81400
  lazyPlayer: (0, import_utils.lazy)(() => import(
81391
81401
  /* webpackChunkName: 'reactPlayerYouTube' */
81392
- './YouTube-CBwRsGZb.esm.js'
81402
+ './YouTube-DvS99YSi.esm.js'
81393
81403
  ).then(function (n) { return n.Y; }))
81394
81404
  },
81395
81405
  {
@@ -81398,7 +81408,7 @@ function requirePlayers () {
81398
81408
  canPlay: import_patterns.canPlay.soundcloud,
81399
81409
  lazyPlayer: (0, import_utils.lazy)(() => import(
81400
81410
  /* webpackChunkName: 'reactPlayerSoundCloud' */
81401
- './SoundCloud-BQ1Bv-Ms.esm.js'
81411
+ './SoundCloud-1OvUzexh.esm.js'
81402
81412
  ).then(function (n) { return n.S; }))
81403
81413
  },
81404
81414
  {
@@ -81407,7 +81417,7 @@ function requirePlayers () {
81407
81417
  canPlay: import_patterns.canPlay.vimeo,
81408
81418
  lazyPlayer: (0, import_utils.lazy)(() => import(
81409
81419
  /* webpackChunkName: 'reactPlayerVimeo' */
81410
- './Vimeo-Ocs8S_PZ.esm.js'
81420
+ './Vimeo-B6eklZts.esm.js'
81411
81421
  ).then(function (n) { return n.V; }))
81412
81422
  },
81413
81423
  {
@@ -81416,7 +81426,7 @@ function requirePlayers () {
81416
81426
  canPlay: import_patterns.canPlay.mux,
81417
81427
  lazyPlayer: (0, import_utils.lazy)(() => import(
81418
81428
  /* webpackChunkName: 'reactPlayerMux' */
81419
- './Mux-Bj4ELcFh.esm.js'
81429
+ './Mux-bOE4IGCQ.esm.js'
81420
81430
  ).then(function (n) { return n.M; }))
81421
81431
  },
81422
81432
  {
@@ -81425,7 +81435,7 @@ function requirePlayers () {
81425
81435
  canPlay: import_patterns.canPlay.facebook,
81426
81436
  lazyPlayer: (0, import_utils.lazy)(() => import(
81427
81437
  /* webpackChunkName: 'reactPlayerFacebook' */
81428
- './Facebook-DjA6gknl.esm.js'
81438
+ './Facebook-g8siL1GN.esm.js'
81429
81439
  ).then(function (n) { return n.F; }))
81430
81440
  },
81431
81441
  {
@@ -81434,7 +81444,7 @@ function requirePlayers () {
81434
81444
  canPlay: import_patterns.canPlay.streamable,
81435
81445
  lazyPlayer: (0, import_utils.lazy)(() => import(
81436
81446
  /* webpackChunkName: 'reactPlayerStreamable' */
81437
- './Streamable-DTv6vm7m.esm.js'
81447
+ './Streamable-DkZbzMhq.esm.js'
81438
81448
  ).then(function (n) { return n.S; }))
81439
81449
  },
81440
81450
  {
@@ -81443,7 +81453,7 @@ function requirePlayers () {
81443
81453
  canPlay: import_patterns.canPlay.wistia,
81444
81454
  lazyPlayer: (0, import_utils.lazy)(() => import(
81445
81455
  /* webpackChunkName: 'reactPlayerWistia' */
81446
- './Wistia-CjqtkoU1.esm.js'
81456
+ './Wistia-T3lTN9f9.esm.js'
81447
81457
  ).then(function (n) { return n.W; }))
81448
81458
  },
81449
81459
  {
@@ -81452,7 +81462,7 @@ function requirePlayers () {
81452
81462
  canPlay: import_patterns.canPlay.twitch,
81453
81463
  lazyPlayer: (0, import_utils.lazy)(() => import(
81454
81464
  /* webpackChunkName: 'reactPlayerTwitch' */
81455
- './Twitch-BrQFLQcf.esm.js'
81465
+ './Twitch-CAR5VDqo.esm.js'
81456
81466
  ).then(function (n) { return n.T; }))
81457
81467
  },
81458
81468
  {
@@ -81461,7 +81471,7 @@ function requirePlayers () {
81461
81471
  canPlay: import_patterns.canPlay.dailymotion,
81462
81472
  lazyPlayer: (0, import_utils.lazy)(() => import(
81463
81473
  /* webpackChunkName: 'reactPlayerDailyMotion' */
81464
- './DailyMotion-CxLlr0cR.esm.js'
81474
+ './DailyMotion-fTfJbAKR.esm.js'
81465
81475
  ).then(function (n) { return n.D; }))
81466
81476
  },
81467
81477
  {
@@ -81470,7 +81480,7 @@ function requirePlayers () {
81470
81480
  canPlay: import_patterns.canPlay.mixcloud,
81471
81481
  lazyPlayer: (0, import_utils.lazy)(() => import(
81472
81482
  /* webpackChunkName: 'reactPlayerMixcloud' */
81473
- './Mixcloud-DCuoGh8X.esm.js'
81483
+ './Mixcloud-1pcndu_p.esm.js'
81474
81484
  ).then(function (n) { return n.M; }))
81475
81485
  },
81476
81486
  {
@@ -81479,7 +81489,7 @@ function requirePlayers () {
81479
81489
  canPlay: import_patterns.canPlay.vidyard,
81480
81490
  lazyPlayer: (0, import_utils.lazy)(() => import(
81481
81491
  /* webpackChunkName: 'reactPlayerVidyard' */
81482
- './Vidyard-BCPvgfz4.esm.js'
81492
+ './Vidyard-Dj__VHEu.esm.js'
81483
81493
  ).then(function (n) { return n.V; }))
81484
81494
  },
81485
81495
  {
@@ -81488,7 +81498,7 @@ function requirePlayers () {
81488
81498
  canPlay: import_patterns.canPlay.kaltura,
81489
81499
  lazyPlayer: (0, import_utils.lazy)(() => import(
81490
81500
  /* webpackChunkName: 'reactPlayerKaltura' */
81491
- './Kaltura-B50rwAlx.esm.js'
81501
+ './Kaltura-CgG6fwG2.esm.js'
81492
81502
  ).then(function (n) { return n.K; }))
81493
81503
  },
81494
81504
  {
@@ -81500,7 +81510,7 @@ function requirePlayers () {
81500
81510
  },
81501
81511
  lazyPlayer: (0, import_utils.lazy)(() => import(
81502
81512
  /* webpackChunkName: 'reactPlayerFilePlayer' */
81503
- './FilePlayer-C-z4wNAs.esm.js'
81513
+ './FilePlayer--e_TvukB.esm.js'
81504
81514
  ).then(function (n) { return n.F; }))
81505
81515
  }
81506
81516
  ];
@@ -82321,7 +82331,7 @@ function requireReactPlayer () {
82321
82331
  var import_Player = __toESM(/*@__PURE__*/ requirePlayer());
82322
82332
  const Preview = (0, import_utils.lazy)(() => import(
82323
82333
  /* webpackChunkName: 'reactPlayerPreview' */
82324
- './Preview-Cgl2b2Yo.esm.js'
82334
+ './Preview-ZZ8yCxMr.esm.js'
82325
82335
  ).then(function (n) { return n.P; }));
82326
82336
  const IS_BROWSER = typeof window !== "undefined" && window.document && typeof document !== "undefined";
82327
82337
  const IS_GLOBAL = typeof commonjsGlobal !== "undefined" && commonjsGlobal.window && commonjsGlobal.window.document;
@@ -82540,6 +82550,27 @@ var StyledSubtitles = dt.div(templateObject_7$1 || (templateObject_7$1 = __makeT
82540
82550
  var $controls = _a.$controls;
82541
82551
  return $controls ? '60px' : '10px';
82542
82552
  });
82553
+ var HLS_SUBTITLE_STYLES = "\n /* Hide native HLS subtitles completely - comprehensive approach */\n video::cue {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n video::-webkit-media-text-track-display {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n video::cue-region {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n video::-webkit-media-text-track-container {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n /* Target ReactPlayer specifically */\n .react-player video::cue {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n .react-player video::-webkit-media-text-track-display {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n .react-player video::cue-region {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n .react-player video::-webkit-media-text-track-container {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n /* Additional selectors for different browsers */\n video::-moz-media-text-track-display {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n video::-ms-media-text-track-display {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n /* Hide any subtitle overlays */\n .react-player video + div[style*=\"position: absolute\"] {\n display: none !important;\n }\n \n /* Target HLS video player specifically */\n .hls-video-player::cue {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n .hls-video-player::-webkit-media-text-track-display {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n .hls-video-player::-webkit-media-text-track-container {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n \n .hls-video-player::cue-region {\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n }\n";
82554
+ var injectHLSSubtitleStyles = function injectHLSSubtitleStyles() {
82555
+ var addSubtitleStyles = function addSubtitleStyles() {
82556
+ var existingStyle = document.getElementById('hls-subtitle-styles');
82557
+ if (existingStyle) {
82558
+ existingStyle.remove();
82559
+ }
82560
+ var style = document.createElement('style');
82561
+ style.id = 'hls-subtitle-styles';
82562
+ style.textContent = HLS_SUBTITLE_STYLES;
82563
+ document.head.appendChild(style);
82564
+ };
82565
+ addSubtitleStyles();
82566
+ // Return cleanup function
82567
+ return function () {
82568
+ var existingStyle = document.getElementById('hls-subtitle-styles');
82569
+ if (existingStyle) {
82570
+ existingStyle.remove();
82571
+ }
82572
+ };
82573
+ };
82543
82574
  var templateObject_1$9, templateObject_2$7, templateObject_3$4, templateObject_4$2, templateObject_5$2, templateObject_6$2, templateObject_7$1;
82544
82575
 
82545
82576
  var StyledControls = dt.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n width: 100%;\n border-radius: 0px 0px 8px 8px;\n background: #565a62;\n padding: 12px 16px;\n position: relative;\n\n svg {\n cursor: pointer;\n\n @media screen and (max-width: 1500px) {\n width: 20px;\n height: 20px;\n }\n\n @media screen and (max-width: 1000px) {\n width: 16px;\n height: 16px;\n }\n }\n\n & > p {\n color: var(--neutral-colors-light);\n font-family: 'Poppins', sans-serif;\n ", "\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n width: 100%;\n border-radius: 0px 0px 8px 8px;\n background: #565a62;\n padding: 12px 16px;\n position: relative;\n\n svg {\n cursor: pointer;\n\n @media screen and (max-width: 1500px) {\n width: 20px;\n height: 20px;\n }\n\n @media screen and (max-width: 1000px) {\n width: 16px;\n height: 16px;\n }\n }\n\n & > p {\n color: var(--neutral-colors-light);\n font-family: 'Poppins', sans-serif;\n ", "\n }\n"])), {
@@ -82560,11 +82591,12 @@ var StyledTimeTrack = dt.div(templateObject_7 || (templateObject_7 = __makeTempl
82560
82591
  fontStyle: 'descriptor'
82561
82592
  });
82562
82593
  var StyledHeartIconContainer = dt.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > svg > path {\n fill: var(--neutral-colors-light);\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n\n & > svg > path {\n fill: var(--neutral-colors-light);\n }\n"])));
82563
- var StyledSubtitlesIconContainer = dt.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
82564
- var StyledFullscreenIconContainer = dt.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])));
82565
- var StyledVolumeIconContainer = dt.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])));
82566
- var StyledPlayPauseIconContainer = dt.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])));
82567
- var templateObject_1$8, templateObject_2$6, templateObject_3$3, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
82594
+ var StyledDownloadIconContainer = dt.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n & > svg {\n width: 24px !important;\n height: 24px !important;\n \n @media screen and (max-width: 1500px) {\n width: 20px !important;\n height: 20px !important;\n }\n\n @media screen and (max-width: 1000px) {\n width: 16px !important;\n height: 16px !important;\n }\n }\n\n & > svg > path {\n fill: #FFFFFF !important;\n transition: fill 0.2s ease;\n }\n\n &:hover > svg > path {\n fill: #08C694 !important;\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n\n & > svg {\n width: 24px !important;\n height: 24px !important;\n \n @media screen and (max-width: 1500px) {\n width: 20px !important;\n height: 20px !important;\n }\n\n @media screen and (max-width: 1000px) {\n width: 16px !important;\n height: 16px !important;\n }\n }\n\n & > svg > path {\n fill: #FFFFFF !important;\n transition: fill 0.2s ease;\n }\n\n &:hover > svg > path {\n fill: #08C694 !important;\n }\n"])));
82595
+ var StyledSubtitlesIconContainer = dt.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
82596
+ var StyledFullscreenIconContainer = dt.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])));
82597
+ var StyledVolumeIconContainer = dt.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])));
82598
+ var StyledPlayPauseIconContainer = dt.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])));
82599
+ var templateObject_1$8, templateObject_2$6, templateObject_3$3, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
82568
82600
 
82569
82601
  var PLAYBACK_SPEED_LIST = [{
82570
82602
  label: 'playback_speed.2x',
@@ -82778,7 +82810,60 @@ var Controls = function Controls(_a) {
82778
82810
  handleSkipForward = _a.handleSkipForward,
82779
82811
  isNextVideo = _a.isNextVideo,
82780
82812
  isPreviousVideo = _a.isPreviousVideo,
82781
- showFavorite = _a.showFavorite;
82813
+ showFavorite = _a.showFavorite,
82814
+ showDownload = _a.showDownload,
82815
+ downloadUrl = _a.downloadUrl,
82816
+ downloadFileName = _a.downloadFileName,
82817
+ onDownload = _a.onDownload;
82818
+ var handleDownloadClick = function handleDownloadClick() {
82819
+ return __awaiter(void 0, void 0, void 0, function () {
82820
+ var response, blob, blobUrl, link, error_1, link;
82821
+ return __generator(this, function (_a) {
82822
+ switch (_a.label) {
82823
+ case 0:
82824
+ if (!onDownload) return [3 /*break*/, 1];
82825
+ onDownload();
82826
+ return [3 /*break*/, 6];
82827
+ case 1:
82828
+ if (!downloadUrl) return [3 /*break*/, 6];
82829
+ _a.label = 2;
82830
+ case 2:
82831
+ _a.trys.push([2, 5,, 6]);
82832
+ return [4 /*yield*/, fetch(downloadUrl)];
82833
+ case 3:
82834
+ response = _a.sent();
82835
+ if (!response.ok) throw new Error('Download failed');
82836
+ return [4 /*yield*/, response.blob()];
82837
+ case 4:
82838
+ blob = _a.sent();
82839
+ blobUrl = window.URL.createObjectURL(blob);
82840
+ link = document.createElement('a');
82841
+ link.href = blobUrl;
82842
+ link.download = downloadFileName || 'video-download';
82843
+ link.style.display = 'none';
82844
+ document.body.appendChild(link);
82845
+ link.click();
82846
+ document.body.removeChild(link);
82847
+ // Clean up blob URL
82848
+ window.URL.revokeObjectURL(blobUrl);
82849
+ return [3 /*break*/, 6];
82850
+ case 5:
82851
+ error_1 = _a.sent();
82852
+ console.error('Download failed:', error_1);
82853
+ link = document.createElement('a');
82854
+ link.href = downloadUrl;
82855
+ link.download = downloadFileName || 'video-download';
82856
+ link.style.display = 'none';
82857
+ document.body.appendChild(link);
82858
+ link.click();
82859
+ document.body.removeChild(link);
82860
+ return [3 /*break*/, 6];
82861
+ case 6:
82862
+ return [2 /*return*/];
82863
+ }
82864
+ });
82865
+ });
82866
+ };
82782
82867
  return jsxRuntimeExports.jsxs(StyledControls, {
82783
82868
  children: [jsxRuntimeExports.jsx(StyledSlider, {
82784
82869
  type: 'range',
@@ -82828,6 +82913,10 @@ var Controls = function Controls(_a) {
82828
82913
  active: isFavorite,
82829
82914
  onClick: toggleIsFavorite
82830
82915
  })
82916
+ }), showDownload && downloadUrl && jsxRuntimeExports.jsx(StyledDownloadIconContainer, {
82917
+ children: jsxRuntimeExports.jsx(DownloadIcon, {
82918
+ onClick: handleDownloadClick
82919
+ })
82831
82920
  }), jsxRuntimeExports.jsx(PlaybackSpeedMenu, {
82832
82921
  playbackSpeed: playbackRate,
82833
82922
  onPlaybackSpeedChange: function onPlaybackSpeedChange(speed) {
@@ -88690,13 +88779,18 @@ function usePlayerControls(_a) {
88690
88779
  var duration = videoPlayerRef.current ? videoPlayerRef.current.getDuration() : 0;
88691
88780
  var formatCurrentTime = FormatSecondsToTimeString(currentTime);
88692
88781
  var formatDuration = FormatSecondsToTimeString(duration);
88782
+ // Using previous method for old videos(we used to parse subtitles via link)
88693
88783
  useEffect(function () {
88694
- fetch(subtitleUrl).then(function (response) {
88695
- return response.text();
88696
- }).then(function (content) {
88697
- var parsedSubtitles = parseVTT(content);
88698
- setSubtitles(parsedSubtitles);
88699
- });
88784
+ if (subtitleUrl) {
88785
+ fetch(subtitleUrl).then(function (response) {
88786
+ return response.text();
88787
+ }).then(function (content) {
88788
+ var parsedSubtitles = parseVTT(content);
88789
+ setSubtitles(parsedSubtitles);
88790
+ })["catch"](function (error) {
88791
+ console.error('Error fetching external subtitles:', error);
88792
+ });
88793
+ }
88700
88794
  }, [subtitleUrl]);
88701
88795
  useEffect(function () {
88702
88796
  var handleFullscreenChange = function handleFullscreenChange() {
@@ -88727,8 +88821,9 @@ function usePlayerControls(_a) {
88727
88821
  }, [videoPlayerRef]);
88728
88822
  var progressHandler = useCallback(function (state) {
88729
88823
  return __awaiter(_this, void 0, void 0, function () {
88730
- var currentSubtitleEntry, i, sub, i, sub, currentTime_1, now;
88731
- return __generator(this, function (_a) {
88824
+ var videoElement, hasHLSSubtitles, currentSubtitleEntry, i, sub, i, sub, currentTime_1, now;
88825
+ var _a, _b;
88826
+ return __generator(this, function (_c) {
88732
88827
  if (count > 2) {
88733
88828
  if (controlRef.current) {
88734
88829
  controlRef.current.style.visibility = 'hidden';
@@ -88737,44 +88832,47 @@ function usePlayerControls(_a) {
88737
88832
  } else if (controlRef.current && controlRef.current.style.visibility === 'visible' && isControlsActive) {
88738
88833
  count += 1;
88739
88834
  }
88740
- if (lastSubtitleIndexRef.current !== null) {
88741
- if (state.playedSeconds > lastPlaybackTimeRef.current) {
88742
- // Searching forward
88743
- for (i = lastSubtitleIndexRef.current; i < subtitles.length; i++) {
88744
- sub = subtitles[i];
88745
- if (state.playedSeconds >= sub.start && state.playedSeconds <= sub.end) {
88746
- currentSubtitleEntry = sub;
88747
- lastSubtitleIndexRef.current = i;
88748
- break;
88835
+ videoElement = (_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getInternalPlayer();
88836
+ hasHLSSubtitles = ((_b = videoElement === null || videoElement === void 0 ? void 0 : videoElement.textTracks) === null || _b === void 0 ? void 0 : _b.length) > 0;
88837
+ if (subtitles.length > 0 && !hasHLSSubtitles && isSubtitlesChecked) {
88838
+ currentSubtitleEntry = void 0;
88839
+ if (lastSubtitleIndexRef.current !== null) {
88840
+ if (state.playedSeconds > lastPlaybackTimeRef.current) {
88841
+ for (i = lastSubtitleIndexRef.current; i < subtitles.length; i++) {
88842
+ sub = subtitles[i];
88843
+ if (state.playedSeconds >= sub.start && state.playedSeconds <= sub.end) {
88844
+ currentSubtitleEntry = sub;
88845
+ lastSubtitleIndexRef.current = i;
88846
+ break;
88847
+ }
88749
88848
  }
88750
- }
88751
- } else {
88752
- // Searching backward
88753
- for (i = lastSubtitleIndexRef.current; i >= 0; i--) {
88754
- sub = subtitles[i];
88755
- if (state.playedSeconds >= sub.start && state.playedSeconds <= sub.end) {
88756
- currentSubtitleEntry = sub;
88757
- lastSubtitleIndexRef.current = i;
88758
- break;
88849
+ } else {
88850
+ for (i = lastSubtitleIndexRef.current; i >= 0; i--) {
88851
+ sub = subtitles[i];
88852
+ if (state.playedSeconds >= sub.start && state.playedSeconds <= sub.end) {
88853
+ currentSubtitleEntry = sub;
88854
+ lastSubtitleIndexRef.current = i;
88855
+ break;
88856
+ }
88759
88857
  }
88760
88858
  }
88761
88859
  }
88762
- }
88763
- if (!currentSubtitleEntry) {
88764
- currentSubtitleEntry = subtitles.find(function (sub) {
88765
- return state.playedSeconds >= sub.start && state.playedSeconds <= sub.end;
88766
- });
88860
+ if (!currentSubtitleEntry) {
88861
+ currentSubtitleEntry = subtitles.find(function (sub) {
88862
+ return state.playedSeconds >= sub.start && state.playedSeconds <= sub.end;
88863
+ });
88864
+ if (currentSubtitleEntry) {
88865
+ lastSubtitleIndexRef.current = subtitles.indexOf(currentSubtitleEntry);
88866
+ }
88867
+ }
88868
+ lastPlaybackTimeRef.current = state.playedSeconds;
88767
88869
  if (currentSubtitleEntry) {
88768
- lastSubtitleIndexRef.current = subtitles.indexOf(currentSubtitleEntry);
88870
+ setCurrentSubtitle(currentSubtitleEntry.text);
88871
+ } else {
88872
+ setCurrentSubtitle(''); // Clear subtitle if none should be displayed
88873
+ lastSubtitleIndexRef.current = null;
88769
88874
  }
88770
88875
  }
88771
- lastPlaybackTimeRef.current = state.playedSeconds;
88772
- if (currentSubtitleEntry) {
88773
- setCurrentSubtitle(currentSubtitleEntry.text);
88774
- } else {
88775
- setCurrentSubtitle(''); // Clear subtitle if none should be displayed
88776
- lastSubtitleIndexRef.current = null;
88777
- }
88778
88876
  if (!seeking) {
88779
88877
  setVideoState(function (prev) {
88780
88878
  return __assign(__assign({}, prev), state);
@@ -88790,7 +88888,7 @@ function usePlayerControls(_a) {
88790
88888
  return [2 /*return*/];
88791
88889
  });
88792
88890
  });
88793
- }, [seeking, handleTrackProgress, isControlsActive, subtitles]);
88891
+ }, [seeking, handleTrackProgress, isControlsActive, subtitles, isSubtitlesChecked]);
88794
88892
  var seekHandler = function seekHandler(e) {
88795
88893
  var v = parseFloat(e.target.value) / 100;
88796
88894
  setVideoState(function (prev) {
@@ -88802,7 +88900,7 @@ function usePlayerControls(_a) {
88802
88900
  videoPlayerRef.current.seekTo(v);
88803
88901
  }
88804
88902
  };
88805
- var seekMouseUpHandler = function seekMouseUpHandler(e) {
88903
+ var seekMouseUpHandler = function seekMouseUpHandler() {
88806
88904
  setVideoState(function (prev) {
88807
88905
  return __assign(__assign({}, prev), {
88808
88906
  seeking: false
@@ -88841,7 +88939,7 @@ function usePlayerControls(_a) {
88841
88939
  });
88842
88940
  }
88843
88941
  };
88844
- var onSeekMouseDownHandler = function onSeekMouseDownHandler(e) {
88942
+ var onSeekMouseDownHandler = function onSeekMouseDownHandler() {
88845
88943
  setVideoState(function (prev) {
88846
88944
  return __assign(__assign({}, prev), {
88847
88945
  seeking: true
@@ -88981,14 +89079,89 @@ function usePlayerControls(_a) {
88981
89079
  isFullscreen: isFullscreen,
88982
89080
  isControlsActive: isControlsActive,
88983
89081
  currentSubtitle: currentSubtitle,
89082
+ setCurrentSubtitle: setCurrentSubtitle,
88984
89083
  playing: isPlaying
88985
89084
  };
88986
89085
  }
88987
89086
 
89087
+ var useHLSSubtitles = function useHLSSubtitles(_a) {
89088
+ var videoPlayerRef = _a.videoPlayerRef,
89089
+ isSubtitlesChecked = _a.isSubtitlesChecked,
89090
+ setCurrentSubtitle = _a.setCurrentSubtitle;
89091
+ var hlsSubtitleTrackRef = useRef(null);
89092
+ var extractHLSSubtitleText = useCallback(function () {
89093
+ var _a;
89094
+ var videoElement = (_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getInternalPlayer();
89095
+ if (!videoElement || !videoElement.textTracks) return;
89096
+ var _loop_1 = function _loop_1(i) {
89097
+ var track = videoElement.textTracks[i];
89098
+ if (track.kind === 'subtitles' || track.kind === 'captions') {
89099
+ hlsSubtitleTrackRef.current = track;
89100
+ var handleCueChange = function handleCueChange() {
89101
+ if (isSubtitlesChecked && track.activeCues && track.activeCues.length > 0) {
89102
+ var currentCue = track.activeCues[0];
89103
+ if (currentCue && currentCue.text) {
89104
+ setCurrentSubtitle(currentCue.text);
89105
+ }
89106
+ } else if (isSubtitlesChecked) {
89107
+ setCurrentSubtitle('');
89108
+ }
89109
+ };
89110
+ track.removeEventListener('cuechange', handleCueChange);
89111
+ track.addEventListener('cuechange', handleCueChange);
89112
+ track.mode = isSubtitlesChecked ? 'showing' : 'hidden';
89113
+ return "break";
89114
+ }
89115
+ };
89116
+ for (var i = 0; i < videoElement.textTracks.length; i++) {
89117
+ var state_1 = _loop_1(i);
89118
+ if (state_1 === "break") break;
89119
+ }
89120
+ }, [isSubtitlesChecked, setCurrentSubtitle, videoPlayerRef]);
89121
+ var setupHLSSubtitleTracking = useCallback(function () {
89122
+ var _a;
89123
+ var videoElement = (_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getInternalPlayer();
89124
+ if (!videoElement) return;
89125
+ videoElement.classList.add('hls-video-player');
89126
+ var _checkTextTracks = function checkTextTracks(attempt) {
89127
+ if (attempt === void 0) {
89128
+ attempt = 0;
89129
+ }
89130
+ var textTracks = videoElement.textTracks;
89131
+ if (textTracks && textTracks.length > 0) {
89132
+ extractHLSSubtitleText();
89133
+ } else if (attempt < 5) {
89134
+ setTimeout(function () {
89135
+ return _checkTextTracks(attempt + 1);
89136
+ }, 300 * (attempt + 1));
89137
+ }
89138
+ };
89139
+ _checkTextTracks();
89140
+ videoElement.addEventListener('loadedmetadata', function () {
89141
+ _checkTextTracks();
89142
+ });
89143
+ }, [extractHLSSubtitleText, videoPlayerRef]);
89144
+ useEffect(function () {
89145
+ extractHLSSubtitleText();
89146
+ }, [isSubtitlesChecked, extractHLSSubtitleText]);
89147
+ useEffect(function () {
89148
+ var _a;
89149
+ var videoElement = (_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getInternalPlayer();
89150
+ if (videoElement && videoElement.textTracks && videoElement.textTracks.length > 0) {
89151
+ extractHLSSubtitleText();
89152
+ }
89153
+ }, [videoPlayerRef.current, extractHLSSubtitleText]);
89154
+ return {
89155
+ extractHLSSubtitleText: extractHLSSubtitleText,
89156
+ setupHLSSubtitleTracking: setupHLSSubtitleTracking
89157
+ };
89158
+ };
89159
+
88988
89160
  var VideoPlayer = function VideoPlayer(_a) {
89161
+ var _b, _c, _d;
88989
89162
  var customStyles = _a.customStyles,
88990
- _b = _a.startTime,
88991
- startTime = _b === void 0 ? 0 : _b,
89163
+ _e = _a.startTime,
89164
+ startTime = _e === void 0 ? 0 : _e,
88992
89165
  loading = _a.loading,
88993
89166
  setLoading = _a.setLoading,
88994
89167
  handleTrackProgress = _a.handleTrackProgress,
@@ -89000,20 +89173,25 @@ var VideoPlayer = function VideoPlayer(_a) {
89000
89173
  isPreviousVideo = _a.isPreviousVideo,
89001
89174
  isPlaying = _a.isPlaying,
89002
89175
  setIsPlaying = _a.setIsPlaying,
89003
- _c = _a.shouldPlayerBeFocusedOnSpaceClick,
89004
- shouldPlayerBeFocusedOnSpaceClick = _c === void 0 ? false : _c,
89176
+ _f = _a.shouldPlayerBeFocusedOnSpaceClick,
89177
+ shouldPlayerBeFocusedOnSpaceClick = _f === void 0 ? false : _f,
89005
89178
  showFavorite = _a.showFavorite,
89006
- _d = _a.isFavorite,
89007
- isFavorite = _d === void 0 ? false : _d,
89008
- _e = _a.toggleFavorite,
89009
- toggleFavorite = _e === void 0 ? function () {
89179
+ _g = _a.isFavorite,
89180
+ isFavorite = _g === void 0 ? false : _g,
89181
+ _h = _a.toggleFavorite,
89182
+ toggleFavorite = _h === void 0 ? function () {
89010
89183
  return __awaiter(void 0, void 0, void 0, function () {
89011
89184
  return __generator(this, function (_a) {
89012
89185
  return [2 /*return*/];
89013
89186
  });
89014
89187
  });
89015
- } : _e;
89016
- var _f = usePlayerControls({
89188
+ } : _h,
89189
+ showDownload = _a.showDownload,
89190
+ downloadUrl = _a.downloadUrl,
89191
+ downloadFileName = _a.downloadFileName,
89192
+ onDownload = _a.onDownload;
89193
+ var videoRef = useRef(null);
89194
+ var _j = usePlayerControls({
89017
89195
  startTime: startTime,
89018
89196
  setLoading: setLoading,
89019
89197
  handleTrackProgress: handleTrackProgress,
@@ -89023,38 +89201,55 @@ var VideoPlayer = function VideoPlayer(_a) {
89023
89201
  setIsPlaying: setIsPlaying,
89024
89202
  shouldPlayerBeFocusedOnSpaceClick: shouldPlayerBeFocusedOnSpaceClick
89025
89203
  }),
89026
- mouseMoveHandler = _f.mouseMoveHandler,
89027
- playerContainerRef = _f.playerContainerRef,
89028
- playPauseHandler = _f.playPauseHandler,
89029
- handleFullScreen = _f.handleFullScreen,
89030
- videoPlayerRef = _f.videoPlayerRef,
89031
- playing = _f.playing,
89032
- volume = _f.volume,
89033
- muted = _f.muted,
89034
- progressHandler = _f.progressHandler,
89035
- bufferStartHandler = _f.bufferStartHandler,
89036
- bufferEndHandler = _f.bufferEndHandler,
89037
- onPlayerStart = _f.onPlayerStart,
89038
- setVideoState = _f.setVideoState,
89039
- playbackRate = _f.playbackRate,
89040
- controlRef = _f.controlRef,
89041
- rewindHandler = _f.rewindHandler,
89042
- handleFastForward = _f.handleFastForward,
89043
- formatCurrentTime = _f.formatCurrentTime,
89044
- played = _f.played,
89045
- onSeekMouseDownHandler = _f.onSeekMouseDownHandler,
89046
- seekHandler = _f.seekHandler,
89047
- seekMouseUpHandler = _f.seekMouseUpHandler,
89048
- muteHandler = _f.muteHandler,
89049
- volumeChangeHandler = _f.volumeChangeHandler,
89050
- formatDuration = _f.formatDuration,
89051
- isSubtitlesChecked = _f.isSubtitlesChecked,
89052
- toggleSubtitlesCheck = _f.toggleSubtitlesCheck,
89053
- isFullscreen = _f.isFullscreen,
89054
- isControlsActive = _f.isControlsActive,
89055
- currentSubtitle = _f.currentSubtitle;
89056
- // Make sure we have a valid URL to avoid ReactPlayer errors
89057
- var validUrl = url || '';
89204
+ mouseMoveHandler = _j.mouseMoveHandler,
89205
+ playerContainerRef = _j.playerContainerRef,
89206
+ playPauseHandler = _j.playPauseHandler,
89207
+ handleFullScreen = _j.handleFullScreen,
89208
+ videoPlayerRef = _j.videoPlayerRef,
89209
+ playing = _j.playing,
89210
+ volume = _j.volume,
89211
+ muted = _j.muted,
89212
+ progressHandler = _j.progressHandler,
89213
+ bufferStartHandler = _j.bufferStartHandler,
89214
+ bufferEndHandler = _j.bufferEndHandler,
89215
+ onPlayerStart = _j.onPlayerStart,
89216
+ setVideoState = _j.setVideoState,
89217
+ playbackRate = _j.playbackRate,
89218
+ controlRef = _j.controlRef,
89219
+ rewindHandler = _j.rewindHandler,
89220
+ handleFastForward = _j.handleFastForward,
89221
+ formatCurrentTime = _j.formatCurrentTime,
89222
+ played = _j.played,
89223
+ onSeekMouseDownHandler = _j.onSeekMouseDownHandler,
89224
+ seekHandler = _j.seekHandler,
89225
+ seekMouseUpHandler = _j.seekMouseUpHandler,
89226
+ muteHandler = _j.muteHandler,
89227
+ volumeChangeHandler = _j.volumeChangeHandler,
89228
+ formatDuration = _j.formatDuration,
89229
+ isSubtitlesChecked = _j.isSubtitlesChecked,
89230
+ toggleSubtitlesCheck = _j.toggleSubtitlesCheck,
89231
+ isFullscreen = _j.isFullscreen,
89232
+ isControlsActive = _j.isControlsActive,
89233
+ currentSubtitle = _j.currentSubtitle,
89234
+ setCurrentSubtitle = _j.setCurrentSubtitle;
89235
+ var setupHLSSubtitleTracking = useHLSSubtitles({
89236
+ videoPlayerRef: videoPlayerRef,
89237
+ isSubtitlesChecked: isSubtitlesChecked,
89238
+ setCurrentSubtitle: setCurrentSubtitle
89239
+ }).setupHLSSubtitleTracking;
89240
+ useEffect(function () {
89241
+ var cleanup = injectHLSSubtitleStyles();
89242
+ return cleanup;
89243
+ }, []);
89244
+ var handlePlayerReady = function handlePlayerReady() {
89245
+ var _a;
89246
+ onPlayerStart();
89247
+ setupHLSSubtitleTracking();
89248
+ var videoElement = (_a = videoPlayerRef.current) === null || _a === void 0 ? void 0 : _a.getInternalPlayer();
89249
+ if (videoElement && videoElement instanceof HTMLVideoElement) {
89250
+ videoRef.current = videoElement;
89251
+ }
89252
+ };
89058
89253
  return jsxRuntimeExports.jsxs(StyledWrapper, {
89059
89254
  tabIndex: 0,
89060
89255
  onMouseMove: mouseMoveHandler,
@@ -89063,12 +89258,11 @@ var VideoPlayer = function VideoPlayer(_a) {
89063
89258
  onClick: function onClick(e) {
89064
89259
  return e.stopPropagation();
89065
89260
  },
89066
- "data-testid": 'video-player-wrapper',
89067
- children: [jsxRuntimeExports.jsx(StyledVideoPlayerWrapper, {
89261
+ children: [jsxRuntimeExports.jsxs(StyledVideoPlayerWrapper, {
89068
89262
  onClick: playPauseHandler,
89069
89263
  onDoubleClick: handleFullScreen,
89070
- children: jsxRuntimeExports.jsx(ReactPlayer, {
89071
- url: validUrl,
89264
+ children: [jsxRuntimeExports.jsx(ReactPlayer, {
89265
+ url: url,
89072
89266
  ref: videoPlayerRef,
89073
89267
  className: 'react-player',
89074
89268
  width: '100%',
@@ -89079,7 +89273,7 @@ var VideoPlayer = function VideoPlayer(_a) {
89079
89273
  onProgress: progressHandler,
89080
89274
  onBuffer: bufferStartHandler,
89081
89275
  onBufferEnd: bufferEndHandler,
89082
- onReady: onPlayerStart,
89276
+ onReady: handlePlayerReady,
89083
89277
  onPlay: function onPlay() {
89084
89278
  return setIsPlaying(true);
89085
89279
  },
@@ -89107,13 +89301,16 @@ var VideoPlayer = function VideoPlayer(_a) {
89107
89301
  file: {
89108
89302
  hlsOptions: {
89109
89303
  autoStartLoad: true,
89110
- renderTextTracksNatively: false
89304
+ renderTextTracksNatively: true
89111
89305
  }
89112
89306
  }
89113
89307
  }
89114
- }, validUrl)
89115
- }), loading && jsxRuntimeExports.jsx(StyledPlayerLoader, {
89116
- children: jsxRuntimeExports.jsx(StyledLoader, {})
89308
+ }, url), loading && jsxRuntimeExports.jsx(StyledPlayerLoader, {
89309
+ children: jsxRuntimeExports.jsx(StyledLoader, {})
89310
+ }), isSubtitlesChecked && currentSubtitle && jsxRuntimeExports.jsx(StyledSubtitles, {
89311
+ "$controls": isControlsActive,
89312
+ children: currentSubtitle
89313
+ })]
89117
89314
  }), jsxRuntimeExports.jsx(StyledControlsContainer, {
89118
89315
  ref: controlRef,
89119
89316
  children: jsxRuntimeExports.jsx(Controls, {
@@ -89139,16 +89336,17 @@ var VideoPlayer = function VideoPlayer(_a) {
89139
89336
  isFavorite: isFavorite,
89140
89337
  toggleIsFavorite: toggleFavorite,
89141
89338
  isFullscreen: isFullscreen,
89142
- subtitle: !!subtitleUrl,
89339
+ subtitle: !!subtitleUrl || ((_d = (_c = (_b = videoPlayerRef.current) === null || _b === void 0 ? void 0 : _b.getInternalPlayer()) === null || _c === void 0 ? void 0 : _c.textTracks) === null || _d === void 0 ? void 0 : _d.length) > 0,
89143
89340
  handleSkipBackward: handlePreviousVideo,
89144
89341
  handleSkipForward: handleNextVideo,
89145
89342
  isNextVideo: isNextVideo,
89146
89343
  isPreviousVideo: isPreviousVideo,
89147
- showFavorite: showFavorite
89344
+ showFavorite: showFavorite,
89345
+ showDownload: showDownload,
89346
+ downloadUrl: downloadUrl,
89347
+ downloadFileName: downloadFileName,
89348
+ onDownload: onDownload
89148
89349
  })
89149
- }), isSubtitlesChecked && currentSubtitle && jsxRuntimeExports.jsx(StyledSubtitles, {
89150
- "$controls": isControlsActive,
89151
- children: currentSubtitle
89152
89350
  })]
89153
89351
  });
89154
89352
  };