@videojs/html 10.0.0-beta.6 → 10.0.0-beta.7

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 (326) hide show
  1. package/cdn/audio-minimal.css +1 -1
  2. package/cdn/audio-minimal.dev.d.ts +1 -0
  3. package/cdn/audio-minimal.dev.js +9 -5336
  4. package/cdn/audio-minimal.dev.js.map +1 -1
  5. package/cdn/audio-minimal.js +1 -24
  6. package/cdn/audio-minimal.js.map +1 -1
  7. package/cdn/audio.css +1 -1
  8. package/cdn/audio.dev.d.ts +1 -0
  9. package/cdn/audio.dev.js +9 -5336
  10. package/cdn/audio.dev.js.map +1 -1
  11. package/cdn/audio.js +1 -24
  12. package/cdn/audio.js.map +1 -1
  13. package/cdn/background.css +1 -1
  14. package/cdn/background.dev.d.ts +1 -0
  15. package/cdn/background.dev.js +100 -2026
  16. package/cdn/background.dev.js.map +1 -1
  17. package/cdn/background.js +1 -18
  18. package/cdn/background.js.map +1 -1
  19. package/cdn/context-C_e06fGU.js +13 -0
  20. package/cdn/context-C_e06fGU.js.map +1 -0
  21. package/cdn/context-DTY0nOpS.js +98 -0
  22. package/cdn/context-DTY0nOpS.js.map +1 -0
  23. package/cdn/create-player-Dv7K1Ezk.js +3214 -0
  24. package/cdn/create-player-Dv7K1Ezk.js.map +1 -0
  25. package/cdn/create-player-QjiNZlh7.js +7 -0
  26. package/cdn/create-player-QjiNZlh7.js.map +1 -0
  27. package/cdn/default-GgKND7a8.js +2 -0
  28. package/cdn/default-GgKND7a8.js.map +1 -0
  29. package/cdn/default-cLso8BHO.js +28 -0
  30. package/cdn/default-cLso8BHO.js.map +1 -0
  31. package/cdn/listen-BXAYCbZA.js +9 -0
  32. package/cdn/listen-BXAYCbZA.js.map +1 -0
  33. package/cdn/listen-DX5vU4s4.js +2 -0
  34. package/cdn/listen-DX5vU4s4.js.map +1 -0
  35. package/cdn/media/dash-video.dev.d.ts +1 -0
  36. package/cdn/media/dash-video.dev.js +39165 -0
  37. package/cdn/media/dash-video.dev.js.map +1 -0
  38. package/cdn/media/dash-video.js +21 -0
  39. package/cdn/media/dash-video.js.map +1 -0
  40. package/cdn/media/hls-video.dev.d.ts +1 -0
  41. package/cdn/media/hls-video.dev.js +6 -378
  42. package/cdn/media/hls-video.dev.js.map +1 -1
  43. package/cdn/media/hls-video.js +21 -65
  44. package/cdn/media/hls-video.js.map +1 -1
  45. package/cdn/media/simple-hls-video.dev.d.ts +1 -0
  46. package/cdn/media/simple-hls-video.dev.js +6 -377
  47. package/cdn/media/simple-hls-video.dev.js.map +1 -1
  48. package/cdn/media/simple-hls-video.js +1 -45
  49. package/cdn/media/simple-hls-video.js.map +1 -1
  50. package/cdn/media-attach-mixin-ChyNp2eK.js +44 -0
  51. package/cdn/media-attach-mixin-ChyNp2eK.js.map +1 -0
  52. package/cdn/media-attach-mixin-tFNcHnvo.js +2 -0
  53. package/cdn/media-attach-mixin-tFNcHnvo.js.map +1 -0
  54. package/cdn/minimal-BJfleQcQ.js +2 -0
  55. package/cdn/minimal-BJfleQcQ.js.map +1 -0
  56. package/cdn/minimal-DBMdC_0I.js +28 -0
  57. package/cdn/minimal-DBMdC_0I.js.map +1 -0
  58. package/cdn/player-CztIlNio.js +2 -0
  59. package/cdn/player-CztIlNio.js.map +1 -0
  60. package/cdn/player-Dvj38jlr.js +15 -0
  61. package/cdn/player-Dvj38jlr.js.map +1 -0
  62. package/cdn/poster-C4WHg3BH.js +2 -0
  63. package/cdn/poster-C4WHg3BH.js.map +1 -0
  64. package/cdn/poster-O0SI05LC.js +195 -0
  65. package/cdn/poster-O0SI05LC.js.map +1 -0
  66. package/cdn/predicate-BG-dj_kF.js +26 -0
  67. package/cdn/predicate-BG-dj_kF.js.map +1 -0
  68. package/cdn/predicate-Y9jDHLpX.js +2 -0
  69. package/cdn/predicate-Y9jDHLpX.js.map +1 -0
  70. package/cdn/proxy-2oO2ph3m.js +47 -0
  71. package/cdn/proxy-2oO2ph3m.js.map +1 -0
  72. package/cdn/proxy-6KS6wy69.js +2 -0
  73. package/cdn/proxy-6KS6wy69.js.map +1 -0
  74. package/cdn/proxy-XzDf9gyk.js +66 -0
  75. package/cdn/proxy-XzDf9gyk.js.map +1 -0
  76. package/cdn/proxy-dR7IDk37.js +349 -0
  77. package/cdn/proxy-dR7IDk37.js.map +1 -0
  78. package/cdn/safe-define-B8lHgj_K.js +9 -0
  79. package/cdn/safe-define-B8lHgj_K.js.map +1 -0
  80. package/cdn/safe-define-GrHW3P9e.js +2 -0
  81. package/cdn/safe-define-GrHW3P9e.js.map +1 -0
  82. package/cdn/video-minimal.css +1 -1
  83. package/cdn/video-minimal.dev.d.ts +1 -0
  84. package/cdn/video-minimal.dev.js +16 -5650
  85. package/cdn/video-minimal.dev.js.map +1 -1
  86. package/cdn/video-minimal.js +1 -24
  87. package/cdn/video-minimal.js.map +1 -1
  88. package/cdn/video.css +1 -1
  89. package/cdn/video.dev.d.ts +1 -0
  90. package/cdn/video.dev.js +24 -5709
  91. package/cdn/video.dev.js.map +1 -1
  92. package/cdn/video.js +1 -24
  93. package/cdn/video.js.map +1 -1
  94. package/cdn/volume-slider-BqzTytgB.js +8 -0
  95. package/cdn/volume-slider-BqzTytgB.js.map +1 -0
  96. package/cdn/volume-slider-CfhOO9RM.js +2453 -0
  97. package/cdn/volume-slider-CfhOO9RM.js.map +1 -0
  98. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  99. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  100. package/dist/default/_virtual/inline-css_src/define/audio/skin.js +1 -1
  101. package/dist/default/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  102. package/dist/default/_virtual/inline-css_src/define/base.js +1 -1
  103. package/dist/default/_virtual/inline-css_src/define/base.js.map +1 -1
  104. package/dist/default/_virtual/inline-css_src/define/shared.js +6 -0
  105. package/dist/default/_virtual/inline-css_src/define/shared.js.map +1 -0
  106. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  107. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  108. package/dist/default/_virtual/inline-css_src/define/video/skin.js +1 -1
  109. package/dist/default/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  110. package/dist/default/define/audio/minimal-skin.css +22 -20
  111. package/dist/default/define/audio/minimal-skin.js +1 -1
  112. package/dist/default/define/audio/minimal-skin.js.map +1 -1
  113. package/dist/default/define/audio/minimal-skin.tailwind.js +1 -1
  114. package/dist/default/define/audio/minimal-skin.tailwind.js.map +1 -1
  115. package/dist/default/define/audio/skin.css +19 -22
  116. package/dist/default/define/audio/skin.js +1 -1
  117. package/dist/default/define/audio/skin.js.map +1 -1
  118. package/dist/default/define/audio/skin.tailwind.js +3 -4
  119. package/dist/default/define/audio/skin.tailwind.js.map +1 -1
  120. package/dist/default/define/background/skin.css +1 -1
  121. package/dist/default/define/background/skin.js +1 -1
  122. package/dist/default/define/background/skin.js.map +1 -1
  123. package/dist/default/define/base.css +7 -7
  124. package/dist/default/define/media/dash-video.js +14 -0
  125. package/dist/default/define/media/dash-video.js.map +1 -0
  126. package/dist/default/define/shared.css +6 -0
  127. package/dist/default/define/skin-mixin.js +8 -3
  128. package/dist/default/define/skin-mixin.js.map +1 -1
  129. package/dist/default/define/video/minimal-skin.css +101 -71
  130. package/dist/default/define/video/minimal-skin.js +2 -1
  131. package/dist/default/define/video/minimal-skin.js.map +1 -1
  132. package/dist/default/define/video/minimal-skin.tailwind.js +4 -2
  133. package/dist/default/define/video/minimal-skin.tailwind.js.map +1 -1
  134. package/dist/default/define/video/skin.css +98 -72
  135. package/dist/default/define/video/skin.js +2 -1
  136. package/dist/default/define/video/skin.js.map +1 -1
  137. package/dist/default/define/video/skin.tailwind.js +4 -2
  138. package/dist/default/define/video/skin.tailwind.js.map +1 -1
  139. package/dist/default/icons/dist/render/default/index.js +2 -1
  140. package/dist/default/icons/dist/render/default/index.js.map +1 -1
  141. package/dist/default/icons/dist/render/minimal/index.js +2 -1
  142. package/dist/default/icons/dist/render/minimal/index.js.map +1 -1
  143. package/dist/default/index.js +3 -2
  144. package/dist/default/media/background-video/index.js +5 -1
  145. package/dist/default/media/background-video/index.js.map +1 -1
  146. package/dist/default/media/container-element.js +5 -2
  147. package/dist/default/media/container-element.js.map +1 -1
  148. package/dist/default/media/dash-video/index.js +26 -0
  149. package/dist/default/media/dash-video/index.js.map +1 -0
  150. package/dist/default/media/hls-video/index.js +2 -1
  151. package/dist/default/media/hls-video/index.js.map +1 -1
  152. package/dist/default/media/simple-hls-video/index.js +2 -1
  153. package/dist/default/media/simple-hls-video/index.js.map +1 -1
  154. package/dist/default/player/context.js +6 -2
  155. package/dist/default/player/context.js.map +1 -1
  156. package/dist/default/player/create-player.js +11 -3
  157. package/dist/default/player/create-player.js.map +1 -1
  158. package/dist/default/skins/dist/default/default/tailwind/audio.tailwind.js +6 -5
  159. package/dist/default/skins/dist/default/default/tailwind/audio.tailwind.js.map +1 -1
  160. package/dist/default/skins/dist/default/default/tailwind/components/controls.js +1 -1
  161. package/dist/default/skins/dist/default/default/tailwind/components/controls.js.map +1 -1
  162. package/dist/default/skins/dist/default/default/tailwind/components/error.js +1 -1
  163. package/dist/default/skins/dist/default/default/tailwind/components/error.js.map +1 -1
  164. package/dist/default/skins/dist/default/default/tailwind/components/poster.js +16 -0
  165. package/dist/default/skins/dist/default/default/tailwind/components/poster.js.map +1 -0
  166. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js +6 -5
  167. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  168. package/dist/default/skins/dist/default/minimal/tailwind/audio.tailwind.js +1 -1
  169. package/dist/default/skins/dist/default/minimal/tailwind/audio.tailwind.js.map +1 -1
  170. package/dist/default/skins/dist/default/minimal/tailwind/components/controls.js +1 -1
  171. package/dist/default/skins/dist/default/minimal/tailwind/components/controls.js.map +1 -1
  172. package/dist/default/skins/dist/default/minimal/tailwind/components/playback-rate.js +6 -0
  173. package/dist/default/skins/dist/default/minimal/tailwind/components/playback-rate.js.map +1 -0
  174. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js +16 -0
  175. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -0
  176. package/dist/default/skins/dist/default/minimal/tailwind/components/time.js +1 -1
  177. package/dist/default/skins/dist/default/minimal/tailwind/components/time.js.map +1 -1
  178. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js +6 -4
  179. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  180. package/dist/default/skins/dist/default/shared/tailwind/icon-state.js +5 -0
  181. package/dist/default/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
  182. package/dist/default/store/container-mixin.js +16 -72
  183. package/dist/default/store/container-mixin.js.map +1 -1
  184. package/dist/default/store/media-attach-mixin.js +45 -0
  185. package/dist/default/store/media-attach-mixin.js.map +1 -0
  186. package/dist/default/store/provider-mixin.js +99 -9
  187. package/dist/default/store/provider-mixin.js.map +1 -1
  188. package/dist/default/ui/popover/popover-element.js +54 -3
  189. package/dist/default/ui/popover/popover-element.js.map +1 -1
  190. package/dist/default/ui/time-slider/time-slider-element.js +1 -1
  191. package/dist/default/ui/time-slider/time-slider-element.js.map +1 -1
  192. package/dist/default/ui/tooltip/tooltip-element.js +53 -3
  193. package/dist/default/ui/tooltip/tooltip-element.js.map +1 -1
  194. package/dist/default/ui/volume-slider/volume-slider-element.js +3 -3
  195. package/dist/default/ui/volume-slider/volume-slider-element.js.map +1 -1
  196. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  197. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  198. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js +1 -1
  199. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  200. package/dist/dev/_virtual/inline-css_src/define/base.js +1 -1
  201. package/dist/dev/_virtual/inline-css_src/define/base.js.map +1 -1
  202. package/dist/dev/_virtual/inline-css_src/define/shared.js +6 -0
  203. package/dist/dev/_virtual/inline-css_src/define/shared.js.map +1 -0
  204. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  205. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  206. package/dist/dev/_virtual/inline-css_src/define/video/skin.js +1 -1
  207. package/dist/dev/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  208. package/dist/dev/define/audio/minimal-skin.css +22 -20
  209. package/dist/dev/define/audio/minimal-skin.d.ts.map +1 -1
  210. package/dist/dev/define/audio/minimal-skin.js +2 -0
  211. package/dist/dev/define/audio/minimal-skin.js.map +1 -1
  212. package/dist/dev/define/audio/minimal-skin.tailwind.d.ts.map +1 -1
  213. package/dist/dev/define/audio/minimal-skin.tailwind.js +3 -1
  214. package/dist/dev/define/audio/minimal-skin.tailwind.js.map +1 -1
  215. package/dist/dev/define/audio/skin.css +19 -22
  216. package/dist/dev/define/audio/skin.d.ts.map +1 -1
  217. package/dist/dev/define/audio/skin.js +2 -0
  218. package/dist/dev/define/audio/skin.js.map +1 -1
  219. package/dist/dev/define/audio/skin.tailwind.d.ts.map +1 -1
  220. package/dist/dev/define/audio/skin.tailwind.js +5 -4
  221. package/dist/dev/define/audio/skin.tailwind.js.map +1 -1
  222. package/dist/dev/define/background/skin.css +1 -1
  223. package/dist/dev/define/background/skin.d.ts.map +1 -1
  224. package/dist/dev/define/background/skin.js +3 -1
  225. package/dist/dev/define/background/skin.js.map +1 -1
  226. package/dist/dev/define/base.css +7 -7
  227. package/dist/dev/define/media/dash-video.d.ts +14 -0
  228. package/dist/dev/define/media/dash-video.d.ts.map +1 -0
  229. package/dist/dev/define/media/dash-video.js +14 -0
  230. package/dist/dev/define/media/dash-video.js.map +1 -0
  231. package/dist/dev/define/shared.css +6 -0
  232. package/dist/dev/define/skin-mixin.d.ts.map +1 -1
  233. package/dist/dev/define/skin-mixin.js +8 -3
  234. package/dist/dev/define/skin-mixin.js.map +1 -1
  235. package/dist/dev/define/video/minimal-skin.css +101 -71
  236. package/dist/dev/define/video/minimal-skin.d.ts.map +1 -1
  237. package/dist/dev/define/video/minimal-skin.js +10 -2
  238. package/dist/dev/define/video/minimal-skin.js.map +1 -1
  239. package/dist/dev/define/video/minimal-skin.tailwind.d.ts.map +1 -1
  240. package/dist/dev/define/video/minimal-skin.tailwind.js +13 -4
  241. package/dist/dev/define/video/minimal-skin.tailwind.js.map +1 -1
  242. package/dist/dev/define/video/skin.css +98 -72
  243. package/dist/dev/define/video/skin.d.ts.map +1 -1
  244. package/dist/dev/define/video/skin.js +9 -1
  245. package/dist/dev/define/video/skin.js.map +1 -1
  246. package/dist/dev/define/video/skin.tailwind.d.ts.map +1 -1
  247. package/dist/dev/define/video/skin.tailwind.js +13 -4
  248. package/dist/dev/define/video/skin.tailwind.js.map +1 -1
  249. package/dist/dev/icons/dist/render/default/index.js +2 -1
  250. package/dist/dev/icons/dist/render/default/index.js.map +1 -1
  251. package/dist/dev/icons/dist/render/minimal/index.js +2 -1
  252. package/dist/dev/icons/dist/render/minimal/index.js.map +1 -1
  253. package/dist/dev/index.d.ts +5 -4
  254. package/dist/dev/index.js +3 -2
  255. package/dist/dev/media/background-video/index.d.ts +8 -1
  256. package/dist/dev/media/background-video/index.d.ts.map +1 -1
  257. package/dist/dev/media/background-video/index.js +5 -1
  258. package/dist/dev/media/background-video/index.js.map +1 -1
  259. package/dist/dev/media/container-element.js +5 -2
  260. package/dist/dev/media/container-element.js.map +1 -1
  261. package/dist/dev/media/dash-video/index.d.ts +13 -0
  262. package/dist/dev/media/dash-video/index.d.ts.map +1 -0
  263. package/dist/dev/media/dash-video/index.js +26 -0
  264. package/dist/dev/media/dash-video/index.js.map +1 -0
  265. package/dist/dev/media/hls-video/index.d.ts +2 -1
  266. package/dist/dev/media/hls-video/index.d.ts.map +1 -1
  267. package/dist/dev/media/hls-video/index.js +2 -1
  268. package/dist/dev/media/hls-video/index.js.map +1 -1
  269. package/dist/dev/media/simple-hls-video/index.d.ts +2 -1
  270. package/dist/dev/media/simple-hls-video/index.d.ts.map +1 -1
  271. package/dist/dev/media/simple-hls-video/index.js +2 -1
  272. package/dist/dev/media/simple-hls-video/index.js.map +1 -1
  273. package/dist/dev/player/context.d.ts +16 -2
  274. package/dist/dev/player/context.d.ts.map +1 -1
  275. package/dist/dev/player/context.js +6 -2
  276. package/dist/dev/player/context.js.map +1 -1
  277. package/dist/dev/player/create-player.d.ts +1 -1
  278. package/dist/dev/player/create-player.js +11 -3
  279. package/dist/dev/player/create-player.js.map +1 -1
  280. package/dist/dev/skins/dist/default/default/tailwind/audio.tailwind.js +6 -5
  281. package/dist/dev/skins/dist/default/default/tailwind/audio.tailwind.js.map +1 -1
  282. package/dist/dev/skins/dist/default/default/tailwind/components/controls.js +1 -1
  283. package/dist/dev/skins/dist/default/default/tailwind/components/controls.js.map +1 -1
  284. package/dist/dev/skins/dist/default/default/tailwind/components/error.js +1 -1
  285. package/dist/dev/skins/dist/default/default/tailwind/components/error.js.map +1 -1
  286. package/dist/dev/skins/dist/default/default/tailwind/components/poster.js +16 -0
  287. package/dist/dev/skins/dist/default/default/tailwind/components/poster.js.map +1 -0
  288. package/dist/dev/skins/dist/default/default/tailwind/video.tailwind.js +6 -5
  289. package/dist/dev/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  290. package/dist/dev/skins/dist/default/minimal/tailwind/audio.tailwind.js +1 -1
  291. package/dist/dev/skins/dist/default/minimal/tailwind/audio.tailwind.js.map +1 -1
  292. package/dist/dev/skins/dist/default/minimal/tailwind/components/controls.js +1 -1
  293. package/dist/dev/skins/dist/default/minimal/tailwind/components/controls.js.map +1 -1
  294. package/dist/dev/skins/dist/default/minimal/tailwind/components/playback-rate.js +6 -0
  295. package/dist/dev/skins/dist/default/minimal/tailwind/components/playback-rate.js.map +1 -0
  296. package/dist/dev/skins/dist/default/minimal/tailwind/components/poster.js +16 -0
  297. package/dist/dev/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -0
  298. package/dist/dev/skins/dist/default/minimal/tailwind/components/time.js +1 -1
  299. package/dist/dev/skins/dist/default/minimal/tailwind/components/time.js.map +1 -1
  300. package/dist/dev/skins/dist/default/minimal/tailwind/video.tailwind.js +6 -4
  301. package/dist/dev/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  302. package/dist/dev/skins/dist/default/shared/tailwind/icon-state.js +5 -0
  303. package/dist/dev/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
  304. package/dist/dev/store/container-mixin.d.ts +10 -5
  305. package/dist/dev/store/container-mixin.d.ts.map +1 -1
  306. package/dist/dev/store/container-mixin.js +16 -72
  307. package/dist/dev/store/container-mixin.js.map +1 -1
  308. package/dist/dev/store/media-attach-mixin.d.ts +19 -0
  309. package/dist/dev/store/media-attach-mixin.d.ts.map +1 -0
  310. package/dist/dev/store/media-attach-mixin.js +45 -0
  311. package/dist/dev/store/media-attach-mixin.js.map +1 -0
  312. package/dist/dev/store/provider-mixin.d.ts +19 -6
  313. package/dist/dev/store/provider-mixin.d.ts.map +1 -1
  314. package/dist/dev/store/provider-mixin.js +99 -9
  315. package/dist/dev/store/provider-mixin.js.map +1 -1
  316. package/dist/dev/ui/popover/popover-element.d.ts.map +1 -1
  317. package/dist/dev/ui/popover/popover-element.js +54 -3
  318. package/dist/dev/ui/popover/popover-element.js.map +1 -1
  319. package/dist/dev/ui/time-slider/time-slider-element.js +1 -1
  320. package/dist/dev/ui/time-slider/time-slider-element.js.map +1 -1
  321. package/dist/dev/ui/tooltip/tooltip-element.d.ts.map +1 -1
  322. package/dist/dev/ui/tooltip/tooltip-element.js +53 -3
  323. package/dist/dev/ui/tooltip/tooltip-element.js.map +1 -1
  324. package/dist/dev/ui/volume-slider/volume-slider-element.js +3 -3
  325. package/dist/dev/ui/volume-slider/volume-slider-element.js.map +1 -1
  326. package/package.json +20 -9
@@ -1,351 +1,7 @@
1
- //#region ../store/dist/dev/core/abort-controller-registry.js
2
- var AbortControllerRegistry = class {
3
- #base = new AbortController();
4
- #keys = /* @__PURE__ */ new Map();
5
- /** The attach-scoped signal. Aborts on detach or reattach. */
6
- get base() {
7
- return this.#base.signal;
8
- }
9
- /** Clears all keyed signals, leaving base intact. */
10
- clear() {
11
- for (const controller of this.#keys.values()) controller.abort();
12
- this.#keys.clear();
13
- }
14
- /** Resets base and clears all keyed signals. */
15
- reset() {
16
- this.clear();
17
- this.#base.abort();
18
- this.#base = new AbortController();
19
- }
20
- /** Creates a new signal for the key, superseding any previous signal. */
21
- supersede(key) {
22
- this.#keys.get(key)?.abort();
23
- const controller = new AbortController();
24
- this.#keys.set(key, controller);
25
- return AbortSignal.any([this.#base.signal, controller.signal]);
26
- }
27
- };
28
-
29
- //#endregion
30
- //#region ../store/dist/dev/core/combine.js
31
- /**
32
- * Combines multiple slices into a single slice.
33
- *
34
- * @param slices - The slices to combine.
35
- * @returns A new slice that represents the combination of the input slices.
36
- */
37
- function combine(...slices) {
38
- return {
39
- state: (ctx) => {
40
- const states = slices.map((slice) => slice.state(ctx));
41
- return Object.assign({}, ...states);
42
- },
43
- attach: (ctx) => {
44
- for (const slice of slices) try {
45
- slice.attach?.(ctx);
46
- } catch (err) {
47
- ctx.reportError(err);
48
- }
49
- }
50
- };
51
- }
52
-
53
- //#endregion
54
- //#region ../store/dist/dev/core/errors.js
55
- var StoreError = class extends Error {
56
- code;
57
- cause;
58
- constructor(code, options) {
59
- super(options?.message ?? code);
60
- this.name = "StoreError";
61
- this.code = code;
62
- this.cause = options?.cause;
63
- }
64
- };
65
- function throwNoTargetError() {
66
- throw new StoreError("NO_TARGET");
67
- }
68
- function throwDestroyedError() {
69
- throw new StoreError("DESTROYED");
70
- }
71
-
72
- //#endregion
73
- //#region ../utils/dist/predicate/predicate.js
74
- function isFunction(value) {
75
- return typeof value === "function";
76
- }
77
- function isNull(value) {
78
- return value === null;
79
- }
80
- function isUndefined(value) {
81
- return typeof value === "undefined";
82
- }
83
- /**
84
- * Check if a value is an object, excluding null.
85
- */
86
- function isObject(value) {
87
- return value !== null && typeof value === "object";
88
- }
89
-
90
- //#endregion
91
- //#region ../utils/dist/object/pick.js
92
- /**
93
- * Creates a new object with only the specified keys.
94
- *
95
- * @example
96
- * const obj = { a: 1, b: 2, c: 3 };
97
- * pick(obj, ['a', 'c']); // { a: 1, c: 3 }
98
- */
99
- function pick(obj, keys) {
100
- const result = {};
101
- for (const key of keys) result[key] = obj[key];
102
- return result;
103
- }
104
-
105
- //#endregion
106
- //#region ../store/dist/dev/core/selector.js
107
- const stateContext = {
108
- target: throwNoTargetError,
109
- signals: new AbortControllerRegistry(),
110
- set: throwNoTargetError
111
- };
112
- /**
113
- * Create a type-safe selector for a slice's state.
114
- *
115
- * The selector returns the slice's state, or `undefined` if the slice
116
- * is not configured in the store.
117
- *
118
- * @example
119
- * ```ts
120
- * const selectPlayback = createSelector(playbackSlice);
121
- * selectPlayback(store.state); // { paused, play, pause, ... } | undefined
122
- * selectPlayback.displayName; // 'playback' (from slice name)
123
- * ```
124
- *
125
- * @param slice - The slice to create a selector for.
126
- */
127
- function createSelector(slice) {
128
- const initialState = slice.state(stateContext);
129
- const keys = Object.keys(initialState);
130
- const firstKey = keys[0];
131
- if (!firstKey) return Object.assign(() => void 0, { displayName: slice.name });
132
- return Object.assign((state) => {
133
- if (!(firstKey in state)) return void 0;
134
- return pick(state, keys);
135
- }, { displayName: slice.name });
136
- }
137
-
138
- //#endregion
139
- //#region ../store/dist/dev/core/shallow-equal.js
140
- const hasOwn = Object.prototype.hasOwnProperty;
141
- function shallowEqual(a, b) {
142
- if (Object.is(a, b)) return true;
143
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
144
- const keysA = Object.keys(a);
145
- const keysB = Object.keys(b);
146
- if (keysA.length !== keysB.length) return false;
147
- for (const key of keysA) if (!hasOwn.call(b, key) || !Object.is(a[key], b[key])) return false;
148
- return true;
149
- }
150
-
151
- //#endregion
152
- //#region ../store/dist/dev/core/slice.js
153
- function defineSlice() {
154
- return (config) => config;
155
- }
156
-
157
- //#endregion
158
- //#region ../utils/dist/function/noop.js
159
- function noop(..._args) {}
160
-
161
- //#endregion
162
- //#region ../store/dist/dev/core/state.js
163
- let isFlushScheduled = false;
164
- function scheduleFlush() {
165
- if (isFlushScheduled) return;
166
- isFlushScheduled = true;
167
- queueMicrotask(flush);
168
- }
169
- const pendingContainers = /* @__PURE__ */ new Set();
170
- function flush() {
171
- isFlushScheduled = false;
172
- for (const container of pendingContainers) container.flush();
173
- pendingContainers.clear();
174
- }
175
- const hasOwnProp = Object.prototype.hasOwnProperty;
176
- var StateContainer = class {
177
- #current;
178
- #listeners = /* @__PURE__ */ new Set();
179
- #pending = false;
180
- constructor(initial) {
181
- this.#current = Object.freeze({ ...initial });
182
- }
183
- get current() {
184
- return this.#current;
185
- }
186
- patch(partial) {
187
- const next = { ...this.#current };
188
- let changed = false;
189
- for (const key in partial) {
190
- if (!hasOwnProp.call(partial, key)) continue;
191
- const value = partial[key];
192
- if (!Object.is(this.#current[key], value)) {
193
- next[key] = value;
194
- changed = true;
195
- }
196
- }
197
- if (changed) {
198
- this.#current = Object.freeze(next);
199
- this.#markPending();
200
- }
201
- }
202
- subscribe(callback, options) {
203
- const signal = options?.signal;
204
- if (signal?.aborted) return noop;
205
- this.#listeners.add(callback);
206
- if (!signal) return () => this.#listeners.delete(callback);
207
- const onAbort = () => this.#listeners.delete(callback);
208
- signal.addEventListener("abort", onAbort, { once: true });
209
- return () => {
210
- signal.removeEventListener("abort", onAbort);
211
- this.#listeners.delete(callback);
212
- };
213
- }
214
- flush() {
215
- if (!this.#pending) return;
216
- this.#pending = false;
217
- for (const fn of this.#listeners) fn();
218
- }
219
- #markPending() {
220
- this.#pending = true;
221
- pendingContainers.add(this);
222
- scheduleFlush();
223
- }
224
- };
225
- function createState(initial) {
226
- return new StateContainer(initial);
227
- }
228
-
229
- //#endregion
230
- //#region ../store/dist/dev/core/store.js
231
- const STORE_SYMBOL = Symbol("@videojs/store");
232
- function createStore() {
233
- return (slice, options = {}) => {
234
- let target = null;
235
- let destroyed = false;
236
- const setupAbort = new AbortController();
237
- const signals = new AbortControllerRegistry();
238
- let state;
239
- function validate() {
240
- if (destroyed) throwDestroyedError();
241
- if (!target) throwNoTargetError();
242
- }
243
- const initialState = slice.state({
244
- target: () => {
245
- validate();
246
- return target;
247
- },
248
- signals,
249
- set: (partial) => state.patch(partial)
250
- });
251
- state = createState(initialState);
252
- const store = {
253
- [STORE_SYMBOL]: true,
254
- get $state() {
255
- return state;
256
- },
257
- get target() {
258
- return target;
259
- },
260
- get destroyed() {
261
- return destroyed;
262
- },
263
- get state() {
264
- return state.current;
265
- },
266
- attach,
267
- destroy,
268
- subscribe
269
- };
270
- for (const key of Object.keys(initialState)) Object.defineProperty(store, key, {
271
- get: () => state.current[key],
272
- enumerable: true
273
- });
274
- try {
275
- options.onSetup?.({
276
- store,
277
- signal: setupAbort.signal
278
- });
279
- } catch (error) {
280
- reportError(error);
281
- }
282
- return store;
283
- function attach(newTarget) {
284
- if (destroyed) throwDestroyedError();
285
- signals.reset();
286
- target = newTarget;
287
- const attachContext = {
288
- target: newTarget,
289
- signal: signals.base,
290
- get: () => state.current,
291
- set: (partial) => state.patch(partial),
292
- reportError,
293
- store: {
294
- get state() {
295
- return state.current;
296
- },
297
- subscribe
298
- }
299
- };
300
- try {
301
- slice.attach?.(attachContext);
302
- } catch (error) {
303
- reportError(error);
304
- }
305
- try {
306
- options.onAttach?.({
307
- store,
308
- target: newTarget,
309
- signal: signals.base
310
- });
311
- } catch (error) {
312
- reportError(error);
313
- }
314
- return detach;
315
- }
316
- function detach() {
317
- if (isNull(target)) return;
318
- signals.reset();
319
- target = null;
320
- state.patch(initialState);
321
- }
322
- function destroy() {
323
- if (destroyed) return;
324
- destroyed = true;
325
- detach();
326
- setupAbort.abort();
327
- }
328
- function subscribe(callback, options) {
329
- return state.subscribe(callback, options);
330
- }
331
- function reportError(error) {
332
- if (options.onError) options.onError({
333
- store,
334
- error
335
- });
336
- else console.error("[vjs-store]", error);
337
- }
338
- };
339
- }
340
- function isStore(value) {
341
- return isObject(value) && STORE_SYMBOL in value;
342
- }
343
-
344
- //#endregion
345
- //#region ../core/dist/dev/dom/feature.js
346
- const definePlayerFeature = defineSlice();
1
+ import { R as backgroundFeatures, a as MediaElement, i as MediaContainerElement, o as ReactiveElement, t as createPlayer } from "./create-player-Dv7K1Ezk.js";
2
+ import { t as safeDefine } from "./safe-define-B8lHgj_K.js";
3
+ import { t as MediaAttachMixin } from "./media-attach-mixin-ChyNp2eK.js";
347
4
 
348
- //#endregion
349
5
  //#region ../utils/dist/dom/attributes.js
350
6
  function namedNodeMapToObject(namedNodeMap) {
351
7
  const obj = {};
@@ -353,1681 +9,6 @@ function namedNodeMapToObject(namedNodeMap) {
353
9
  return obj;
354
10
  }
355
11
 
356
- //#endregion
357
- //#region ../utils/dist/dom/event.js
358
- function onEvent(target, type, options) {
359
- return new Promise((resolve, reject) => {
360
- const handleAbort = () => {
361
- reject(options?.signal?.reason ?? "Aborted");
362
- };
363
- if (options?.signal?.aborted) {
364
- handleAbort();
365
- return;
366
- }
367
- options?.signal?.addEventListener("abort", handleAbort, { once: true });
368
- target.addEventListener(type, (event) => {
369
- options?.signal?.removeEventListener("abort", handleAbort);
370
- resolve(event);
371
- }, {
372
- ...options,
373
- once: true
374
- });
375
- });
376
- }
377
-
378
- //#endregion
379
- //#region ../utils/dist/dom/listen.js
380
- function listen(target, type, listener, options) {
381
- target.addEventListener(type, listener, options);
382
- return () => target.removeEventListener(type, listener, options);
383
- }
384
-
385
- //#endregion
386
- //#region ../utils/dist/dom/text-track.js
387
- /** Find the `<track>` element that owns the given `TextTrack`. */
388
- function findTrackElement(media, track) {
389
- for (const el of media.querySelectorAll("track")) if (el.track === track) return el;
390
- return null;
391
- }
392
- function getTextTrackList(media, filterPred) {
393
- if (!media?.textTracks) return [];
394
- return Array.from(media.textTracks).filter(filterPred).sort(sortByTextTrackKind);
395
- }
396
- function sortByTextTrackKind(a, b) {
397
- return a.kind >= b.kind ? 1 : -1;
398
- }
399
-
400
- //#endregion
401
- //#region ../utils/dist/dom/time-ranges.js
402
- /** Converts a TimeRanges object to an array of [start, end] tuples. */
403
- function serializeTimeRanges(ranges) {
404
- const result = [];
405
- for (let i = 0; i < ranges.length; i++) result.push([ranges.start(i), ranges.end(i)]);
406
- return result;
407
- }
408
-
409
- //#endregion
410
- //#region ../core/dist/dev/dom/store/features/buffer.js
411
- const bufferFeature = definePlayerFeature({
412
- name: "buffer",
413
- state: () => ({
414
- buffered: [],
415
- seekable: []
416
- }),
417
- attach({ target, signal, set }) {
418
- const { media } = target;
419
- const sync = () => set({
420
- buffered: serializeTimeRanges(media.buffered),
421
- seekable: serializeTimeRanges(media.seekable)
422
- });
423
- sync();
424
- listen(media, "progress", sync, { signal });
425
- listen(media, "emptied", sync, { signal });
426
- }
427
- });
428
-
429
- //#endregion
430
- //#region ../core/dist/dev/dom/store/features/controls.js
431
- const IDLE_DELAY = 2e3;
432
- const TAP_THRESHOLD = 250;
433
- const controlsFeature = definePlayerFeature({
434
- name: "controls",
435
- state: () => ({
436
- userActive: true,
437
- controlsVisible: true
438
- }),
439
- attach({ target, signal, get, set }) {
440
- const { media, container } = target;
441
- if (isNull(container)) {
442
- console.warn("[vjs] controlsFeature requires a container element for activity tracking.");
443
- return;
444
- }
445
- function computeVisible(userActive) {
446
- return userActive || media.paused;
447
- }
448
- let idleTimer;
449
- function clearIdle() {
450
- clearTimeout(idleTimer);
451
- idleTimer = void 0;
452
- }
453
- function scheduleIdle() {
454
- clearIdle();
455
- idleTimer = setTimeout(setInactive, IDLE_DELAY);
456
- }
457
- function setActive() {
458
- if (!get().userActive) set({
459
- userActive: true,
460
- controlsVisible: true
461
- });
462
- scheduleIdle();
463
- }
464
- function setInactive() {
465
- clearIdle();
466
- set({
467
- userActive: false,
468
- controlsVisible: computeVisible(false)
469
- });
470
- }
471
- let pointerDownTime = 0;
472
- function onPointerDown() {
473
- pointerDownTime = Date.now();
474
- }
475
- function onPointerUp(event) {
476
- if (event.pointerType === "touch" && Date.now() - pointerDownTime < TAP_THRESHOLD) {
477
- const isMediaOrContainer = [media, container].includes(event.target);
478
- if (get().controlsVisible && isMediaOrContainer) setInactive();
479
- else setActive();
480
- } else setActive();
481
- }
482
- function onPlaybackChange() {
483
- const { userActive } = get();
484
- set({ controlsVisible: computeVisible(userActive) });
485
- if (!media.paused && userActive) scheduleIdle();
486
- }
487
- listen(container, "pointermove", setActive, { signal });
488
- listen(container, "pointerdown", onPointerDown, { signal });
489
- listen(container, "pointerup", onPointerUp, { signal });
490
- listen(container, "keyup", setActive, { signal });
491
- listen(container, "focusin", setActive, { signal });
492
- listen(container, "mouseleave", setInactive, { signal });
493
- listen(media, "play", onPlaybackChange, { signal });
494
- listen(media, "pause", onPlaybackChange, { signal });
495
- listen(media, "ended", onPlaybackChange, { signal });
496
- signal.addEventListener("abort", clearIdle, { once: true });
497
- scheduleIdle();
498
- }
499
- });
500
-
501
- //#endregion
502
- //#region ../core/dist/dev/dom/store/features/error.js
503
- const errorFeature = definePlayerFeature({
504
- name: "error",
505
- state: ({ set }) => ({
506
- error: null,
507
- dismissError() {
508
- set({ error: null });
509
- }
510
- }),
511
- attach({ target, signal, set }) {
512
- const { media } = target;
513
- const syncError = () => set({ error: media.error });
514
- listen(media, "error", syncError, { signal });
515
- listen(media, "emptied", () => set({ error: null }), { signal });
516
- }
517
- });
518
-
519
- //#endregion
520
- //#region ../core/dist/dev/dom/presentation/fullscreen.js
521
- /** Check if the Fullscreen API is supported on this platform. */
522
- function isFullscreenEnabled() {
523
- const doc = document;
524
- if (doc.fullscreenEnabled || doc.webkitFullscreenEnabled) return true;
525
- return document.createElement("video").webkitSupportsFullscreen === true;
526
- }
527
- /** Get the current fullscreen element from the document. */
528
- function getFullscreenElement() {
529
- const doc = document;
530
- return doc.fullscreenElement ?? doc.webkitFullscreenElement ?? null;
531
- }
532
- /**
533
- * Check if a specific element (or its media) is currently in fullscreen.
534
- *
535
- * Uses `:fullscreen` pseudo-class which works across Shadow DOM boundaries.
536
- */
537
- function isFullscreenElement(container, media) {
538
- const video = media;
539
- if (video.webkitDisplayingFullscreen && video.webkitPresentationMode === "fullscreen") return true;
540
- const target = container ?? media;
541
- if (getFullscreenElement() === target) return true;
542
- try {
543
- return target.matches(":fullscreen");
544
- } catch {
545
- return false;
546
- }
547
- }
548
- /**
549
- * Request fullscreen mode.
550
- *
551
- * Tries container first (to show custom UI), falls back to media element
552
- * for platforms that only support video fullscreen (iOS Safari).
553
- */
554
- async function requestFullscreen(container, media) {
555
- const video = media;
556
- if (container) {
557
- const el = container;
558
- if (isFunction(el.requestFullscreen)) return el.requestFullscreen();
559
- if (isFunction(el.webkitRequestFullscreen)) return el.webkitRequestFullscreen();
560
- if (isFunction(el.webkitRequestFullScreen)) return el.webkitRequestFullScreen();
561
- }
562
- if (isFunction(video.webkitEnterFullscreen)) {
563
- video.webkitEnterFullscreen();
564
- return;
565
- }
566
- if (isFunction(media.requestFullscreen)) return media.requestFullscreen();
567
- throw new DOMException("Fullscreen not supported", "NotSupportedError");
568
- }
569
- /** Exit fullscreen mode. */
570
- async function exitFullscreen() {
571
- const doc = document;
572
- const video = getFullscreenElement();
573
- if (isFunction(doc.exitFullscreen)) return doc.exitFullscreen();
574
- if (isFunction(doc.webkitExitFullscreen)) return doc.webkitExitFullscreen();
575
- if (isFunction(doc.webkitCancelFullScreen)) return doc.webkitCancelFullScreen();
576
- if (video && isFunction(video.webkitExitFullscreen)) {
577
- video.webkitExitFullscreen();
578
- return;
579
- }
580
- }
581
-
582
- //#endregion
583
- //#region ../core/dist/dev/dom/presentation/pip.js
584
- function resolveMediaTarget(media) {
585
- const target = media.target;
586
- return target instanceof HTMLMediaElement ? target : media;
587
- }
588
- /**
589
- * Check if Picture-in-Picture is supported on this platform.
590
- *
591
- * Note: Safari PWAs don't support PiP even though the API exists.
592
- */
593
- function isPictureInPictureEnabled() {
594
- if (document.pictureInPictureEnabled) {
595
- const isSafari = /.*Version\/.*Safari\/.*/.test(navigator.userAgent);
596
- const isPWA = typeof matchMedia === "function" && matchMedia("(display-mode: standalone)").matches;
597
- return !isSafari || !isPWA;
598
- }
599
- return isFunction(document.createElement("video").webkitSetPresentationMode);
600
- }
601
- /**
602
- * Check if Picture-in-Picture is currently active for a media element.
603
- */
604
- function isPictureInPictureElement(media) {
605
- const target = resolveMediaTarget(media);
606
- if (document.pictureInPictureElement === target) return true;
607
- return target.webkitPresentationMode === "picture-in-picture";
608
- }
609
- /**
610
- * Request Picture-in-Picture mode.
611
- *
612
- * Uses standard API where available, falls back to iOS Safari's
613
- * WebKit presentation mode.
614
- */
615
- async function requestPictureInPicture(media) {
616
- const video = resolveMediaTarget(media);
617
- if (isFunction(video.requestPictureInPicture)) {
618
- await video.requestPictureInPicture();
619
- return;
620
- }
621
- if (isFunction(video.webkitSetPresentationMode)) {
622
- video.webkitSetPresentationMode("picture-in-picture");
623
- return;
624
- }
625
- throw new DOMException("Picture-in-Picture not supported", "NotSupportedError");
626
- }
627
- /**
628
- * Exit Picture-in-Picture mode.
629
- *
630
- * Uses standard API where available, falls back to iOS Safari's
631
- * WebKit presentation mode.
632
- */
633
- async function exitPictureInPicture(media) {
634
- if (isFunction(document.exitPictureInPicture)) try {
635
- await document.exitPictureInPicture();
636
- return;
637
- } catch {}
638
- if (media) {
639
- const video = resolveMediaTarget(media);
640
- const mode = video.webkitPresentationMode;
641
- if (isFunction(video.webkitSetPresentationMode) && (!mode || mode === "picture-in-picture")) {
642
- video.webkitSetPresentationMode("inline");
643
- return;
644
- }
645
- }
646
- }
647
-
648
- //#endregion
649
- //#region ../core/dist/dev/dom/store/features/fullscreen.js
650
- const fullscreenFeature = definePlayerFeature({
651
- name: "fullscreen",
652
- state: ({ target }) => ({
653
- fullscreen: false,
654
- fullscreenAvailability: "unavailable",
655
- async requestFullscreen() {
656
- const { media, container } = target();
657
- if (isPictureInPictureElement(media)) await exitPictureInPicture(media);
658
- return requestFullscreen(container, media);
659
- },
660
- async exitFullscreen() {
661
- return exitFullscreen();
662
- }
663
- }),
664
- attach({ target, signal, set }) {
665
- const { media, container } = target;
666
- set({ fullscreenAvailability: isFullscreenEnabled() ? "available" : "unsupported" });
667
- const sync = () => set({ fullscreen: isFullscreenElement(container, media) });
668
- sync();
669
- listen(document, "fullscreenchange", sync, { signal });
670
- listen(document, "webkitfullscreenchange", sync, { signal });
671
- if ("webkitPresentationMode" in media) listen(media, "webkitpresentationmodechanged", sync, { signal });
672
- }
673
- });
674
-
675
- //#endregion
676
- //#region ../core/dist/dev/dom/store/features/pip.js
677
- const pipFeature = definePlayerFeature({
678
- name: "pip",
679
- state: ({ target }) => ({
680
- pip: false,
681
- pipAvailability: "unavailable",
682
- async requestPictureInPicture() {
683
- const { media, container } = target();
684
- if (isFullscreenElement(container, media)) await exitFullscreen();
685
- return requestPictureInPicture(media);
686
- },
687
- async exitPictureInPicture() {
688
- const { media } = target();
689
- return exitPictureInPicture(media);
690
- }
691
- }),
692
- attach({ target, signal, set }) {
693
- const { media } = target;
694
- set({ pipAvailability: isPictureInPictureEnabled() ? "available" : "unsupported" });
695
- const sync = () => set({ pip: isPictureInPictureElement(media) });
696
- sync();
697
- listen(media, "enterpictureinpicture", sync, { signal });
698
- listen(media, "leavepictureinpicture", sync, { signal });
699
- if ("webkitPresentationMode" in media) listen(media, "webkitpresentationmodechanged", sync, { signal });
700
- }
701
- });
702
-
703
- //#endregion
704
- //#region ../core/dist/dev/dom/store/features/playback.js
705
- const playbackFeature = definePlayerFeature({
706
- name: "playback",
707
- state: ({ target }) => ({
708
- paused: true,
709
- ended: false,
710
- started: false,
711
- waiting: false,
712
- play() {
713
- return target().media.play();
714
- },
715
- pause() {
716
- target().media.pause();
717
- }
718
- }),
719
- attach({ target, signal, set }) {
720
- const { media } = target;
721
- const sync = () => set({
722
- paused: media.paused,
723
- ended: media.ended,
724
- started: !media.paused || media.currentTime > 0,
725
- waiting: media.readyState < HTMLMediaElement.HAVE_FUTURE_DATA && !media.paused
726
- });
727
- sync();
728
- listen(media, "emptied", sync, { signal });
729
- listen(media, "play", sync, { signal });
730
- listen(media, "pause", sync, { signal });
731
- listen(media, "ended", sync, { signal });
732
- listen(media, "playing", sync, { signal });
733
- listen(media, "waiting", sync, { signal });
734
- }
735
- });
736
-
737
- //#endregion
738
- //#region ../core/dist/dev/dom/store/features/playback-rate.js
739
- const DEFAULT_RATES = [
740
- 1,
741
- 1.2,
742
- 1.5,
743
- 1.7,
744
- 2
745
- ];
746
- const playbackRateFeature = definePlayerFeature({
747
- name: "playbackRate",
748
- state: ({ target }) => ({
749
- playbackRates: DEFAULT_RATES,
750
- playbackRate: 1,
751
- setPlaybackRate(rate) {
752
- target().media.playbackRate = rate;
753
- }
754
- }),
755
- attach({ target, signal, set }) {
756
- const { media } = target;
757
- const sync = () => set({ playbackRate: media.playbackRate });
758
- sync();
759
- listen(media, "ratechange", sync, { signal });
760
- }
761
- });
762
-
763
- //#endregion
764
- //#region ../core/dist/dev/dom/store/features/source.js
765
- const sourceFeature = definePlayerFeature({
766
- name: "source",
767
- state: ({ target, signals }) => ({
768
- source: null,
769
- canPlay: false,
770
- loadSource(src) {
771
- signals.clear();
772
- const { media } = target();
773
- media.src = src;
774
- media.load();
775
- return src;
776
- }
777
- }),
778
- attach({ target, signal, set }) {
779
- const { media } = target;
780
- const sync = () => set({
781
- source: media.currentSrc || media.src || null,
782
- canPlay: media.readyState >= HTMLMediaElement.HAVE_ENOUGH_DATA
783
- });
784
- sync();
785
- listen(media, "canplay", sync, { signal });
786
- listen(media, "canplaythrough", sync, { signal });
787
- listen(media, "loadstart", sync, { signal });
788
- listen(media, "emptied", sync, { signal });
789
- }
790
- });
791
-
792
- //#endregion
793
- //#region ../core/dist/dev/dom/store/features/text-track.js
794
- const textTrackFeature = definePlayerFeature({
795
- name: "textTrack",
796
- state: ({ target }) => ({
797
- chaptersCues: [],
798
- thumbnailCues: [],
799
- thumbnailTrackSrc: null,
800
- textTrackList: [],
801
- subtitlesShowing: false,
802
- toggleSubtitles(forceShow) {
803
- const subtitlesTracks = getTextTrackList(target().media, (track) => track.kind === "subtitles" || track.kind === "captions");
804
- if (!subtitlesTracks.length) return false;
805
- const showing = subtitlesTracks.some((track) => track.mode === "showing");
806
- const nextShowing = forceShow ?? !showing;
807
- for (const track of subtitlesTracks) track.mode = nextShowing ? "showing" : "disabled";
808
- return nextShowing;
809
- }
810
- }),
811
- attach({ target, signal, set }) {
812
- const { media } = target;
813
- let trackCleanup = null;
814
- function sync() {
815
- trackCleanup?.abort();
816
- trackCleanup = new AbortController();
817
- let chaptersTrack = null;
818
- let thumbnailTrack = null;
819
- const textTrackList = [];
820
- let subtitlesShowing = false;
821
- for (let i = 0; i < media.textTracks.length; i++) {
822
- const track = media.textTracks[i];
823
- if (!chaptersTrack && track.kind === "chapters") chaptersTrack = track;
824
- if (!thumbnailTrack && track.kind === "metadata" && track.label === "thumbnails") thumbnailTrack = track;
825
- textTrackList.push({
826
- kind: track.kind,
827
- label: track.label,
828
- language: track.language,
829
- mode: track.mode
830
- });
831
- if ((track.kind === "captions" || track.kind === "subtitles") && track.mode === "showing") subtitlesShowing = true;
832
- }
833
- const chaptersCues = chaptersTrack?.cues ? Array.from(chaptersTrack.cues) : [];
834
- const thumbnailCues = thumbnailTrack?.cues ? Array.from(thumbnailTrack.cues) : [];
835
- let thumbnailTrackSrc = null;
836
- if (thumbnailTrack) thumbnailTrackSrc = findTrackElement(media, thumbnailTrack)?.src ?? null;
837
- for (const trackEl of media.querySelectorAll?.("track") ?? []) if (!trackEl.track?.cues?.length) listen(trackEl, "load", sync, { signal: trackCleanup.signal });
838
- set({
839
- chaptersCues,
840
- thumbnailCues,
841
- thumbnailTrackSrc,
842
- textTrackList,
843
- subtitlesShowing
844
- });
845
- }
846
- sync();
847
- listen(media.textTracks, "addtrack", sync, { signal });
848
- listen(media.textTracks, "removetrack", sync, { signal });
849
- listen(media.textTracks, "change", sync, { signal });
850
- listen(media, "loadstart", sync, { signal });
851
- signal.addEventListener("abort", () => trackCleanup?.abort(), { once: true });
852
- }
853
- });
854
-
855
- //#endregion
856
- //#region ../core/dist/dev/dom/media/predicate.js
857
- function hasMetadata(media) {
858
- return media.readyState >= HTMLMediaElement.HAVE_METADATA;
859
- }
860
-
861
- //#endregion
862
- //#region ../core/dist/dev/dom/store/signal-keys.js
863
- const signalKeys = { seek: Symbol.for("@videojs/seek") };
864
-
865
- //#endregion
866
- //#region ../core/dist/dev/dom/store/features/time.js
867
- const timeFeature = definePlayerFeature({
868
- name: "time",
869
- state: ({ target, signals, set }) => ({
870
- currentTime: 0,
871
- duration: 0,
872
- seeking: false,
873
- async seek(time) {
874
- const { media } = target(), signal = signals.supersede(signalKeys.seek);
875
- if (!hasMetadata(media)) {
876
- if (!await onEvent(media, "loadedmetadata", { signal }).catch(() => false)) return media.currentTime;
877
- }
878
- const clampedTime = Math.max(0, Math.min(time, media.duration || Infinity));
879
- set({
880
- currentTime: clampedTime,
881
- seeking: true
882
- });
883
- media.currentTime = clampedTime;
884
- await onEvent(media, "seeked", { signal }).catch(noop);
885
- return media.currentTime;
886
- }
887
- }),
888
- attach({ target, signal, set }) {
889
- const { media } = target;
890
- const sync = () => set({
891
- currentTime: media.currentTime,
892
- duration: Number.isFinite(media.duration) ? media.duration : 0,
893
- seeking: media.seeking
894
- });
895
- sync();
896
- listen(media, "timeupdate", sync, { signal });
897
- listen(media, "durationchange", sync, { signal });
898
- listen(media, "seeking", sync, { signal });
899
- listen(media, "seeked", sync, { signal });
900
- listen(media, "loadedmetadata", sync, { signal });
901
- listen(media, "emptied", sync, { signal });
902
- }
903
- });
904
-
905
- //#endregion
906
- //#region ../core/dist/dev/dom/store/features/volume.js
907
- /** Volume to restore when unmuting at zero. */
908
- const UNMUTE_VOLUME = .25;
909
- const volumeFeature = definePlayerFeature({
910
- name: "volume",
911
- state: ({ target }) => ({
912
- volume: 1,
913
- muted: false,
914
- volumeAvailability: "unavailable",
915
- setVolume(volume) {
916
- const { media } = target();
917
- const clamped = Math.max(0, Math.min(1, volume));
918
- if (clamped > 0 && media.muted) media.muted = false;
919
- media.volume = clamped;
920
- return media.volume;
921
- },
922
- toggleMuted() {
923
- const { media } = target();
924
- if (media.muted || media.volume === 0) {
925
- media.muted = false;
926
- if (media.volume === 0) media.volume = UNMUTE_VOLUME;
927
- } else media.muted = true;
928
- return media.muted;
929
- }
930
- }),
931
- attach({ target, signal, set }) {
932
- const { media } = target;
933
- set({ volumeAvailability: canSetVolume() });
934
- const sync = () => set({
935
- volume: media.volume,
936
- muted: media.muted
937
- });
938
- sync();
939
- listen(media, "volumechange", sync, { signal });
940
- }
941
- });
942
- /** Check if volume can be programmatically set (fails on iOS Safari). */
943
- function canSetVolume() {
944
- const video = document.createElement("video");
945
- try {
946
- video.volume = .5;
947
- return video.volume === .5 ? "available" : "unsupported";
948
- } catch {
949
- return "unsupported";
950
- }
951
- }
952
-
953
- //#endregion
954
- //#region ../core/dist/dev/dom/store/features/presets.js
955
- const backgroundFeatures = [];
956
-
957
- //#endregion
958
- //#region ../core/dist/dev/dom/store/selectors.js
959
- /** Select the buffer state (buffered ranges, percent buffered). */
960
- const selectBuffer = createSelector(bufferFeature);
961
- /** Select the controls state (controls visible, user-active). */
962
- const selectControls = createSelector(controlsFeature);
963
- /** Select the error state (error, dismissed, dismissError). */
964
- const selectError = createSelector(errorFeature);
965
- /** Select the fullscreen state (fullscreen active, availability). */
966
- const selectFullscreen = createSelector(fullscreenFeature);
967
- /** Select the PiP state (picture-in-picture active, availability). */
968
- const selectPiP = createSelector(pipFeature);
969
- /** Select the playback state (paused, ended, play, pause, toggle). */
970
- const selectPlayback = createSelector(playbackFeature);
971
- /** Select the playback rate state (playbackRate, playbackRates, setPlaybackRate). */
972
- const selectPlaybackRate = createSelector(playbackRateFeature);
973
- /** Select the source state (src, type). */
974
- const selectSource = createSelector(sourceFeature);
975
- /** Select the text track state (chapters cues, thumbnail cues). */
976
- const selectTextTrack = createSelector(textTrackFeature);
977
- /** Select the time state (currentTime, duration, seek). */
978
- const selectTime = createSelector(timeFeature);
979
- /** Select the volume state (volume, muted, setVolume, setMuted). */
980
- const selectVolume = createSelector(volumeFeature);
981
-
982
- //#endregion
983
- //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/context-request-event.js
984
- /**
985
- * @license
986
- * Copyright 2021 Google LLC
987
- * SPDX-License-Identifier: BSD-3-Clause
988
- */
989
- /**
990
- * An event fired by a context requester to signal it desires a specified context with the given key.
991
- *
992
- * A provider should inspect the `context` property of the event to determine if it has a value that can
993
- * satisfy the request, calling the `callback` with the requested value if so.
994
- *
995
- * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback
996
- * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`
997
- * method to the callback which consumers can invoke to indicate they no longer wish to receive these updates.
998
- *
999
- * If no `subscribe` value is present in the event, then the provider can assume that this is a 'one time'
1000
- * request for the context and can therefore not track the consumer.
1001
- */
1002
- var ContextRequestEvent = class extends Event {
1003
- /**
1004
- *
1005
- * @param context the context key to request
1006
- * @param contextTarget the original context target of the requester
1007
- * @param callback the callback that should be invoked when the context with the specified key is available
1008
- * @param subscribe when, true indicates we want to subscribe to future updates
1009
- */
1010
- constructor(context, contextTarget, callback, subscribe) {
1011
- super("context-request", {
1012
- bubbles: true,
1013
- composed: true
1014
- });
1015
- this.context = context;
1016
- this.contextTarget = contextTarget;
1017
- this.callback = callback;
1018
- this.subscribe = subscribe ?? false;
1019
- }
1020
- };
1021
-
1022
- //#endregion
1023
- //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/create-context.js
1024
- /**
1025
- * @license
1026
- * Copyright 2021 Google LLC
1027
- * SPDX-License-Identifier: BSD-3-Clause
1028
- */
1029
- /**
1030
- * Creates a typed Context.
1031
- *
1032
- * Contexts are compared with strict equality.
1033
- *
1034
- * If you want two separate `createContext()` calls to referer to the same
1035
- * context, then use a key that will by equal under strict equality like a
1036
- * string for `Symbol.for()`:
1037
- *
1038
- * ```ts
1039
- * // true
1040
- * createContext('my-context') === createContext('my-context')
1041
- * // true
1042
- * createContext(Symbol.for('my-context')) === createContext(Symbol.for('my-context'))
1043
- * ```
1044
- *
1045
- * If you want a context to be unique so that it's guaranteed to not collide
1046
- * with other contexts, use a key that's unique under strict equality, like
1047
- * a `Symbol()` or object.:
1048
- *
1049
- * ```
1050
- * // false
1051
- * createContext({}) === createContext({})
1052
- * // false
1053
- * createContext(Symbol('my-context')) === createContext(Symbol('my-context'))
1054
- * ```
1055
- *
1056
- * @param key a context key value
1057
- * @template ValueType the type of value that can be provided by this context.
1058
- * @returns the context key value cast to `Context<K, ValueType>`
1059
- */
1060
- function createContext(key) {
1061
- return key;
1062
- }
1063
-
1064
- //#endregion
1065
- //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/controllers/context-consumer.js
1066
- /**
1067
- * @license
1068
- * Copyright 2021 Google LLC
1069
- * SPDX-License-Identifier: BSD-3-Clause
1070
- */
1071
- /**
1072
- * A ReactiveController which adds context consuming behavior to a custom
1073
- * element by dispatching `context-request` events.
1074
- *
1075
- * When the host element is connected to the document it will emit a
1076
- * `context-request` event with its context key. When the context request
1077
- * is satisfied the controller will invoke the callback, if present, and
1078
- * trigger a host update so it can respond to the new value.
1079
- *
1080
- * It will also call the dispose method given by the provider when the
1081
- * host element is disconnected.
1082
- */
1083
- var ContextConsumer = class {
1084
- constructor(host, contextOrOptions, callback, subscribe) {
1085
- this.subscribe = false;
1086
- this.provided = false;
1087
- this.value = void 0;
1088
- this._callback = (value, unsubscribe) => {
1089
- if (this.unsubscribe) {
1090
- if (this.unsubscribe !== unsubscribe) {
1091
- this.provided = false;
1092
- this.unsubscribe();
1093
- }
1094
- if (!this.subscribe) this.unsubscribe();
1095
- }
1096
- this.value = value;
1097
- this.host.requestUpdate();
1098
- if (!this.provided || this.subscribe) {
1099
- this.provided = true;
1100
- if (this.callback) this.callback(value, unsubscribe);
1101
- }
1102
- this.unsubscribe = unsubscribe;
1103
- };
1104
- this.host = host;
1105
- if (contextOrOptions.context !== void 0) {
1106
- const options = contextOrOptions;
1107
- this.context = options.context;
1108
- this.callback = options.callback;
1109
- this.subscribe = options.subscribe ?? false;
1110
- } else {
1111
- this.context = contextOrOptions;
1112
- this.callback = callback;
1113
- this.subscribe = subscribe ?? false;
1114
- }
1115
- this.host.addController(this);
1116
- }
1117
- hostConnected() {
1118
- this.dispatchRequest();
1119
- }
1120
- hostDisconnected() {
1121
- if (this.unsubscribe) {
1122
- this.unsubscribe();
1123
- this.unsubscribe = void 0;
1124
- }
1125
- }
1126
- dispatchRequest() {
1127
- this.host.dispatchEvent(new ContextRequestEvent(this.context, this.host, this._callback, this.subscribe));
1128
- }
1129
- };
1130
-
1131
- //#endregion
1132
- //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/value-notifier.js
1133
- /**
1134
- * @license
1135
- * Copyright 2021 Google LLC
1136
- * SPDX-License-Identifier: BSD-3-Clause
1137
- */
1138
- /**
1139
- * A simple class which stores a value, and triggers registered callbacks when
1140
- * the value is changed via its setter.
1141
- *
1142
- * An implementor might use other observable patterns such as MobX or Redux to
1143
- * get behavior like this. But this is a pretty minimal approach that will
1144
- * likely work for a number of use cases.
1145
- */
1146
- var ValueNotifier = class {
1147
- get value() {
1148
- return this._value;
1149
- }
1150
- set value(v) {
1151
- this.setValue(v);
1152
- }
1153
- setValue(v, force = false) {
1154
- const update = force || !Object.is(v, this._value);
1155
- this._value = v;
1156
- if (update) this.updateObservers();
1157
- }
1158
- constructor(defaultValue) {
1159
- this.subscriptions = /* @__PURE__ */ new Map();
1160
- this.updateObservers = () => {
1161
- for (const [callback, { disposer }] of this.subscriptions) callback(this._value, disposer);
1162
- };
1163
- if (defaultValue !== void 0) this.value = defaultValue;
1164
- }
1165
- addCallback(callback, consumerHost, subscribe) {
1166
- if (!subscribe) {
1167
- callback(this.value);
1168
- return;
1169
- }
1170
- if (!this.subscriptions.has(callback)) this.subscriptions.set(callback, {
1171
- disposer: () => {
1172
- this.subscriptions.delete(callback);
1173
- },
1174
- consumerHost
1175
- });
1176
- const { disposer } = this.subscriptions.get(callback);
1177
- callback(this.value, disposer);
1178
- }
1179
- clearCallbacks() {
1180
- this.subscriptions.clear();
1181
- }
1182
- };
1183
-
1184
- //#endregion
1185
- //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/development/lib/controllers/context-provider.js
1186
- /**
1187
- * @license
1188
- * Copyright 2021 Google LLC
1189
- * SPDX-License-Identifier: BSD-3-Clause
1190
- */
1191
- var ContextProviderEvent = class extends Event {
1192
- /**
1193
- *
1194
- * @param context the context which this provider can provide
1195
- * @param contextTarget the original context target of the provider
1196
- */
1197
- constructor(context, contextTarget) {
1198
- super("context-provider", {
1199
- bubbles: true,
1200
- composed: true
1201
- });
1202
- this.context = context;
1203
- this.contextTarget = contextTarget;
1204
- }
1205
- };
1206
- /**
1207
- * A ReactiveController which adds context provider behavior to a
1208
- * custom element.
1209
- *
1210
- * This controller simply listens to the `context-request` event when
1211
- * the host is connected to the DOM and registers the received callbacks
1212
- * against its observable Context implementation.
1213
- *
1214
- * The controller may also be attached to any HTML element in which case it's
1215
- * up to the user to call hostConnected() when attached to the DOM. This is
1216
- * done automatically for any custom elements implementing
1217
- * ReactiveControllerHost.
1218
- */
1219
- var ContextProvider = class extends ValueNotifier {
1220
- constructor(host, contextOrOptions, initialValue) {
1221
- super(contextOrOptions.context !== void 0 ? contextOrOptions.initialValue : initialValue);
1222
- this.onContextRequest = (ev) => {
1223
- if (ev.context !== this.context) return;
1224
- const consumerHost = ev.contextTarget ?? ev.composedPath()[0];
1225
- if (consumerHost === this.host) return;
1226
- ev.stopPropagation();
1227
- this.addCallback(ev.callback, consumerHost, ev.subscribe);
1228
- };
1229
- /**
1230
- * When we get a provider request event, that means a child of this element
1231
- * has just woken up. If it's a provider of our context, then we may need to
1232
- * re-parent our subscriptions, because is a more specific provider than us
1233
- * for its subtree.
1234
- */
1235
- this.onProviderRequest = (ev) => {
1236
- if (ev.context !== this.context) return;
1237
- if ((ev.contextTarget ?? ev.composedPath()[0]) === this.host) return;
1238
- const seen = /* @__PURE__ */ new Set();
1239
- for (const [callback, { consumerHost }] of this.subscriptions) {
1240
- if (seen.has(callback)) continue;
1241
- seen.add(callback);
1242
- consumerHost.dispatchEvent(new ContextRequestEvent(this.context, consumerHost, callback, true));
1243
- }
1244
- ev.stopPropagation();
1245
- };
1246
- this.host = host;
1247
- if (contextOrOptions.context !== void 0) this.context = contextOrOptions.context;
1248
- else this.context = contextOrOptions;
1249
- this.attachListeners();
1250
- this.host.addController?.(this);
1251
- }
1252
- attachListeners() {
1253
- this.host.addEventListener("context-request", this.onContextRequest);
1254
- this.host.addEventListener("context-provider", this.onProviderRequest);
1255
- }
1256
- hostConnected() {
1257
- this.host.dispatchEvent(new ContextProviderEvent(this.context, this.host));
1258
- }
1259
- };
1260
-
1261
- //#endregion
1262
- //#region src/player/context.ts
1263
- const PLAYER_CONTEXT_KEY = Symbol("@videojs/player");
1264
- /**
1265
- * The default player context instance for consuming the player store in controllers.
1266
- *
1267
- * @public
1268
- */
1269
- const playerContext = createContext(PLAYER_CONTEXT_KEY);
1270
-
1271
- //#endregion
1272
- //#region src/store/container-mixin.ts
1273
- /**
1274
- * Create a mixin that consumes player context and auto-attaches media elements.
1275
- *
1276
- * @param context - Player context to consume from an ancestor provider.
1277
- */
1278
- function createContainerMixin(context) {
1279
- return (BaseClass) => {
1280
- class PlayerContainerElement extends BaseClass {
1281
- #detach = noop;
1282
- #observer = null;
1283
- #contextStore = null;
1284
- constructor(...args) {
1285
- super(...args);
1286
- new ContextConsumer(this, {
1287
- context,
1288
- callback: (value) => {
1289
- this.#contextStore = value ?? null;
1290
- this.#attachMedia();
1291
- },
1292
- subscribe: true
1293
- });
1294
- }
1295
- get store() {
1296
- return this.#contextStore;
1297
- }
1298
- connectedCallback() {
1299
- super.connectedCallback();
1300
- this.#observer = new MutationObserver((records) => {
1301
- if (records.some(hasMediaElement)) this.#attachMedia();
1302
- });
1303
- this.#observer.observe(this, {
1304
- childList: true,
1305
- subtree: true,
1306
- attributes: true,
1307
- attributeFilter: ["name"]
1308
- });
1309
- this.addEventListener("slotchange", this.#onSlotChange);
1310
- this.#attachMedia();
1311
- }
1312
- disconnectedCallback() {
1313
- super.disconnectedCallback();
1314
- this.#observer?.disconnect();
1315
- this.#observer = null;
1316
- this.removeEventListener("slotchange", this.#onSlotChange);
1317
- this.#detach();
1318
- }
1319
- #onSlotChange = () => {
1320
- this.#attachMedia();
1321
- };
1322
- #getSlottedMedia() {
1323
- const slot = this.querySelector("slot[name=\"media\"]");
1324
- if (!slot) return null;
1325
- for (const el of slot.assignedElements({ flatten: true })) if (isMediaElement(el)) return el;
1326
- return null;
1327
- }
1328
- #findMediaElement() {
1329
- const media = Array.from(this.children).find(isMediaElement);
1330
- if (media) return media;
1331
- return null;
1332
- }
1333
- #attachMedia() {
1334
- const store = this.#contextStore ?? this.store;
1335
- if (!store) return;
1336
- const media = this.querySelector("video, audio") ?? this.#findMediaElement() ?? this.#getSlottedMedia();
1337
- if (!media) {
1338
- this.#detach();
1339
- this.#detach = noop;
1340
- return;
1341
- }
1342
- if (isCustomMediaElement(media)) globalThis.customElements?.upgrade?.(media);
1343
- const target = {
1344
- media,
1345
- container: this
1346
- };
1347
- const hasMediaChanged = store.target?.media !== target.media, hasContainerChanged = store.target?.container !== target.container;
1348
- if (hasMediaChanged || hasContainerChanged) {
1349
- this.#detach();
1350
- this.#detach = store.attach(target);
1351
- }
1352
- }
1353
- }
1354
- return PlayerContainerElement;
1355
- };
1356
- }
1357
- function isMediaElement(node) {
1358
- return node instanceof HTMLMediaElement || isCustomMediaElement(node);
1359
- }
1360
- function isCustomMediaElement(node) {
1361
- return node instanceof HTMLElement && (node.localName.endsWith("-audio") || node.localName.endsWith("-video"));
1362
- }
1363
- function isMediaSlotElement(node) {
1364
- return node instanceof HTMLSlotElement && node.name === "media";
1365
- }
1366
- function hasMediaElement(record) {
1367
- if (isMediaSlotElement(record.target)) return true;
1368
- for (const node of record.addedNodes) if (isMediaElement(node) || isMediaSlotElement(node)) return true;
1369
- for (const node of record.removedNodes) if (isMediaElement(node) || isMediaSlotElement(node)) return true;
1370
- return false;
1371
- }
1372
-
1373
- //#endregion
1374
- //#region ../element/dist/dev/destroy-mixin.js
1375
- /**
1376
- * Mixin that adds a deferred destruction lifecycle to a `ReactiveElement`.
1377
- *
1378
- * On disconnect, schedules destruction after two animation frames.
1379
- * If the element reconnects before the frames fire (e.g. DOM shuffling,
1380
- * framework reconciliation), the `isConnected` check prevents destruction.
1381
- *
1382
- * The `keep-alive` attribute prevents automatic destruction entirely —
1383
- * call `destroy()` manually when done.
1384
- *
1385
- * Subclasses override `destroyCallback()` (calling `super.destroyCallback()`)
1386
- * to release heavy resources like stores or imperative APIs.
1387
- *
1388
- * Mirrors `addController`/`removeController` to track controllers
1389
- * (needed because `ReactiveElement.#controllers` is hard-private),
1390
- * calls `hostDestroyed()` on all tracked controllers in `destroyCallback`,
1391
- * and guards `performUpdate()` so no updates run after destruction.
1392
- */
1393
- function DestroyMixin(SuperClass) {
1394
- class DestroyableElement extends SuperClass {
1395
- #destroyed = false;
1396
- #trackedControllers = /* @__PURE__ */ new Set();
1397
- get destroyed() {
1398
- return this.#destroyed;
1399
- }
1400
- destroy() {
1401
- if (this.#destroyed) return;
1402
- this.#destroyed = true;
1403
- this.destroyCallback();
1404
- }
1405
- destroyCallback() {
1406
- for (const c of this.#trackedControllers) c.hostDestroyed?.();
1407
- }
1408
- addController(controller) {
1409
- super.addController(controller);
1410
- this.#trackedControllers.add(controller);
1411
- }
1412
- removeController(controller) {
1413
- super.removeController(controller);
1414
- this.#trackedControllers.delete(controller);
1415
- }
1416
- connectedCallback() {
1417
- if (this.#destroyed) return;
1418
- super.connectedCallback();
1419
- }
1420
- disconnectedCallback() {
1421
- super.disconnectedCallback();
1422
- if (!this.#destroyed && !this.hasAttribute("keep-alive")) requestAnimationFrame(() => {
1423
- requestAnimationFrame(() => {
1424
- if (!this.isConnected) this.destroy();
1425
- });
1426
- });
1427
- }
1428
- performUpdate() {
1429
- if (this.#destroyed) return;
1430
- super.performUpdate();
1431
- }
1432
- }
1433
- return DestroyableElement;
1434
- }
1435
-
1436
- //#endregion
1437
- //#region ../element/dist/dev/reactive-element.js
1438
- const cache = /* @__PURE__ */ new WeakMap();
1439
- const propertyKeys = /* @__PURE__ */ new Map();
1440
- /**
1441
- * Lightweight reactive custom element base class.
1442
- *
1443
- * Drop-in subset of Lit's `ReactiveElement` — supports `static properties`,
1444
- * attribute reflection, batched async updates, and reactive controllers.
1445
- * No Shadow DOM, no `static styles`, no decorators.
1446
- *
1447
- * Updates are batched using the same Promise-based scheduling as Lit:
1448
- * property changes enqueue a microtask, and the update is gated behind
1449
- * `connectedCallback` so the first update only runs once the element
1450
- * is in the document.
1451
- *
1452
- * Subclasses that extend another element with properties must spread them:
1453
- *
1454
- * @example
1455
- * ```ts
1456
- * class MyButton extends ReactiveElement {
1457
- * static override properties = {
1458
- * label: { type: String },
1459
- * disabled: { type: Boolean },
1460
- * };
1461
- *
1462
- * label = 'Click me';
1463
- * disabled = false;
1464
- *
1465
- * protected override update(changed: PropertyValues): void {
1466
- * super.update(changed);
1467
- * this.textContent = this.label;
1468
- * }
1469
- * }
1470
- *
1471
- * // Inheritance — spread parent properties
1472
- * class FancyButton extends MyButton {
1473
- * static override properties = {
1474
- * ...MyButton.properties,
1475
- * variant: { type: String },
1476
- * };
1477
- *
1478
- * variant = 'primary';
1479
- * }
1480
- * ```
1481
- */
1482
- var ReactiveElement = class extends HTMLElement {
1483
- static {
1484
- this.properties = {};
1485
- }
1486
- /**
1487
- * Returns a list of attributes corresponding to the registered properties.
1488
- */
1489
- static get observedAttributes() {
1490
- return [...resolve(this).attrToProp.keys()];
1491
- }
1492
- #controllers = /* @__PURE__ */ new Set();
1493
- #changedProperties = /* @__PURE__ */ new Map();
1494
- #instanceProperties;
1495
- /**
1496
- * Promise that gates the first update until `connectedCallback`. Also
1497
- * used to serialize updates — each `#enqueueUpdate` awaits the previous
1498
- * `#updatePromise`, so property changes are batched and updates never
1499
- * overlap. Matches Lit's scheduling model.
1500
- */
1501
- #updatePromise;
1502
- constructor() {
1503
- super();
1504
- this.isUpdatePending = false;
1505
- this.hasUpdated = false;
1506
- this.#updatePromise = new Promise((res) => this.enableUpdating = res);
1507
- const { props } = resolve(this.constructor);
1508
- for (const name of props.keys()) if (Object.hasOwn(this, name)) {
1509
- (this.#instanceProperties ??= /* @__PURE__ */ new Map()).set(name, this[name]);
1510
- delete this[name];
1511
- }
1512
- this.requestUpdate();
1513
- }
1514
- /**
1515
- * Note, this method should be considered final and not overridden. It is
1516
- * overridden on the element instance with a function that triggers the
1517
- * first update.
1518
- */
1519
- enableUpdating(_requestedUpdate) {}
1520
- /**
1521
- * Registers a {@linkcode ReactiveController} to participate in the
1522
- * element's reactive update cycle. The element automatically calls into
1523
- * any registered controllers during its lifecycle callbacks.
1524
- *
1525
- * If the element is connected when `addController()` is called, the
1526
- * controller's `hostConnected()` callback will be immediately called.
1527
- */
1528
- addController(controller) {
1529
- this.#controllers.add(controller);
1530
- if (this.isConnected) controller.hostConnected?.();
1531
- }
1532
- /** Removes a {@linkcode ReactiveController} from the element. */
1533
- removeController(controller) {
1534
- this.#controllers.delete(controller);
1535
- }
1536
- /**
1537
- * On first connection, enables updating and notifies controllers.
1538
- */
1539
- connectedCallback() {
1540
- this.enableUpdating(true);
1541
- for (const c of this.#controllers) c.hostConnected?.();
1542
- }
1543
- disconnectedCallback() {
1544
- for (const c of this.#controllers) c.hostDisconnected?.();
1545
- }
1546
- /**
1547
- * Synchronizes property values when attributes change.
1548
- *
1549
- * Specifically, when an attribute is set, the corresponding property is
1550
- * set. You should rarely need to implement this callback. If this method
1551
- * is overridden, `super.attributeChangedCallback(name, _old, value)` must
1552
- * be called.
1553
- */
1554
- attributeChangedCallback(attr, oldValue, newValue) {
1555
- if (oldValue === newValue) return;
1556
- const { props, attrToProp } = resolve(this.constructor);
1557
- const propName = attrToProp.get(attr);
1558
- if (!propName) return;
1559
- const decl = props.get(propName);
1560
- if (!decl) return;
1561
- let value = newValue;
1562
- if (decl.type === Boolean) value = newValue !== null;
1563
- else if (decl.type === Number) value = newValue === null ? null : Number(newValue);
1564
- this[propName] = value;
1565
- }
1566
- /**
1567
- * Requests an update which is processed asynchronously. This should be
1568
- * called when an element should update based on some state not triggered
1569
- * by setting a reactive property. In this case, pass no arguments. It
1570
- * should also be called when manually implementing a property setter. In
1571
- * this case, pass the property `name` and `oldValue` to ensure that any
1572
- * configured property options are honored.
1573
- */
1574
- requestUpdate(name, oldValue) {
1575
- if (name !== void 0) this.#changedProperties.set(name, oldValue);
1576
- if (this.isUpdatePending) return;
1577
- this.#updatePromise = this.#enqueueUpdate();
1578
- }
1579
- /**
1580
- * Sets up the element to asynchronously update. Awaits the previous
1581
- * `#updatePromise` which both serializes updates and (on first update)
1582
- * waits for `connectedCallback` to resolve the gate.
1583
- */
1584
- async #enqueueUpdate() {
1585
- this.isUpdatePending = true;
1586
- try {
1587
- await this.#updatePromise;
1588
- } catch (e) {
1589
- Promise.reject(e);
1590
- }
1591
- const result = this.scheduleUpdate();
1592
- if (result != null) await result;
1593
- return !this.isUpdatePending;
1594
- }
1595
- /**
1596
- * Schedules an element update. You can override this method to change the
1597
- * timing of updates by returning a Promise. The update will await the
1598
- * returned Promise, and you should resolve the Promise to allow the update
1599
- * to proceed. If this method is overridden, `super.scheduleUpdate()` must
1600
- * be called.
1601
- *
1602
- * For instance, to schedule updates to occur just before the next frame:
1603
- *
1604
- * ```ts
1605
- * override protected async scheduleUpdate(): Promise<unknown> {
1606
- * await new Promise((resolve) => requestAnimationFrame(() => resolve()));
1607
- * super.scheduleUpdate();
1608
- * }
1609
- * ```
1610
- */
1611
- scheduleUpdate() {
1612
- this.performUpdate();
1613
- }
1614
- /**
1615
- * Performs an element update. Note, if an exception is thrown during the
1616
- * update, `firstUpdated` and `updated` will not be called.
1617
- *
1618
- * Call `performUpdate()` to immediately process a pending update. This
1619
- * should generally not be needed, but it can be done in rare cases when
1620
- * you need to update synchronously.
1621
- */
1622
- performUpdate() {
1623
- if (!this.isUpdatePending) return;
1624
- if (!this.hasUpdated && this.#instanceProperties) {
1625
- for (const [name, value] of this.#instanceProperties) this[name] = value;
1626
- this.#instanceProperties = void 0;
1627
- }
1628
- const changed = this.#changedProperties;
1629
- this.willUpdate(changed);
1630
- for (const c of this.#controllers) c.hostUpdate?.();
1631
- this.update(changed);
1632
- this.#changedProperties = /* @__PURE__ */ new Map();
1633
- this.isUpdatePending = false;
1634
- for (const c of this.#controllers) c.hostUpdated?.();
1635
- if (!this.hasUpdated) {
1636
- this.hasUpdated = true;
1637
- this.firstUpdated(changed);
1638
- }
1639
- this.updated(changed);
1640
- }
1641
- /**
1642
- * Invoked before `update()` to compute values needed during the update.
1643
- *
1644
- * Implement `willUpdate` to compute property values that depend on other
1645
- * properties and are used in the rest of the update process.
1646
- *
1647
- * ```ts
1648
- * willUpdate(changed) {
1649
- * if (changed.has('firstName') || changed.has('lastName')) {
1650
- * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);
1651
- * }
1652
- * }
1653
- * ```
1654
- */
1655
- willUpdate(_changed) {}
1656
- /**
1657
- * Updates the element. This method reflects property values to attributes
1658
- * and can be overridden to render and keep updated element DOM. Setting
1659
- * properties inside this method will *not* trigger another update.
1660
- */
1661
- update(_changed) {}
1662
- /**
1663
- * Invoked when the element is first updated. Implement to perform one
1664
- * time work on the element after update.
1665
- *
1666
- * Setting properties inside this method will trigger the element to
1667
- * update again after this update cycle completes.
1668
- */
1669
- firstUpdated(_changed) {}
1670
- /**
1671
- * Invoked whenever the element is updated. Implement to perform
1672
- * post-updating tasks via DOM APIs, for example, focusing an element.
1673
- *
1674
- * Setting properties inside this method will trigger the element to
1675
- * update again after this update cycle completes.
1676
- */
1677
- updated(_changed) {}
1678
- /**
1679
- * Returns a Promise that resolves when the element has completed updating.
1680
- * The Promise value is a boolean that is `true` if the element completed
1681
- * the update without triggering another update. The Promise result is
1682
- * `false` if a property was set inside `updated()`.
1683
- */
1684
- get updateComplete() {
1685
- return this.#updatePromise;
1686
- }
1687
- };
1688
- /**
1689
- * Resolve `ctor.properties` into lookup Maps and install reactive accessors
1690
- * on the prototype. Runs once per class, result is cached.
1691
- *
1692
- * Subclasses that need parent properties must spread them:
1693
- * `static override properties = { ...Parent.properties, ... }`.
1694
- */
1695
- function resolve(ctor) {
1696
- const existing = cache.get(ctor);
1697
- if (existing) return existing;
1698
- const props = /* @__PURE__ */ new Map();
1699
- const attrToProp = /* @__PURE__ */ new Map();
1700
- for (const [name, decl] of Object.entries(ctor.properties)) {
1701
- props.set(name, decl);
1702
- attrToProp.set(decl.attribute ?? name, name);
1703
- if (!Object.getOwnPropertyDescriptor(ctor.prototype, name)?.get) {
1704
- let key = propertyKeys.get(name);
1705
- if (!key) {
1706
- key = Symbol(name);
1707
- propertyKeys.set(name, key);
1708
- }
1709
- Object.defineProperty(ctor.prototype, name, {
1710
- get() {
1711
- return this[key];
1712
- },
1713
- set(value) {
1714
- const old = this[key];
1715
- this[key] = value;
1716
- if (!Object.is(old, value)) this.requestUpdate(name, old);
1717
- },
1718
- configurable: true,
1719
- enumerable: true
1720
- });
1721
- }
1722
- }
1723
- const meta = {
1724
- props,
1725
- attrToProp
1726
- };
1727
- cache.set(ctor, meta);
1728
- return meta;
1729
- }
1730
-
1731
- //#endregion
1732
- //#region src/ui/media-element.ts
1733
- /** Base class for interactive media UI elements. */
1734
- var MediaElement = class extends DestroyMixin(ReactiveElement) {};
1735
-
1736
- //#endregion
1737
- //#region src/media/container-element.ts
1738
- const ContainerMixin = createContainerMixin(playerContext);
1739
- var MediaContainerElement = class extends ContainerMixin(MediaElement) {
1740
- static {
1741
- this.tagName = "media-container";
1742
- }
1743
- };
1744
-
1745
- //#endregion
1746
- //#region src/store/provider-mixin.ts
1747
- /**
1748
- * Create a mixin that provides player context to descendant elements.
1749
- *
1750
- * @param context - Player context to provide to descendants.
1751
- * @param factory - Factory function that creates a store instance.
1752
- */
1753
- function createProviderMixin(context, factory) {
1754
- return (BaseClass) => {
1755
- class PlayerProviderElement extends BaseClass {
1756
- #store = factory();
1757
- #provider = new ContextProvider(this, {
1758
- context,
1759
- initialValue: this.store
1760
- });
1761
- get store() {
1762
- if (isNull(this.#store)) this.#store = factory();
1763
- return this.#store;
1764
- }
1765
- connectedCallback() {
1766
- super.connectedCallback();
1767
- this.#provider.setValue(this.store);
1768
- }
1769
- destroyCallback() {
1770
- this.#store?.destroy();
1771
- this.#store = null;
1772
- super.destroyCallback();
1773
- }
1774
- }
1775
- return PlayerProviderElement;
1776
- };
1777
- }
1778
-
1779
- //#endregion
1780
- //#region ../store/dist/dev/html/controllers/snapshot-controller.js
1781
- /**
1782
- * Subscribe to a `State<T>` container with optional selector.
1783
- *
1784
- * Without selector: returns full state, re-renders on any state change.
1785
- * With selector: returns selected slice, re-renders only when the slice changes (shallowEqual).
1786
- *
1787
- * @example
1788
- * ```ts
1789
- * #state = new SnapshotController(this, sliderState, (s) => s.value);
1790
- * ```
1791
- */
1792
- var SnapshotController = class {
1793
- #host;
1794
- #selector;
1795
- #state;
1796
- #cached;
1797
- #unsubscribe = noop;
1798
- constructor(host, state, selector) {
1799
- this.#host = host;
1800
- this.#state = state;
1801
- this.#selector = selector;
1802
- host.addController(this);
1803
- }
1804
- get value() {
1805
- if (!this.#selector) return this.#state.current;
1806
- this.#cached ??= this.#selector(this.#state.current);
1807
- return this.#cached;
1808
- }
1809
- /** Switch to tracking a different state container. */
1810
- track(state) {
1811
- this.#state = state;
1812
- this.#subscribe();
1813
- }
1814
- hostConnected() {
1815
- this.#subscribe();
1816
- }
1817
- hostDisconnected() {
1818
- this.#unsubscribe();
1819
- this.#unsubscribe = noop;
1820
- this.#cached = void 0;
1821
- }
1822
- #subscribe() {
1823
- this.#unsubscribe();
1824
- if (!this.#selector) {
1825
- this.#unsubscribe = this.#state.subscribe(() => this.#host.requestUpdate());
1826
- return;
1827
- }
1828
- const selector = this.#selector;
1829
- this.#cached = selector(this.#state.current);
1830
- this.#unsubscribe = this.#state.subscribe(() => {
1831
- const next = selector(this.#state.current);
1832
- if (!shallowEqual(this.#cached, next)) {
1833
- this.#cached = next;
1834
- this.#host.requestUpdate();
1835
- }
1836
- });
1837
- }
1838
- };
1839
-
1840
- //#endregion
1841
- //#region ../store/dist/dev/html/store-accessor.js
1842
- /**
1843
- * Resolves a store from either a direct instance or context.
1844
- *
1845
- * When given a direct store, provides immediate access.
1846
- * When given a context, sets up a ContextConsumer to receive the store.
1847
- *
1848
- * @example Direct store
1849
- * ```ts
1850
- * const accessor = new StoreAccessor(host, store, (s) => console.log('available', s));
1851
- * accessor.value; // Store (immediately available)
1852
- * ```
1853
- *
1854
- * @example Context source
1855
- * ```ts
1856
- * const accessor = new StoreAccessor(host, context, (s) => console.log('available', s));
1857
- * accessor.value; // null until context provides store
1858
- * ```
1859
- */
1860
- var StoreAccessor = class {
1861
- #onAvailable;
1862
- #consumer;
1863
- #directStore;
1864
- constructor(host, source, onAvailable) {
1865
- this.#onAvailable = onAvailable ?? noop;
1866
- if (isStore(source)) {
1867
- this.#directStore = source;
1868
- this.#consumer = null;
1869
- } else {
1870
- this.#directStore = null;
1871
- this.#consumer = new ContextConsumer(host, {
1872
- context: source,
1873
- callback: (store) => this.#onAvailable(store),
1874
- subscribe: false
1875
- });
1876
- }
1877
- host.addController(this);
1878
- }
1879
- /** Returns the store, or null if not yet available from context. */
1880
- get value() {
1881
- if (this.#consumer) return this.#consumer.value ?? null;
1882
- return this.#directStore;
1883
- }
1884
- hostConnected() {
1885
- if (this.#directStore) this.#onAvailable(this.#directStore);
1886
- }
1887
- };
1888
-
1889
- //#endregion
1890
- //#region ../store/dist/dev/html/controllers/store-controller.js
1891
- /**
1892
- * Access store state and actions.
1893
- *
1894
- * Without selector: Returns the store, does NOT subscribe to changes.
1895
- * With selector: Returns selected state, triggers update when selected state changes (shallowEqual).
1896
- *
1897
- * @example
1898
- * ```ts
1899
- * // Store access (no subscription) - access actions
1900
- * class Controls extends LitElement {
1901
- * #store = new StoreController(this, storeSource);
1902
- *
1903
- * handleClick() {
1904
- * this.#store.value.setVolume(0.5);
1905
- * }
1906
- * }
1907
- *
1908
- * // Selector-based subscription - re-renders when playback changes
1909
- * class PlayButton extends LitElement {
1910
- * #playback = new StoreController(this, storeSource, selectPlayback);
1911
- *
1912
- * render() {
1913
- * const playback = this.#playback.value;
1914
- * if (!playback) return nothing;
1915
- * return html`<button @click=${playback.toggle}>
1916
- * ${playback.paused ? 'Play' : 'Pause'}
1917
- * </button>`;
1918
- * }
1919
- * }
1920
- * ```
1921
- */
1922
- var StoreController = class {
1923
- #host;
1924
- #selector;
1925
- #accessor;
1926
- #snapshot = null;
1927
- constructor(host, source, selector) {
1928
- this.#host = host;
1929
- this.#selector = selector;
1930
- this.#accessor = new StoreAccessor(host, source, (store) => this.#connect(store));
1931
- host.addController(this);
1932
- }
1933
- get value() {
1934
- const store = this.#accessor.value;
1935
- if (isNull(store)) throw new Error("Store not available");
1936
- if (isUndefined(this.#selector)) return store;
1937
- return this.#snapshot.value;
1938
- }
1939
- hostConnected() {}
1940
- #connect(store) {
1941
- if (isUndefined(this.#selector)) return;
1942
- if (!this.#snapshot) this.#snapshot = new SnapshotController(this.#host, store.$state, this.#selector);
1943
- else this.#snapshot.track(store.$state);
1944
- }
1945
- };
1946
-
1947
- //#endregion
1948
- //#region src/player/player-controller.ts
1949
- /**
1950
- * Reactive controller for accessing player store state.
1951
- *
1952
- * Without selector: Returns the store, does NOT subscribe to changes.
1953
- * With selector: Returns selected state, subscribes with shallowEqual comparison.
1954
- *
1955
- * @example
1956
- * ```ts
1957
- * // Store access (no subscription)
1958
- * class Controls extends MediaElement {
1959
- * #player = new PlayerController(this, playerContext);
1960
- *
1961
- * handleClick() {
1962
- * this.#player.value.setVolume(0.5);
1963
- * }
1964
- * }
1965
- *
1966
- * // Selector-based subscription
1967
- * class PlayButton extends MediaElement {
1968
- * #playback = new PlayerController(this, playerContext, selectPlayback);
1969
- * }
1970
- * ```
1971
- */
1972
- var PlayerController = class {
1973
- #host;
1974
- #selector;
1975
- #consumer;
1976
- #store = null;
1977
- constructor(host, context, selector) {
1978
- this.#host = host;
1979
- this.#selector = selector;
1980
- this.#consumer = new ContextConsumer(host, {
1981
- context,
1982
- callback: (ctx) => this.#connect(ctx),
1983
- subscribe: true
1984
- });
1985
- host.addController(this);
1986
- }
1987
- get value() {
1988
- const store = this.#consumer.value;
1989
- if (!store) return void 0;
1990
- if (!this.#selector) return store;
1991
- return this.#store?.value;
1992
- }
1993
- get displayName() {
1994
- return this.#selector?.displayName;
1995
- }
1996
- hostConnected() {
1997
- const store = this.#consumer.value;
1998
- if (store) this.#connect(store);
1999
- }
2000
- hostDisconnected() {
2001
- this.#store = null;
2002
- }
2003
- #connect(store) {
2004
- if (!this.#store && this.#selector) this.#store = new StoreController(this.#host, store, this.#selector);
2005
- }
2006
- };
2007
-
2008
- //#endregion
2009
- //#region src/player/create-player.ts
2010
- function createPlayer(config) {
2011
- const slice = combine(...config.features);
2012
- function create() {
2013
- return createStore()(slice);
2014
- }
2015
- return {
2016
- context: playerContext,
2017
- create,
2018
- PlayerController,
2019
- ProviderMixin: createProviderMixin(playerContext, create),
2020
- ContainerMixin: createContainerMixin(playerContext)
2021
- };
2022
- }
2023
-
2024
- //#endregion
2025
- //#region src/define/safe-define.ts
2026
- /** Define a custom element only if not already registered. */
2027
- function safeDefine(element) {
2028
- if (!customElements.get(element.tagName)) customElements.define(element.tagName, element);
2029
- }
2030
-
2031
12
  //#endregion
2032
13
  //#region src/define/background/player.ts
2033
14
  const { ProviderMixin } = createPlayer({ features: backgroundFeatures });
@@ -2041,10 +22,12 @@ safeDefine(MediaContainerElement);
2041
22
 
2042
23
  //#endregion
2043
24
  //#region src/define/background/skin.ts
2044
- function getTemplateHTML(_attrs) {
25
+ function getTemplateHTML$1(_attrs) {
2045
26
  return `
2046
27
  <media-container>
2047
- <slot name="media" slot="media"></slot>
28
+ <!-- @deprecated slot="media" is no longer required, use the default slot instead -->
29
+ <slot name="media"></slot>
30
+ <slot></slot>
2048
31
  </media-container>
2049
32
  `;
2050
33
  }
@@ -2056,17 +39,108 @@ var BackgroundVideoSkinElement = class extends ReactiveElement {
2056
39
  this.shadowRootOptions = { mode: "open" };
2057
40
  }
2058
41
  static {
2059
- this.getTemplateHTML = getTemplateHTML;
42
+ this.getTemplateHTML = getTemplateHTML$1;
2060
43
  }
2061
44
  constructor() {
2062
45
  super();
2063
46
  if (!this.shadowRoot) {
2064
47
  this.attachShadow(this.constructor.shadowRootOptions);
2065
- this.shadowRoot.innerHTML = getTemplateHTML(namedNodeMapToObject(this.attributes));
48
+ this.shadowRoot.innerHTML = getTemplateHTML$1(namedNodeMapToObject(this.attributes));
2066
49
  }
2067
50
  }
2068
51
  };
2069
52
  safeDefine(BackgroundVideoSkinElement);
2070
53
 
54
+ //#endregion
55
+ //#region src/media/background-video/index.ts
56
+ function getTemplateHTML(attrs) {
57
+ return `
58
+ <style>
59
+ :host {
60
+ position: relative;
61
+ }
62
+
63
+ video {
64
+ position: absolute;
65
+ inset: 0;
66
+ width: 100%;
67
+ height: 100%;
68
+ object-fit: var(--media-object-fit, inherit);
69
+ object-position: var(--media-object-position, 50% 50%);
70
+ }
71
+ </style>
72
+ <slot></slot>
73
+ <video ${serializeAttributes(attrs)}></video>
74
+ `;
75
+ }
76
+ var BackgroundVideo = class extends MediaAttachMixin(HTMLElement) {
77
+ static {
78
+ this.shadowRootOptions = { mode: "open" };
79
+ }
80
+ static {
81
+ this.getTemplateHTML = getTemplateHTML;
82
+ }
83
+ static get observedAttributes() {
84
+ return ["src"];
85
+ }
86
+ constructor() {
87
+ super();
88
+ if (!this.shadowRoot) {
89
+ this.attachShadow(this.constructor.shadowRootOptions);
90
+ const attrs = {
91
+ ...namedNodeMapToObject(this.attributes),
92
+ ...!this.hasAttribute("nomuted") && { muted: "" },
93
+ ...!this.hasAttribute("noloop") && { loop: "" },
94
+ ...!this.hasAttribute("noautoplay") && { autoplay: "" },
95
+ playsinline: "",
96
+ disableremoteplayback: "",
97
+ disablepictureinpicture: ""
98
+ };
99
+ this.shadowRoot.innerHTML = getTemplateHTML(attrs);
100
+ }
101
+ this.target.muted = !this.hasAttribute("nomuted");
102
+ }
103
+ getMediaTarget() {
104
+ return this.target;
105
+ }
106
+ attributeChangedCallback(attrName, oldValue, newValue) {
107
+ if (attrName === "src" && oldValue !== newValue) this.target.src = newValue ?? "";
108
+ }
109
+ get target() {
110
+ return this.querySelector(":scope > [slot=media]") ?? this.querySelector("video") ?? this.shadowRoot?.querySelector("video") ?? null;
111
+ }
112
+ };
113
+ const VideoAttributes = [
114
+ "autoplay",
115
+ "controls",
116
+ "controlslist",
117
+ "crossorigin",
118
+ "disablepictureinpicture",
119
+ "disableremoteplayback",
120
+ "loop",
121
+ "muted",
122
+ "playsinline",
123
+ "preload"
124
+ ];
125
+ function serializeAttributes(attrs) {
126
+ let html = "";
127
+ for (const key in attrs) {
128
+ if (!VideoAttributes.includes(key)) continue;
129
+ const value = attrs[key];
130
+ if (value === "") html += ` ${key}`;
131
+ else html += ` ${key}="${value}"`;
132
+ }
133
+ return html;
134
+ }
135
+
136
+ //#endregion
137
+ //#region src/define/media/background-video.ts
138
+ var BackgroundVideoElement = class extends BackgroundVideo {
139
+ static {
140
+ this.tagName = "background-video";
141
+ }
142
+ };
143
+ safeDefine(BackgroundVideoElement);
144
+
2071
145
  //#endregion
2072
146
  //# sourceMappingURL=background.dev.js.map