@locpd/vidstack 1.12.14

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 (242) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/analyze.json.d.ts +8 -0
  4. package/bundle.d.ts +1 -0
  5. package/cdn/chunks/vidstack-2f5gzOW6.js +1 -0
  6. package/cdn/chunks/vidstack-BYgY9wmd.js +1 -0
  7. package/cdn/chunks/vidstack-BfBBPhXV.js +1 -0
  8. package/cdn/chunks/vidstack-Bjo5esRp.js +1 -0
  9. package/cdn/chunks/vidstack-BuL67v3q.js +1 -0
  10. package/cdn/chunks/vidstack-C0msPRTd.js +3 -0
  11. package/cdn/chunks/vidstack-CJNLoJPa.js +1 -0
  12. package/cdn/chunks/vidstack-CQSpZ7X8.js +16 -0
  13. package/cdn/chunks/vidstack-C_AxqLKV.js +1 -0
  14. package/cdn/chunks/vidstack-CioT3Yw2.js +1 -0
  15. package/cdn/chunks/vidstack-CrqkytHl.js +1 -0
  16. package/cdn/chunks/vidstack-D0M8R0ZU.js +1 -0
  17. package/cdn/chunks/vidstack-D40FSa5B.js +3 -0
  18. package/cdn/chunks/vidstack-DD2JwFVU.js +1 -0
  19. package/cdn/chunks/vidstack-DRH_1tFW.js +1 -0
  20. package/cdn/chunks/vidstack-DfDZuHNP.js +1 -0
  21. package/cdn/chunks/vidstack-DiNS2Vx5.js +1 -0
  22. package/cdn/chunks/vidstack-xjJ-ui_l.js +1 -0
  23. package/cdn/providers/vidstack-audio-2Dt_Ivbp.js +1 -0
  24. package/cdn/providers/vidstack-dash-CUtD4e6q.js +1 -0
  25. package/cdn/providers/vidstack-google-cast-BdORATUX.js +1 -0
  26. package/cdn/providers/vidstack-hls-R25Kb6DP.js +1 -0
  27. package/cdn/providers/vidstack-html-DaAUJYsD.js +1 -0
  28. package/cdn/providers/vidstack-video-Csvox7SO.js +1 -0
  29. package/cdn/providers/vidstack-vimeo-D4Z96kg2.js +1 -0
  30. package/cdn/providers/vidstack-youtube-DiND6h3s.js +1 -0
  31. package/cdn/vidstack.js +1 -0
  32. package/cdn/with-layouts/chunks/vidstack-2f5gzOW6.js +1 -0
  33. package/cdn/with-layouts/chunks/vidstack-45yH5los.js +1 -0
  34. package/cdn/with-layouts/chunks/vidstack-BBVMdOnf.js +1 -0
  35. package/cdn/with-layouts/chunks/vidstack-BB_ulI_T.js +1 -0
  36. package/cdn/with-layouts/chunks/vidstack-BcAewM33.js +1 -0
  37. package/cdn/with-layouts/chunks/vidstack-BfBBPhXV.js +1 -0
  38. package/cdn/with-layouts/chunks/vidstack-Bxv1Qnxe.js +1 -0
  39. package/cdn/with-layouts/chunks/vidstack-C2ZbG62f.js +3 -0
  40. package/cdn/with-layouts/chunks/vidstack-CCYIOKgL.js +1 -0
  41. package/cdn/with-layouts/chunks/vidstack-CL6PeIO1.js +1 -0
  42. package/cdn/with-layouts/chunks/vidstack-C_AxqLKV.js +1 -0
  43. package/cdn/with-layouts/chunks/vidstack-CifDkwDH.js +795 -0
  44. package/cdn/with-layouts/chunks/vidstack-Cry7aD59.js +3 -0
  45. package/cdn/with-layouts/chunks/vidstack-D065okCn.js +1 -0
  46. package/cdn/with-layouts/chunks/vidstack-DGuMoXmI.js +1 -0
  47. package/cdn/with-layouts/chunks/vidstack-DRH_1tFW.js +1 -0
  48. package/cdn/with-layouts/chunks/vidstack-DVBs1XoQ.js +1 -0
  49. package/cdn/with-layouts/chunks/vidstack-Dge3KT8k.js +1 -0
  50. package/cdn/with-layouts/chunks/vidstack-DiNS2Vx5.js +1 -0
  51. package/cdn/with-layouts/chunks/vidstack-HvYfJoen.js +1 -0
  52. package/cdn/with-layouts/providers/vidstack-audio-DE5vKIzW.js +1 -0
  53. package/cdn/with-layouts/providers/vidstack-dash-CA2agUuZ.js +1 -0
  54. package/cdn/with-layouts/providers/vidstack-google-cast-CGs-t8HM.js +1 -0
  55. package/cdn/with-layouts/providers/vidstack-hls-BHMbMFFR.js +1 -0
  56. package/cdn/with-layouts/providers/vidstack-html-Dm9gmNk6.js +1 -0
  57. package/cdn/with-layouts/providers/vidstack-video-C5it_Lbl.js +1 -0
  58. package/cdn/with-layouts/providers/vidstack-vimeo-BabLn9sy.js +1 -0
  59. package/cdn/with-layouts/providers/vidstack-youtube-D8UlccUL.js +1 -0
  60. package/cdn/with-layouts/vidstack.js +1 -0
  61. package/dev/chunks/vidstack-B7Zi3v_O.js +104 -0
  62. package/dev/chunks/vidstack-BFg1ZqiG.js +91 -0
  63. package/dev/chunks/vidstack-BGB2pa9s.js +58 -0
  64. package/dev/chunks/vidstack-BaIbHZE3.js +1519 -0
  65. package/dev/chunks/vidstack-Bb2rASIc.js +5188 -0
  66. package/dev/chunks/vidstack-Bcmx8pmK.js +224 -0
  67. package/dev/chunks/vidstack-Bl4b0Nen.js +29 -0
  68. package/dev/chunks/vidstack-Bo5OTJ06.js +58 -0
  69. package/dev/chunks/vidstack-BoAGnlRt.js +58 -0
  70. package/dev/chunks/vidstack-Bpr4fI4n.js +7 -0
  71. package/dev/chunks/vidstack-Bt8MP2DK.js +204 -0
  72. package/dev/chunks/vidstack-Bu2kfzUd.js +1637 -0
  73. package/dev/chunks/vidstack-C-ffXlSV.js +2995 -0
  74. package/dev/chunks/vidstack-C-ztJq-f.js +109 -0
  75. package/dev/chunks/vidstack-CFNlaVTR.js +55 -0
  76. package/dev/chunks/vidstack-C_l97D5j.js +254 -0
  77. package/dev/chunks/vidstack-CjhKISI0.js +114 -0
  78. package/dev/chunks/vidstack-CofXIJAy.js +57 -0
  79. package/dev/chunks/vidstack-CwTj4H1w.js +18 -0
  80. package/dev/chunks/vidstack-DDwbYVHV.js +66 -0
  81. package/dev/chunks/vidstack-DFImIcIL.js +11 -0
  82. package/dev/chunks/vidstack-DGDvUbvO.js +33 -0
  83. package/dev/chunks/vidstack-DO0kqA99.js +107 -0
  84. package/dev/chunks/vidstack-DXxIKXmd.js +50 -0
  85. package/dev/chunks/vidstack-DajrMUR0.js +297 -0
  86. package/dev/chunks/vidstack-DbBJlz7I.js +10 -0
  87. package/dev/chunks/vidstack-Dihypf8P.js +11 -0
  88. package/dev/chunks/vidstack-DlAhl87f.js +1193 -0
  89. package/dev/chunks/vidstack-Dm1xEU9Q.js +34 -0
  90. package/dev/chunks/vidstack-Dv_LIPFu.js +14 -0
  91. package/dev/chunks/vidstack-igYn0Apa.js +254 -0
  92. package/dev/chunks/vidstack-krOAtKMi.js +32 -0
  93. package/dev/chunks/vidstack-qh1N5_f_.js +26 -0
  94. package/dev/chunks/vidstack-rB-wqXw1.js +107 -0
  95. package/dev/chunks/vidstack-zG6PIeGg.js +66 -0
  96. package/dev/define/plyr-layout.js +51 -0
  97. package/dev/define/templates/plyr-layout.js +571 -0
  98. package/dev/define/templates/vidstack-audio-layout.js +167 -0
  99. package/dev/define/templates/vidstack-video-layout.js +390 -0
  100. package/dev/define/vidstack-icons.js +1 -0
  101. package/dev/define/vidstack-player-default-layout.js +21 -0
  102. package/dev/define/vidstack-player-layouts.js +25 -0
  103. package/dev/define/vidstack-player-ui.js +70 -0
  104. package/dev/define/vidstack-player.js +19 -0
  105. package/dev/global/plyr.js +501 -0
  106. package/dev/global/vidstack-player.js +129 -0
  107. package/dev/providers/vidstack-audio.js +35 -0
  108. package/dev/providers/vidstack-dash.js +516 -0
  109. package/dev/providers/vidstack-google-cast.js +474 -0
  110. package/dev/providers/vidstack-hls.js +408 -0
  111. package/dev/providers/vidstack-html.js +567 -0
  112. package/dev/providers/vidstack-video.js +207 -0
  113. package/dev/providers/vidstack-vimeo.js +554 -0
  114. package/dev/providers/vidstack-youtube.js +286 -0
  115. package/dev/vidstack-elements.js +36 -0
  116. package/dev/vidstack.js +91 -0
  117. package/dom.d.ts +91 -0
  118. package/elements.d.ts +1433 -0
  119. package/empty.vtt +1 -0
  120. package/global/player.d.ts +52 -0
  121. package/global/plyr.d.ts +343 -0
  122. package/google-cast.d.ts +1422 -0
  123. package/icons.d.ts +1 -0
  124. package/index.d.ts +402 -0
  125. package/package.json +199 -0
  126. package/player/index.d.ts +3 -0
  127. package/player/layouts/default.d.ts +3 -0
  128. package/player/layouts/index.d.ts +3 -0
  129. package/player/layouts/plyr.d.ts +3 -0
  130. package/player/styles/base.css +153 -0
  131. package/player/styles/default/buffering.css +55 -0
  132. package/player/styles/default/buttons.css +175 -0
  133. package/player/styles/default/captions.css +181 -0
  134. package/player/styles/default/chapter-title.css +26 -0
  135. package/player/styles/default/controls.css +56 -0
  136. package/player/styles/default/gestures.css +19 -0
  137. package/player/styles/default/icons.css +6 -0
  138. package/player/styles/default/keyboard.css +148 -0
  139. package/player/styles/default/layouts/audio.css +417 -0
  140. package/player/styles/default/layouts/video.css +590 -0
  141. package/player/styles/default/menus.css +959 -0
  142. package/player/styles/default/poster.css +52 -0
  143. package/player/styles/default/sliders.css +391 -0
  144. package/player/styles/default/theme.css +2461 -0
  145. package/player/styles/default/thumbnail.css +40 -0
  146. package/player/styles/default/time.css +45 -0
  147. package/player/styles/default/tooltips.css +141 -0
  148. package/player/styles/plyr/theme.css +1237 -0
  149. package/player/ui.d.ts +3 -0
  150. package/plugins.d.ts +19 -0
  151. package/plugins.js +13 -0
  152. package/prod/chunks/vidstack-B01xzxC4.js +7 -0
  153. package/prod/chunks/vidstack-BCeb7ryV.js +201 -0
  154. package/prod/chunks/vidstack-BGSTndAW.js +1590 -0
  155. package/prod/chunks/vidstack-BPitBBjh.js +1519 -0
  156. package/prod/chunks/vidstack-BQlOPwOu.js +45 -0
  157. package/prod/chunks/vidstack-BSDzlwxO.js +4778 -0
  158. package/prod/chunks/vidstack-BT0m6zEi.js +109 -0
  159. package/prod/chunks/vidstack-BTigPj2h.js +55 -0
  160. package/prod/chunks/vidstack-BiyXcJ_M.js +107 -0
  161. package/prod/chunks/vidstack-BoVf5n1M.js +2985 -0
  162. package/prod/chunks/vidstack-Bq6c3Bam.js +58 -0
  163. package/prod/chunks/vidstack-ByLCIBtB.js +297 -0
  164. package/prod/chunks/vidstack-C2US-gSO.js +248 -0
  165. package/prod/chunks/vidstack-C9vIqaYT.js +10 -0
  166. package/prod/chunks/vidstack-CF6fixCQ.js +1193 -0
  167. package/prod/chunks/vidstack-CTojmhKq.js +66 -0
  168. package/prod/chunks/vidstack-ChQTHmIQ.js +77 -0
  169. package/prod/chunks/vidstack-Cm6_unwd.js +246 -0
  170. package/prod/chunks/vidstack-CwTj4H1w.js +18 -0
  171. package/prod/chunks/vidstack-D3ltXc3a.js +33 -0
  172. package/prod/chunks/vidstack-D5EzK014.js +14 -0
  173. package/prod/chunks/vidstack-DDXt6fpN.js +58 -0
  174. package/prod/chunks/vidstack-DJDnh4xT.js +11 -0
  175. package/prod/chunks/vidstack-DXxIKXmd.js +50 -0
  176. package/prod/chunks/vidstack-D_-9AA6_.js +29 -0
  177. package/prod/chunks/vidstack-DbkZGjSn.js +107 -0
  178. package/prod/chunks/vidstack-Dihypf8P.js +11 -0
  179. package/prod/chunks/vidstack-Dm1xEU9Q.js +34 -0
  180. package/prod/chunks/vidstack-Dq5Yu0Vr.js +205 -0
  181. package/prod/chunks/vidstack-DqAw8m9J.js +26 -0
  182. package/prod/chunks/vidstack-DsPOyKtl.js +57 -0
  183. package/prod/chunks/vidstack-krOAtKMi.js +32 -0
  184. package/prod/chunks/vidstack-nLyr4NEP.js +58 -0
  185. package/prod/chunks/vidstack-xMS8dnYq.js +114 -0
  186. package/prod/chunks/vidstack-yEGTpgeA.js +104 -0
  187. package/prod/define/plyr-layout.js +51 -0
  188. package/prod/define/templates/plyr-layout.js +571 -0
  189. package/prod/define/templates/vidstack-audio-layout.js +167 -0
  190. package/prod/define/templates/vidstack-video-layout.js +390 -0
  191. package/prod/define/vidstack-icons.js +1 -0
  192. package/prod/define/vidstack-player-default-layout.js +21 -0
  193. package/prod/define/vidstack-player-layouts.js +25 -0
  194. package/prod/define/vidstack-player-ui.js +70 -0
  195. package/prod/define/vidstack-player.js +19 -0
  196. package/prod/global/plyr.js +493 -0
  197. package/prod/global/vidstack-player.js +129 -0
  198. package/prod/providers/vidstack-audio.js +35 -0
  199. package/prod/providers/vidstack-dash.js +501 -0
  200. package/prod/providers/vidstack-google-cast.js +468 -0
  201. package/prod/providers/vidstack-hls.js +393 -0
  202. package/prod/providers/vidstack-html.js +555 -0
  203. package/prod/providers/vidstack-video.js +204 -0
  204. package/prod/providers/vidstack-vimeo.js +548 -0
  205. package/prod/providers/vidstack-youtube.js +286 -0
  206. package/prod/vidstack-elements.js +36 -0
  207. package/prod/vidstack.js +158 -0
  208. package/server/chunks/vidstack-6juFdkKy.js +29 -0
  209. package/server/chunks/vidstack-B7iHmv7_.js +307 -0
  210. package/server/chunks/vidstack-BmxyML9v.js +1619 -0
  211. package/server/chunks/vidstack-BskfxwD3.js +566 -0
  212. package/server/chunks/vidstack-BvLV0SMz.js +4642 -0
  213. package/server/chunks/vidstack-BvWwluXZ.js +205 -0
  214. package/server/chunks/vidstack-C-413dj2.js +8 -0
  215. package/server/chunks/vidstack-C26K8z_-.js +55 -0
  216. package/server/chunks/vidstack-CJJiksDz.js +107 -0
  217. package/server/chunks/vidstack-CUNv52x1.js +141 -0
  218. package/server/chunks/vidstack-CqyBCODe.js +295 -0
  219. package/server/chunks/vidstack-CwTj4H1w.js +18 -0
  220. package/server/chunks/vidstack-DHAyGSOl.js +1502 -0
  221. package/server/chunks/vidstack-DLU3cjcp.js +381 -0
  222. package/server/chunks/vidstack-DXxIKXmd.js +50 -0
  223. package/server/chunks/vidstack-DbtDXDS2.js +104 -0
  224. package/server/chunks/vidstack-Dm1xEU9Q.js +34 -0
  225. package/server/chunks/vidstack-DzTHw_bw.js +207 -0
  226. package/server/chunks/vidstack-Wn3NH5Sg.js +1566 -0
  227. package/server/chunks/vidstack-krOAtKMi.js +32 -0
  228. package/server/chunks/vidstack-wNViAkr4.js +3045 -0
  229. package/server/define/plyr-layout.js +16 -0
  230. package/server/define/vidstack-icons.js +1 -0
  231. package/server/define/vidstack-player-default-layout.js +13 -0
  232. package/server/define/vidstack-player-layouts.js +16 -0
  233. package/server/define/vidstack-player-ui.js +11 -0
  234. package/server/define/vidstack-player.js +6 -0
  235. package/server/global/plyr.js +322 -0
  236. package/server/global/vidstack-player.js +58 -0
  237. package/server/vidstack-elements.js +46 -0
  238. package/server/vidstack.js +148 -0
  239. package/tailwind.cjs +101 -0
  240. package/tailwind.d.cts +15 -0
  241. package/types/vidstack-BOvzfZjK.d.ts +1269 -0
  242. package/types/vidstack-Cttpg6GU.d.ts +7474 -0
@@ -0,0 +1,109 @@
1
+ import { IS_CHROME, IS_IOS, canGoogleCastSrc } from './vidstack-CjhKISI0.js';
2
+ import { loadScript } from './vidstack-zG6PIeGg.js';
3
+ import { getCastContext, getCastSession, isCastConnected, hasLoadedCastFramework, getCastFrameworkURL, isCastAvailable, getCastErrorMessage, getDefaultCastOptions } from './vidstack-DDwbYVHV.js';
4
+ import { peek } from './vidstack-Bu2kfzUd.js';
5
+
6
+ class GoogleCastLoader {
7
+ name = "google-cast";
8
+ target;
9
+ #player;
10
+ /**
11
+ * @see {@link https://developers.google.com/cast/docs/reference/web_sender/cast.framework.CastContext}
12
+ */
13
+ get cast() {
14
+ return getCastContext();
15
+ }
16
+ mediaType() {
17
+ return "video";
18
+ }
19
+ canPlay(src) {
20
+ return IS_CHROME && !IS_IOS && canGoogleCastSrc(src);
21
+ }
22
+ async prompt(ctx) {
23
+ let loadEvent, openEvent, errorEvent;
24
+ try {
25
+ loadEvent = await this.#loadCastFramework(ctx);
26
+ if (!this.#player) {
27
+ this.#player = new cast.framework.RemotePlayer();
28
+ new cast.framework.RemotePlayerController(this.#player);
29
+ }
30
+ openEvent = ctx.player.createEvent("google-cast-prompt-open", {
31
+ trigger: loadEvent
32
+ });
33
+ ctx.player.dispatchEvent(openEvent);
34
+ this.#notifyRemoteStateChange(ctx, "connecting", openEvent);
35
+ await this.#showPrompt(peek(ctx.$props.googleCast));
36
+ ctx.$state.remotePlaybackInfo.set({
37
+ deviceName: getCastSession()?.getCastDevice().friendlyName
38
+ });
39
+ if (isCastConnected()) this.#notifyRemoteStateChange(ctx, "connected", openEvent);
40
+ } catch (code) {
41
+ const error = code instanceof Error ? code : this.#createError(
42
+ (code + "").toUpperCase(),
43
+ "Prompt failed."
44
+ );
45
+ errorEvent = ctx.player.createEvent("google-cast-prompt-error", {
46
+ detail: error,
47
+ trigger: openEvent ?? loadEvent,
48
+ cancelable: true
49
+ });
50
+ ctx.player.dispatch(errorEvent);
51
+ this.#notifyRemoteStateChange(
52
+ ctx,
53
+ isCastConnected() ? "connected" : "disconnected",
54
+ errorEvent
55
+ );
56
+ throw error;
57
+ } finally {
58
+ ctx.player.dispatch("google-cast-prompt-close", {
59
+ trigger: errorEvent ?? openEvent ?? loadEvent
60
+ });
61
+ }
62
+ }
63
+ async load(ctx) {
64
+ if (!this.#player) {
65
+ throw Error("[vidstack] google cast player was not initialized");
66
+ }
67
+ return new (await import('../providers/vidstack-google-cast.js')).GoogleCastProvider(this.#player, ctx);
68
+ }
69
+ async #loadCastFramework(ctx) {
70
+ if (hasLoadedCastFramework()) return;
71
+ const loadStartEvent = ctx.player.createEvent("google-cast-load-start");
72
+ ctx.player.dispatch(loadStartEvent);
73
+ await loadScript(getCastFrameworkURL());
74
+ await customElements.whenDefined("google-cast-launcher");
75
+ const loadedEvent = ctx.player.createEvent("google-cast-loaded", { trigger: loadStartEvent });
76
+ ctx.player.dispatch(loadedEvent);
77
+ if (!isCastAvailable()) {
78
+ throw this.#createError("CAST_NOT_AVAILABLE", "Google Cast not available on this platform.");
79
+ }
80
+ return loadedEvent;
81
+ }
82
+ async #showPrompt(options) {
83
+ this.#setOptions(options);
84
+ const errorCode = await this.cast.requestSession();
85
+ if (errorCode) {
86
+ throw this.#createError(
87
+ errorCode.toUpperCase(),
88
+ getCastErrorMessage(errorCode)
89
+ );
90
+ }
91
+ }
92
+ #setOptions(options) {
93
+ this.cast?.setOptions({
94
+ ...getDefaultCastOptions(),
95
+ ...options
96
+ });
97
+ }
98
+ #notifyRemoteStateChange(ctx, state, trigger) {
99
+ const detail = { type: "google-cast", state };
100
+ ctx.notify("remote-playback-change", detail, trigger);
101
+ }
102
+ #createError(code, message) {
103
+ const error = Error(message);
104
+ error.code = code;
105
+ return error;
106
+ }
107
+ }
108
+
109
+ export { GoogleCastLoader };
@@ -0,0 +1,55 @@
1
+ import { Icon$34, Icon$35, Icon$27, Icon$26, Icon$60, Icon$61, Icon$39, Icon$40, Icon$105, Icon$104, Icon$54, Icon$59, Icon$62, Icon$56, Icon$33, Icon$8, Icon$13, Icon$19, Icon$63, Icon$53, Icon$0, Icon$22, Icon$11, Icon$88, Icon$16, Icon$77, Icon$81, Icon$24, Icon$74, Icon$31, Icon$5 } from './vidstack-Bu2kfzUd.js';
2
+
3
+ const icons = {
4
+ airplay: Icon$5,
5
+ download: Icon$31,
6
+ play: Icon$62,
7
+ pause: Icon$59,
8
+ replay: Icon$74,
9
+ mute: Icon$54,
10
+ "google-cast": Icon$24,
11
+ "volume-low": Icon$105,
12
+ "volume-high": Icon$104,
13
+ "cc-on": Icon$26,
14
+ "cc-off": Icon$27,
15
+ "pip-enter": Icon$61,
16
+ "pip-exit": Icon$60,
17
+ "fs-enter": Icon$40,
18
+ "fs-exit": Icon$39,
19
+ "seek-forward": Icon$81,
20
+ "seek-backward": Icon$77,
21
+ "menu-chapters": Icon$16,
22
+ "menu-settings": Icon$88,
23
+ "menu-arrow-left": Icon$11,
24
+ "menu-arrow-right": Icon$22,
25
+ "menu-accessibility": Icon$0,
26
+ "menu-audio": Icon$53,
27
+ "menu-audio-boost-up": Icon$104,
28
+ "menu-audio-boost-down": Icon$105,
29
+ "menu-playback": Icon$63,
30
+ "menu-speed-up": Icon$35,
31
+ "menu-speed-down": Icon$34,
32
+ "menu-captions": Icon$27,
33
+ "menu-quality-up": Icon$13,
34
+ "menu-quality-down": Icon$8,
35
+ "menu-radio-check": Icon$19,
36
+ "menu-font-size-up": Icon$13,
37
+ "menu-font-size-down": Icon$8,
38
+ "menu-opacity-up": Icon$33,
39
+ "menu-opacity-down": Icon$56,
40
+ "kb-play": Icon$62,
41
+ "kb-pause": Icon$59,
42
+ "kb-mute": Icon$54,
43
+ "kb-volume-up": Icon$104,
44
+ "kb-volume-down": Icon$105,
45
+ "kb-fs-enter": Icon$40,
46
+ "kb-fs-exit": Icon$39,
47
+ "kb-pip-enter": Icon$61,
48
+ "kb-pip-exit": Icon$60,
49
+ "kb-cc-on": Icon$26,
50
+ "kb-cc-off": Icon$27,
51
+ "kb-seek-forward": Icon$35,
52
+ "kb-seek-backward": Icon$34
53
+ };
54
+
55
+ export { icons };
@@ -0,0 +1,254 @@
1
+ import { autoUpdate, computePosition, flip, shift } from '@floating-ui/dom';
2
+ import { EventsController, isKeyboardClick, isTouchEvent, scoped, getScope, effect, toggleClass, signal, listenEvent, animationFrameThrottle, isFunction, setAttribute, setStyle, onDispose, isDOMNode, computed } from './vidstack-Bu2kfzUd.js';
3
+
4
+ function isEventInside(el, event) {
5
+ const target = event.composedPath()[0];
6
+ return isDOMNode(target) && el.contains(target);
7
+ }
8
+ const rafJobs = /* @__PURE__ */ new Set();
9
+ {
10
+ let processJobs = function() {
11
+ for (const job of rafJobs) {
12
+ try {
13
+ job();
14
+ } catch (e) {
15
+ console.error(`[vidstack] failed job:
16
+
17
+ ${e}`);
18
+ }
19
+ }
20
+ window.requestAnimationFrame(processJobs);
21
+ };
22
+ processJobs();
23
+ }
24
+ function scheduleRafJob(job) {
25
+ rafJobs.add(job);
26
+ return () => rafJobs.delete(job);
27
+ }
28
+ function setAttributeIfEmpty(target, name, value) {
29
+ if (!target.hasAttribute(name)) target.setAttribute(name, value);
30
+ }
31
+ function setARIALabel(target, $label) {
32
+ if (target.hasAttribute("aria-label") || target.hasAttribute("data-no-label")) return;
33
+ if (!isFunction($label)) {
34
+ setAttribute(target, "aria-label", $label);
35
+ return;
36
+ }
37
+ function updateAriaDescription() {
38
+ setAttribute(target, "aria-label", $label());
39
+ }
40
+ effect(updateAriaDescription);
41
+ }
42
+ function isElementVisible(el) {
43
+ const style = getComputedStyle(el);
44
+ return style.display !== "none" && parseInt(style.opacity) > 0;
45
+ }
46
+ function checkVisibility(el) {
47
+ return !!el && ("checkVisibility" in el ? el.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true }) : isElementVisible(el));
48
+ }
49
+ function observeVisibility(el, callback) {
50
+ return scheduleRafJob(() => callback(checkVisibility(el)));
51
+ }
52
+ function isElementParent(owner, node, test) {
53
+ while (node) {
54
+ if (node === owner) {
55
+ return true;
56
+ } else if (test?.(node)) {
57
+ break;
58
+ } else {
59
+ node = node.parentElement;
60
+ }
61
+ }
62
+ return false;
63
+ }
64
+ function onPress(target, handler) {
65
+ return new EventsController(target).add("pointerup", (event) => {
66
+ if (event.button === 0 && !event.defaultPrevented) handler(event);
67
+ }).add("keydown", (event) => {
68
+ if (isKeyboardClick(event)) handler(event);
69
+ });
70
+ }
71
+ function isTouchPinchEvent(event) {
72
+ return isTouchEvent(event) && (event.touches.length > 1 || event.changedTouches.length > 1);
73
+ }
74
+ function requestScopedAnimationFrame(callback) {
75
+ let scope = getScope(), id = window.requestAnimationFrame(() => {
76
+ scoped(callback, scope);
77
+ id = -1;
78
+ });
79
+ return () => void window.cancelAnimationFrame(id);
80
+ }
81
+ function cloneTemplate(template, length, onCreate) {
82
+ let current, prev = template, parent = template.parentElement, content = template.content.firstElementChild, elements = [];
83
+ if (!content && template.firstElementChild) {
84
+ template.innerHTML = template.firstElementChild.outerHTML;
85
+ template.firstElementChild.remove();
86
+ content = template.content.firstElementChild;
87
+ }
88
+ if (content?.nodeType !== 1) {
89
+ throw Error("[vidstack] template must contain root element");
90
+ }
91
+ for (let i = 0; i < length; i++) {
92
+ current = document.importNode(content, true);
93
+ onCreate?.(current, i);
94
+ parent.insertBefore(current, prev.nextSibling);
95
+ elements.push(current);
96
+ prev = current;
97
+ }
98
+ onDispose(() => {
99
+ for (let i = 0; i < elements.length; i++) elements[i].remove();
100
+ });
101
+ return elements;
102
+ }
103
+ function createTemplate(content) {
104
+ const template = document.createElement("template");
105
+ template.innerHTML = content;
106
+ return template.content;
107
+ }
108
+ function cloneTemplateContent(content) {
109
+ const fragment = content.cloneNode(true);
110
+ return fragment.firstElementChild;
111
+ }
112
+ function autoPlacement(el, trigger, placement, {
113
+ offsetVarName,
114
+ xOffset,
115
+ yOffset,
116
+ ...options
117
+ }) {
118
+ if (!el) return;
119
+ const floatingPlacement = placement.replace(" ", "-").replace("-center", "");
120
+ setStyle(el, "visibility", !trigger ? "hidden" : null);
121
+ if (!trigger) return;
122
+ let isTop = placement.includes("top");
123
+ const negateX = (x) => placement.includes("left") ? `calc(-1 * ${x})` : x, negateY = (y) => isTop ? `calc(-1 * ${y})` : y;
124
+ return autoUpdate(trigger, el, () => {
125
+ computePosition(trigger, el, {
126
+ placement: floatingPlacement,
127
+ middleware: [
128
+ ...options.middleware ?? [],
129
+ flip({ fallbackAxisSideDirection: "start", crossAxis: false }),
130
+ shift()
131
+ ],
132
+ ...options
133
+ }).then(({ x, y, middlewareData }) => {
134
+ const hasFlipped = !!middlewareData.flip?.index;
135
+ isTop = placement.includes(hasFlipped ? "bottom" : "top");
136
+ el.setAttribute(
137
+ "data-placement",
138
+ hasFlipped ? placement.startsWith("top") ? placement.replace("top", "bottom") : placement.replace("bottom", "top") : placement
139
+ );
140
+ Object.assign(el.style, {
141
+ top: `calc(${y + "px"} + ${negateY(
142
+ yOffset ? yOffset + "px" : `var(--${offsetVarName}-y-offset, 0px)`
143
+ )})`,
144
+ left: `calc(${x + "px"} + ${negateX(
145
+ xOffset ? xOffset + "px" : `var(--${offsetVarName}-x-offset, 0px)`
146
+ )})`
147
+ });
148
+ });
149
+ });
150
+ }
151
+ function hasAnimation(el) {
152
+ const styles = getComputedStyle(el);
153
+ return styles.animationName !== "none";
154
+ }
155
+ function createSlot(name) {
156
+ const slot = document.createElement("slot");
157
+ slot.name = name;
158
+ return slot;
159
+ }
160
+ function useTransitionActive($el) {
161
+ const $active = signal(false);
162
+ effect(() => {
163
+ const el = $el();
164
+ if (!el) return;
165
+ new EventsController(el).add("transitionstart", () => $active.set(true)).add("transitionend", () => $active.set(false));
166
+ });
167
+ return $active;
168
+ }
169
+ function useResizeObserver($el, onResize) {
170
+ function onElementChange() {
171
+ const el = $el();
172
+ if (!el) return;
173
+ onResize();
174
+ const observer = new ResizeObserver(animationFrameThrottle(onResize));
175
+ observer.observe(el);
176
+ return () => observer.disconnect();
177
+ }
178
+ effect(onElementChange);
179
+ }
180
+ function useActive($el) {
181
+ const $isMouseEnter = useMouseEnter($el), $isFocusedIn = useFocusIn($el);
182
+ let prevMouseEnter = false;
183
+ return computed(() => {
184
+ const isMouseEnter = $isMouseEnter();
185
+ if (prevMouseEnter && !isMouseEnter) return false;
186
+ prevMouseEnter = isMouseEnter;
187
+ return isMouseEnter || $isFocusedIn();
188
+ });
189
+ }
190
+ function useMouseEnter($el) {
191
+ const $isMouseEnter = signal(false);
192
+ effect(() => {
193
+ const el = $el();
194
+ if (!el) {
195
+ $isMouseEnter.set(false);
196
+ return;
197
+ }
198
+ new EventsController(el).add("mouseenter", () => $isMouseEnter.set(true)).add("mouseleave", () => $isMouseEnter.set(false));
199
+ });
200
+ return $isMouseEnter;
201
+ }
202
+ function useFocusIn($el) {
203
+ const $isFocusIn = signal(false);
204
+ effect(() => {
205
+ const el = $el();
206
+ if (!el) {
207
+ $isFocusIn.set(false);
208
+ return;
209
+ }
210
+ new EventsController(el).add("focusin", () => $isFocusIn.set(true)).add("focusout", () => $isFocusIn.set(false));
211
+ });
212
+ return $isFocusIn;
213
+ }
214
+ function isHTMLElement(el) {
215
+ return el instanceof HTMLElement;
216
+ }
217
+ function useColorSchemePreference() {
218
+ const colorScheme = signal("dark");
219
+ const media = window.matchMedia("(prefers-color-scheme: light)");
220
+ function onChange() {
221
+ colorScheme.set(media.matches ? "light" : "dark");
222
+ }
223
+ onChange();
224
+ listenEvent(media, "change", onChange);
225
+ return colorScheme;
226
+ }
227
+ function watchColorScheme(el, colorScheme) {
228
+ effect(() => {
229
+ const scheme = colorScheme();
230
+ if (scheme === "system") {
231
+ const preference = useColorSchemePreference();
232
+ effect(() => updateColorScheme(preference()));
233
+ return;
234
+ }
235
+ updateColorScheme(scheme);
236
+ });
237
+ function updateColorScheme(scheme) {
238
+ toggleClass(el, "light", scheme === "light");
239
+ toggleClass(el, "dark", scheme === "dark");
240
+ }
241
+ }
242
+
243
+ function ariaBool(value) {
244
+ return value ? "true" : "false";
245
+ }
246
+ function $ariaBool(signal) {
247
+ return () => ariaBool(signal());
248
+ }
249
+ function prefersReducedMotion() {
250
+ if (typeof window === "undefined") return false;
251
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
252
+ }
253
+
254
+ export { $ariaBool, autoPlacement, cloneTemplate, cloneTemplateContent, createSlot, createTemplate, hasAnimation, isElementParent, isElementVisible, isEventInside, isHTMLElement, isTouchPinchEvent, observeVisibility, onPress, prefersReducedMotion, requestScopedAnimationFrame, setARIALabel, setAttributeIfEmpty, useActive, useResizeObserver, useTransitionActive, watchColorScheme };
@@ -0,0 +1,114 @@
1
+ import { isFunction, isUndefined, waitTimeout, isString } from './vidstack-Bu2kfzUd.js';
2
+
3
+ const UA = navigator?.userAgent.toLowerCase() || "";
4
+ const IS_IOS = /iphone|ipad|ipod|ios|crios|fxios/i.test(UA);
5
+ const IS_IPHONE = /(iphone|ipod)/gi.test(navigator?.platform || "");
6
+ const IS_CHROME = !!window.chrome;
7
+ const IS_SAFARI = !!window.safari || IS_IOS;
8
+ function canOrientScreen() {
9
+ return canRotateScreen() && isFunction(screen.orientation.unlock);
10
+ }
11
+ function canRotateScreen() {
12
+ return !isUndefined(window.screen.orientation) && !isUndefined(window.screen.orientation.lock);
13
+ }
14
+ function canPlayAudioType(audio, type) {
15
+ if (!audio) audio = document.createElement("audio");
16
+ return audio.canPlayType(type).length > 0;
17
+ }
18
+ function canPlayVideoType(video, type) {
19
+ if (!video) video = document.createElement("video");
20
+ return video.canPlayType(type).length > 0;
21
+ }
22
+ function canPlayHLSNatively(video) {
23
+ if (!video) video = document.createElement("video");
24
+ return video.canPlayType("application/vnd.apple.mpegurl").length > 0;
25
+ }
26
+ function canUsePictureInPicture(video) {
27
+ return !!document.pictureInPictureEnabled && !video?.disablePictureInPicture;
28
+ }
29
+ function canUseVideoPresentation(video) {
30
+ return isFunction(video?.webkitSupportsPresentationMode) && isFunction(video?.webkitSetPresentationMode);
31
+ }
32
+ async function canChangeVolume() {
33
+ const video = document.createElement("video");
34
+ video.volume = 0.5;
35
+ await waitTimeout(0);
36
+ return video.volume === 0.5;
37
+ }
38
+ function getMediaSource() {
39
+ return window?.ManagedMediaSource ?? window?.MediaSource ?? window?.WebKitMediaSource;
40
+ }
41
+ function getSourceBuffer() {
42
+ return window?.SourceBuffer ?? window?.WebKitSourceBuffer;
43
+ }
44
+ function isHLSSupported() {
45
+ const MediaSource = getMediaSource();
46
+ if (isUndefined(MediaSource)) return false;
47
+ const isTypeSupported = MediaSource && isFunction(MediaSource.isTypeSupported) && MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
48
+ const SourceBuffer = getSourceBuffer();
49
+ const isSourceBufferValid = isUndefined(SourceBuffer) || !isUndefined(SourceBuffer.prototype) && isFunction(SourceBuffer.prototype.appendBuffer) && isFunction(SourceBuffer.prototype.remove);
50
+ return !!isTypeSupported && !!isSourceBufferValid;
51
+ }
52
+ function isDASHSupported() {
53
+ return isHLSSupported();
54
+ }
55
+
56
+ const AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i;
57
+ const AUDIO_TYPES = /* @__PURE__ */ new Set([
58
+ "audio/mpeg",
59
+ "audio/ogg",
60
+ "audio/3gp",
61
+ "audio/mp3",
62
+ "audio/webm",
63
+ "audio/flac",
64
+ "audio/m4a",
65
+ "audio/m4b",
66
+ "audio/mp4a",
67
+ "audio/mp4"
68
+ ]);
69
+ const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
70
+ const VIDEO_TYPES = /* @__PURE__ */ new Set([
71
+ "video/mp4",
72
+ "video/webm",
73
+ "video/3gp",
74
+ "video/ogg",
75
+ "video/avi",
76
+ "video/mpeg"
77
+ ]);
78
+ const HLS_VIDEO_EXTENSIONS = /\.(m3u8)($|\?)/i;
79
+ const DASH_VIDEO_EXTENSIONS = /\.(mpd)($|\?)/i;
80
+ const HLS_VIDEO_TYPES = /* @__PURE__ */ new Set([
81
+ // Apple sanctioned
82
+ "application/vnd.apple.mpegurl",
83
+ // Apple sanctioned for backwards compatibility
84
+ "audio/mpegurl",
85
+ // Very common
86
+ "audio/x-mpegurl",
87
+ // Very common
88
+ "application/x-mpegurl",
89
+ // Included for completeness
90
+ "video/x-mpegurl",
91
+ "video/mpegurl",
92
+ "application/mpegurl"
93
+ ]);
94
+ const DASH_VIDEO_TYPES = /* @__PURE__ */ new Set(["application/dash+xml"]);
95
+ function isAudioSrc({ src, type }) {
96
+ return isString(src) ? AUDIO_EXTENSIONS.test(src) || AUDIO_TYPES.has(type) || src.startsWith("blob:") && type === "audio/object" : type === "audio/object";
97
+ }
98
+ function isVideoSrc(src) {
99
+ return isString(src.src) ? VIDEO_EXTENSIONS.test(src.src) || VIDEO_TYPES.has(src.type) || src.src.startsWith("blob:") && src.type === "video/object" || isHLSSrc(src) && canPlayHLSNatively() : src.type === "video/object";
100
+ }
101
+ function isHLSSrc({ src, type }) {
102
+ return isString(src) && HLS_VIDEO_EXTENSIONS.test(src) || HLS_VIDEO_TYPES.has(type);
103
+ }
104
+ function isDASHSrc({ src, type }) {
105
+ return isString(src) && DASH_VIDEO_EXTENSIONS.test(src) || DASH_VIDEO_TYPES.has(type);
106
+ }
107
+ function canGoogleCastSrc(src) {
108
+ return isString(src.src) && (isAudioSrc(src) || isVideoSrc(src) || isHLSSrc(src));
109
+ }
110
+ function isMediaStream(src) {
111
+ return typeof window.MediaStream !== "undefined" && src instanceof window.MediaStream;
112
+ }
113
+
114
+ export { AUDIO_EXTENSIONS, AUDIO_TYPES, DASH_VIDEO_EXTENSIONS, DASH_VIDEO_TYPES, HLS_VIDEO_EXTENSIONS, HLS_VIDEO_TYPES, IS_CHROME, IS_IOS, IS_IPHONE, IS_SAFARI, VIDEO_EXTENSIONS, VIDEO_TYPES, canChangeVolume, canGoogleCastSrc, canOrientScreen, canPlayAudioType, canPlayHLSNatively, canPlayVideoType, canRotateScreen, canUsePictureInPicture, canUseVideoPresentation, isAudioSrc, isDASHSrc, isDASHSupported, isHLSSrc, isHLSSupported, isMediaStream, isVideoSrc };
@@ -0,0 +1,57 @@
1
+ import { signal, listenEvent, ViewController, effect, EventsController, setAttribute } from './vidstack-Bu2kfzUd.js';
2
+
3
+ let $keyboard = signal(false);
4
+ {
5
+ listenEvent(document, "pointerdown", () => {
6
+ $keyboard.set(false);
7
+ });
8
+ listenEvent(document, "keydown", (e) => {
9
+ if (e.metaKey || e.altKey || e.ctrlKey) return;
10
+ $keyboard.set(true);
11
+ });
12
+ }
13
+ class FocusVisibleController extends ViewController {
14
+ #focused = signal(false);
15
+ onConnect(el) {
16
+ effect(() => {
17
+ const events = new EventsController(el);
18
+ if (!$keyboard()) {
19
+ this.#focused.set(false);
20
+ updateFocusAttr(el, false);
21
+ events.add("pointerenter", this.#onPointerEnter.bind(this)).add("pointerleave", this.#onPointerLeave.bind(this));
22
+ return;
23
+ }
24
+ const active = document.activeElement === el;
25
+ this.#focused.set(active);
26
+ updateFocusAttr(el, active);
27
+ events.add("focus", this.#onFocus.bind(this)).add("blur", this.#onBlur.bind(this));
28
+ });
29
+ }
30
+ focused() {
31
+ return this.#focused();
32
+ }
33
+ #onFocus() {
34
+ this.#focused.set(true);
35
+ updateFocusAttr(this.el, true);
36
+ }
37
+ #onBlur() {
38
+ this.#focused.set(false);
39
+ updateFocusAttr(this.el, false);
40
+ }
41
+ #onPointerEnter() {
42
+ updateHoverAttr(this.el, true);
43
+ }
44
+ #onPointerLeave() {
45
+ updateHoverAttr(this.el, false);
46
+ }
47
+ }
48
+ function updateFocusAttr(el, isFocused) {
49
+ setAttribute(el, "data-focus", isFocused);
50
+ setAttribute(el, "data-hocus", isFocused);
51
+ }
52
+ function updateHoverAttr(el, isHovering) {
53
+ setAttribute(el, "data-hocus", isHovering);
54
+ setAttribute(el, "data-hover", isHovering);
55
+ }
56
+
57
+ export { $keyboard, FocusVisibleController };
@@ -0,0 +1,18 @@
1
+ import { render } from 'lit-html';
2
+
3
+ class LitElement extends HTMLElement {
4
+ rootPart = null;
5
+ connectedCallback() {
6
+ this.rootPart = render(this.render(), this, {
7
+ renderBefore: this.firstChild
8
+ });
9
+ this.rootPart.setConnected(true);
10
+ }
11
+ disconnectedCallback() {
12
+ this.rootPart?.setConnected(false);
13
+ this.rootPart = null;
14
+ render(null, this);
15
+ }
16
+ }
17
+
18
+ export { LitElement };
@@ -0,0 +1,66 @@
1
+ import { listenEvent } from './vidstack-Bu2kfzUd.js';
2
+
3
+ function getCastFrameworkURL() {
4
+ return "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
5
+ }
6
+ function hasLoadedCastFramework() {
7
+ return !!window.cast?.framework;
8
+ }
9
+ function isCastAvailable() {
10
+ return !!window.chrome?.cast?.isAvailable;
11
+ }
12
+ function isCastConnected() {
13
+ return getCastContext().getCastState() === cast.framework.CastState.CONNECTED;
14
+ }
15
+ function getCastContext() {
16
+ return window.cast.framework.CastContext.getInstance();
17
+ }
18
+ function getCastSession() {
19
+ return getCastContext().getCurrentSession();
20
+ }
21
+ function getCastSessionMedia() {
22
+ return getCastSession()?.getSessionObj().media[0];
23
+ }
24
+ function hasActiveCastSession(src) {
25
+ const contentId = getCastSessionMedia()?.media.contentId;
26
+ return contentId === src?.src;
27
+ }
28
+ function getDefaultCastOptions() {
29
+ return {
30
+ language: "en-US",
31
+ autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
32
+ receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,
33
+ resumeSavedSession: true,
34
+ androidReceiverCompatible: true
35
+ };
36
+ }
37
+ function getCastErrorMessage(code) {
38
+ const defaultMessage = `Google Cast Error Code: ${code}`;
39
+ {
40
+ switch (code) {
41
+ case chrome.cast.ErrorCode.API_NOT_INITIALIZED:
42
+ return "The API is not initialized.";
43
+ case chrome.cast.ErrorCode.CANCEL:
44
+ return "The operation was canceled by the user";
45
+ case chrome.cast.ErrorCode.CHANNEL_ERROR:
46
+ return "A channel to the receiver is not available.";
47
+ case chrome.cast.ErrorCode.EXTENSION_MISSING:
48
+ return "The Cast extension is not available.";
49
+ case chrome.cast.ErrorCode.INVALID_PARAMETER:
50
+ return "The parameters to the operation were not valid.";
51
+ case chrome.cast.ErrorCode.RECEIVER_UNAVAILABLE:
52
+ return "No receiver was compatible with the session request.";
53
+ case chrome.cast.ErrorCode.SESSION_ERROR:
54
+ return "A session could not be created, or a session was invalid.";
55
+ case chrome.cast.ErrorCode.TIMEOUT:
56
+ return "The operation timed out.";
57
+ default:
58
+ return defaultMessage;
59
+ }
60
+ }
61
+ }
62
+ function listenCastContextEvent(type, handler) {
63
+ return listenEvent(getCastContext(), type, handler);
64
+ }
65
+
66
+ export { getCastContext, getCastErrorMessage, getCastFrameworkURL, getCastSession, getCastSessionMedia, getDefaultCastOptions, hasActiveCastSession, hasLoadedCastFramework, isCastAvailable, isCastConnected, listenCastContextEvent };
@@ -0,0 +1,11 @@
1
+ import { useContext, createContext } from './vidstack-Bu2kfzUd.js';
2
+
3
+ const mediaContext = createContext();
4
+ function useMediaContext() {
5
+ return useContext(mediaContext);
6
+ }
7
+ function useMediaState() {
8
+ return useMediaContext().$state;
9
+ }
10
+
11
+ export { mediaContext, useMediaContext, useMediaState };