@videojs/html 10.0.0-beta.27 → 10.0.0-beta.29

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 (676) hide show
  1. package/cdn/{adapter-XTen-YVQ.js → adapter-CEnNWvii.js} +17 -4
  2. package/cdn/adapter-CEnNWvii.js.map +1 -0
  3. package/cdn/adapter-DaKW8NzI.js +2 -0
  4. package/cdn/adapter-DaKW8NzI.js.map +1 -0
  5. package/cdn/audio-headless.dev.js +1 -1
  6. package/cdn/audio-headless.js +1 -1
  7. package/cdn/audio-minimal-ui.dev.js +2 -2
  8. package/cdn/audio-minimal-ui.js +1 -1
  9. package/cdn/audio-minimal.dev.js +5 -5
  10. package/cdn/audio-minimal.dev.js.map +1 -1
  11. package/cdn/audio-minimal.js +1 -1
  12. package/cdn/audio-minimal.js.map +1 -1
  13. package/cdn/audio-ui.dev.js +2 -2
  14. package/cdn/audio-ui.js +1 -1
  15. package/cdn/audio.dev.js +5 -5
  16. package/cdn/audio.dev.js.map +1 -1
  17. package/cdn/audio.js +1 -1
  18. package/cdn/audio.js.map +1 -1
  19. package/cdn/background-video-WKumpp49.js +59 -0
  20. package/cdn/background-video-WKumpp49.js.map +1 -0
  21. package/cdn/background-video-YHY_3-lX.js +2 -0
  22. package/cdn/background-video-YHY_3-lX.js.map +1 -0
  23. package/cdn/background.dev.js +3 -56
  24. package/cdn/background.dev.js.map +1 -1
  25. package/cdn/background.js +1 -1
  26. package/cdn/background.js.map +1 -1
  27. package/cdn/bn-CcLIScl6.js +108 -0
  28. package/cdn/bn-CcLIScl6.js.map +1 -0
  29. package/cdn/bn-KcCmQhYd.js +2 -0
  30. package/cdn/bn-KcCmQhYd.js.map +1 -0
  31. package/cdn/compounds-C4YYLyL2.js +8 -0
  32. package/cdn/compounds-C4YYLyL2.js.map +1 -0
  33. package/cdn/{compounds-CCvdpvge.js → compounds-C73u1MeO.js} +68 -71
  34. package/cdn/compounds-C73u1MeO.js.map +1 -0
  35. package/cdn/container-element-Dd0ZCdhK.js +14 -0
  36. package/cdn/container-element-Dd0ZCdhK.js.map +1 -0
  37. package/cdn/container-element-HHK_KZOE.js +376 -0
  38. package/cdn/container-element-HHK_KZOE.js.map +1 -0
  39. package/cdn/create-player-BU8LDJDL.js +2 -0
  40. package/cdn/create-player-BU8LDJDL.js.map +1 -0
  41. package/cdn/{create-player-BHFyOnWi.js → create-player-Db1CIvlK.js} +76 -424
  42. package/cdn/create-player-Db1CIvlK.js.map +1 -0
  43. package/cdn/{default-BqQDVloS.js → default-A3aM0skz.js} +2 -2
  44. package/cdn/default-A3aM0skz.js.map +1 -0
  45. package/cdn/default-BDyhiTCm.js +2 -0
  46. package/cdn/default-BDyhiTCm.js.map +1 -0
  47. package/cdn/{default-I2LasfxC.js → default-C1_k1NeB.js} +2 -2
  48. package/cdn/default-C1_k1NeB.js.map +1 -0
  49. package/cdn/default-DHrMd4ie.js +2 -0
  50. package/cdn/default-DHrMd4ie.js.map +1 -0
  51. package/cdn/embed-params-D2e8u0d4.js +2 -0
  52. package/cdn/embed-params-D2e8u0d4.js.map +1 -0
  53. package/cdn/embed-params-W6T88S8x.js +39 -0
  54. package/cdn/embed-params-W6T88S8x.js.map +1 -0
  55. package/cdn/error-surface-BID4D3DW.js +59 -0
  56. package/cdn/error-surface-BID4D3DW.js.map +1 -0
  57. package/cdn/{select-tracks-nRPBa1NC.js → error-surface-D0bo71gD.js} +442 -48
  58. package/cdn/error-surface-D0bo71gD.js.map +1 -0
  59. package/cdn/{gesture-element-BNfMI8eh.js → gesture-element-CeRy1IVs.js} +2 -2
  60. package/cdn/gesture-element-CeRy1IVs.js.map +1 -0
  61. package/cdn/{gesture-element-CG-Sx_5t.js → gesture-element-DB67OYCE.js} +3 -3
  62. package/cdn/gesture-element-DB67OYCE.js.map +1 -0
  63. package/cdn/hls-js-CiE4wOrG.js +2 -0
  64. package/cdn/{hls-js-6lW7L4th.js.map → hls-js-CiE4wOrG.js.map} +1 -1
  65. package/cdn/hls-js-DBKRCbQm.js +2 -0
  66. package/cdn/{hls-js-DCQzjzB5.js.map → hls-js-DBKRCbQm.js.map} +1 -1
  67. package/cdn/{hls-js-g1zdcyvE.js → hls-js-DX2NGCAr.js} +3 -2
  68. package/cdn/{hls-js-g1zdcyvE.js.map → hls-js-DX2NGCAr.js.map} +1 -1
  69. package/cdn/{hls-js-Cwj8UBx9.js → hls-js-JeH8yvsP.js} +3 -2
  70. package/cdn/{hls-js-Cwj8UBx9.js.map → hls-js-JeH8yvsP.js.map} +1 -1
  71. package/cdn/i18n-CE4KxKuj.js +2 -0
  72. package/cdn/i18n-CE4KxKuj.js.map +1 -0
  73. package/cdn/i18n-CpBDXf6M.js +2 -0
  74. package/cdn/{i18n-DfKGl5Rh.js.map → i18n-CpBDXf6M.js.map} +1 -1
  75. package/cdn/{i18n-Mtlmj1AA.js → i18n-D0nhPa0m.js} +2 -2
  76. package/cdn/{i18n-Mtlmj1AA.js.map → i18n-D0nhPa0m.js.map} +1 -1
  77. package/cdn/i18n-DyF_NfCk.js +157 -0
  78. package/cdn/i18n-DyF_NfCk.js.map +1 -0
  79. package/cdn/i18n.dev.js +3 -152
  80. package/cdn/i18n.dev.js.map +1 -1
  81. package/cdn/i18n.js +1 -1
  82. package/cdn/i18n.js.map +1 -1
  83. package/cdn/live-button-element-Co8z2LkI.js +2 -0
  84. package/cdn/{live-button-element-CWfkQUoy.js.map → live-button-element-Co8z2LkI.js.map} +1 -1
  85. package/cdn/{live-button-element-B_y-ZJBy.js → live-button-element-zE-8uoR2.js} +5 -4
  86. package/cdn/live-button-element-zE-8uoR2.js.map +1 -0
  87. package/cdn/live-video-minimal.dev.js +12 -10
  88. package/cdn/live-video-minimal.dev.js.map +1 -1
  89. package/cdn/live-video-minimal.js +1 -1
  90. package/cdn/live-video-minimal.js.map +1 -1
  91. package/cdn/live-video.dev.js +13 -11
  92. package/cdn/live-video.dev.js.map +1 -1
  93. package/cdn/live-video.js +1 -1
  94. package/cdn/live-video.js.map +1 -1
  95. package/cdn/locales/bn.dev.js +1 -1
  96. package/cdn/locales/bn.js +1 -1
  97. package/cdn/media/background-video.dev.d.ts +1 -0
  98. package/cdn/media/background-video.dev.js +3 -0
  99. package/cdn/media/background-video.js +1 -0
  100. package/cdn/media/cloudflare-video.dev.d.ts +1 -0
  101. package/cdn/media/cloudflare-video.dev.js +668 -0
  102. package/cdn/media/cloudflare-video.dev.js.map +1 -0
  103. package/cdn/media/cloudflare-video.js +2 -0
  104. package/cdn/media/cloudflare-video.js.map +1 -0
  105. package/cdn/media/container.dev.d.ts +1 -0
  106. package/cdn/media/container.dev.js +8 -0
  107. package/cdn/media/container.dev.js.map +1 -0
  108. package/cdn/media/container.js +2 -0
  109. package/cdn/media/container.js.map +1 -0
  110. package/cdn/media/dash-video.dev.js +2 -1
  111. package/cdn/media/dash-video.js +2 -2
  112. package/cdn/media/dash-video.js.map +1 -1
  113. package/cdn/media/google-cast.dev.js +2 -31
  114. package/cdn/media/google-cast.dev.js.map +1 -1
  115. package/cdn/media/google-cast.js +3 -3
  116. package/cdn/media/google-cast.js.map +1 -1
  117. package/cdn/media/hls-audio.dev.js +2 -1
  118. package/cdn/media/hls-audio.js +1 -1
  119. package/cdn/media/hls-audio.js.map +1 -1
  120. package/cdn/media/hls-background-video.dev.js +2 -1
  121. package/cdn/media/hls-background-video.js +1 -1
  122. package/cdn/media/hls-background-video.js.map +1 -1
  123. package/cdn/media/hls-video.dev.js +2 -1
  124. package/cdn/media/hls-video.js +1 -1
  125. package/cdn/media/hls-video.js.map +1 -1
  126. package/cdn/media/hlsjs-video.dev.js +2 -1
  127. package/cdn/media/hlsjs-video.js +1 -1
  128. package/cdn/media/hlsjs-video.js.map +1 -1
  129. package/cdn/media/mux-audio/hls-js.dev.js +3 -1
  130. package/cdn/media/mux-audio/hls-js.js +1 -1
  131. package/cdn/media/mux-audio/spf.dev.js +3 -2
  132. package/cdn/media/mux-audio/spf.js +1 -1
  133. package/cdn/media/mux-audio/spf.js.map +1 -1
  134. package/cdn/media/mux-audio.dev.js +3 -1
  135. package/cdn/media/mux-audio.js +1 -1
  136. package/cdn/media/mux-background-video.dev.js +2 -1
  137. package/cdn/media/mux-background-video.js +1 -1
  138. package/cdn/media/mux-background-video.js.map +1 -1
  139. package/cdn/media/mux-data.dev.js +2 -1
  140. package/cdn/media/mux-data.dev.js.map +1 -1
  141. package/cdn/media/mux-data.js +2 -2
  142. package/cdn/media/mux-data.js.map +1 -1
  143. package/cdn/media/mux-video/hls-js.dev.js +3 -1
  144. package/cdn/media/mux-video/hls-js.js +1 -1
  145. package/cdn/media/mux-video/spf.dev.js +3 -2
  146. package/cdn/media/mux-video/spf.js +1 -1
  147. package/cdn/media/mux-video/spf.js.map +1 -1
  148. package/cdn/media/mux-video.dev.js +3 -1
  149. package/cdn/media/mux-video.js +1 -1
  150. package/cdn/media/native-hls-video.dev.js +1 -0
  151. package/cdn/media/native-hls-video.js +1 -1
  152. package/cdn/media/native-hls-video.js.map +1 -1
  153. package/cdn/media/spotify-audio.dev.d.ts +1 -0
  154. package/cdn/media/spotify-audio.dev.js +605 -0
  155. package/cdn/media/spotify-audio.dev.js.map +1 -0
  156. package/cdn/media/spotify-audio.js +2 -0
  157. package/cdn/media/spotify-audio.js.map +1 -0
  158. package/cdn/media/tiktok-video.dev.d.ts +1 -0
  159. package/cdn/media/tiktok-video.dev.js +636 -0
  160. package/cdn/media/tiktok-video.dev.js.map +1 -0
  161. package/cdn/media/tiktok-video.js +2 -0
  162. package/cdn/media/tiktok-video.js.map +1 -0
  163. package/cdn/media/twitch-video.dev.d.ts +1 -0
  164. package/cdn/media/twitch-video.dev.js +627 -0
  165. package/cdn/media/twitch-video.dev.js.map +1 -0
  166. package/cdn/media/twitch-video.js +2 -0
  167. package/cdn/media/twitch-video.js.map +1 -0
  168. package/cdn/media/vimeo-video.dev.d.ts +1 -0
  169. package/cdn/media/vimeo-video.dev.js +3011 -0
  170. package/cdn/media/vimeo-video.dev.js.map +1 -0
  171. package/cdn/media/vimeo-video.js +16 -0
  172. package/cdn/media/vimeo-video.js.map +1 -0
  173. package/cdn/media/youtube-video.dev.d.ts +1 -0
  174. package/cdn/media/youtube-video.dev.js +713 -0
  175. package/cdn/media/youtube-video.dev.js.map +1 -0
  176. package/cdn/media/youtube-video.js +2 -0
  177. package/cdn/media/youtube-video.js.map +1 -0
  178. package/cdn/{media-Uxm0d3Vx.js → media-BI8caj07.js} +3 -3
  179. package/cdn/{media-Uxm0d3Vx.js.map → media-BI8caj07.js.map} +1 -1
  180. package/cdn/{media-B_gQXwri.js → media-BNuI0Im7.js} +30 -8
  181. package/cdn/media-BNuI0Im7.js.map +1 -0
  182. package/cdn/{media-Cp3acYc8.js → media-BavrGKqa.js} +274 -5
  183. package/cdn/media-BavrGKqa.js.map +1 -0
  184. package/cdn/media-CQxFuDcv.js +2 -0
  185. package/cdn/{media-CbWsJJhU.js.map → media-CQxFuDcv.js.map} +1 -1
  186. package/cdn/media-CanBm0Jh.js +41 -0
  187. package/cdn/media-CanBm0Jh.js.map +1 -0
  188. package/cdn/media-D4tG62L5.js +2 -0
  189. package/cdn/{media-BTipOcKo.js.map → media-D4tG62L5.js.map} +1 -1
  190. package/cdn/{media-DRo3n8tM.js → media-DI6DvYm3.js} +4 -4
  191. package/cdn/{media-DRo3n8tM.js.map → media-DI6DvYm3.js.map} +1 -1
  192. package/cdn/media-DU3Xf5XR.js +2 -0
  193. package/cdn/media-DU3Xf5XR.js.map +1 -0
  194. package/cdn/media-mYKOAsk3.js +825 -0
  195. package/cdn/media-mYKOAsk3.js.map +1 -0
  196. package/cdn/media-played-ranges-CM2zeOGr.js +2 -0
  197. package/cdn/media-played-ranges-CM2zeOGr.js.map +1 -0
  198. package/cdn/media-played-ranges-Yd9acuMt.js +156 -0
  199. package/cdn/media-played-ranges-Yd9acuMt.js.map +1 -0
  200. package/cdn/media-zReLnePj.js +2 -0
  201. package/cdn/media-zReLnePj.js.map +1 -0
  202. package/cdn/{minimal-DQCLKRyR.js → minimal-3OmH0xQS.js} +2 -2
  203. package/cdn/minimal-3OmH0xQS.js.map +1 -0
  204. package/cdn/{minimal-DLosvq31.js → minimal-6w_Vyyl9.js} +2 -2
  205. package/cdn/minimal-6w_Vyyl9.js.map +1 -0
  206. package/cdn/minimal-BWLTn7oQ.js +2 -0
  207. package/cdn/minimal-BWLTn7oQ.js.map +1 -0
  208. package/cdn/minimal-DIGrklyh.js +2 -0
  209. package/cdn/minimal-DIGrklyh.js.map +1 -0
  210. package/cdn/{minimal-ui-Bxcpf5Mb.js → minimal-ui-BCIESK8f.js} +9 -9
  211. package/cdn/{minimal-ui-Bxcpf5Mb.js.map → minimal-ui-BCIESK8f.js.map} +1 -1
  212. package/cdn/minimal-ui-BXrq3z4U.js +2 -0
  213. package/cdn/{minimal-ui-BVKu9LWj.js.map → minimal-ui-BXrq3z4U.js.map} +1 -1
  214. package/cdn/{minimal-ui--JsmpU2q.js → minimal-ui-DEalpMk6.js} +5 -5
  215. package/cdn/{minimal-ui--JsmpU2q.js.map → minimal-ui-DEalpMk6.js.map} +1 -1
  216. package/cdn/minimal-ui-vY3QgohH.js +2 -0
  217. package/cdn/{minimal-ui-AFk6Ut5f.js.map → minimal-ui-vY3QgohH.js.map} +1 -1
  218. package/cdn/mixin-BqN0V06a.js +2 -0
  219. package/cdn/{mixin-DiB7dIef.js.map → mixin-BqN0V06a.js.map} +1 -1
  220. package/cdn/{mixin-CkNZwQXF.js → mixin-C193v40v.js} +67 -67
  221. package/cdn/mixin-C193v40v.js.map +1 -0
  222. package/cdn/noop-BxkeRIz9.js +6 -0
  223. package/cdn/noop-BxkeRIz9.js.map +1 -0
  224. package/cdn/noop-Ch0IHcOP.js +2 -0
  225. package/cdn/noop-Ch0IHcOP.js.map +1 -0
  226. package/cdn/{player-C4ix6TQq.js → player-B3GlPF90.js} +3 -2
  227. package/cdn/{player-C4ix6TQq.js.map → player-B3GlPF90.js.map} +1 -1
  228. package/cdn/player-CtTC7qa5.js +2 -0
  229. package/cdn/{player-B0ccW5-n.js.map → player-CtTC7qa5.js.map} +1 -1
  230. package/cdn/player-DKkph8UM.js +2 -0
  231. package/cdn/{player-srq1RGTj.js.map → player-DKkph8UM.js.map} +1 -1
  232. package/cdn/{player-B0qnepD5.js → player-DPDmTRvg.js} +3 -2
  233. package/cdn/{player-B0qnepD5.js.map → player-DPDmTRvg.js.map} +1 -1
  234. package/cdn/player-DrDd7LJi.js +2 -0
  235. package/cdn/{player-iIewo8Y9.js.map → player-DrDd7LJi.js.map} +1 -1
  236. package/cdn/{player-D4fdOLLk.js → player-L5UpZmT4.js} +3 -2
  237. package/cdn/{player-D4fdOLLk.js.map → player-L5UpZmT4.js.map} +1 -1
  238. package/cdn/{poster-element-BP1Ypgbf.js → poster-element-B5tdJ2ub.js} +192 -39
  239. package/cdn/poster-element-B5tdJ2ub.js.map +1 -0
  240. package/cdn/poster-element-B8QwXSU_.js +2 -0
  241. package/cdn/poster-element-B8QwXSU_.js.map +1 -0
  242. package/cdn/{error-surface-drmCvBVW.js → relocation-pipelines-Dh8CcgHw.js} +5 -343
  243. package/cdn/relocation-pipelines-Dh8CcgHw.js.map +1 -0
  244. package/cdn/relocation-pipelines-DunE4gcV.js +2 -0
  245. package/cdn/relocation-pipelines-DunE4gcV.js.map +1 -0
  246. package/cdn/script-D3ZkiqwO.js +2 -0
  247. package/cdn/script-D3ZkiqwO.js.map +1 -0
  248. package/cdn/script-erPJaaTz.js +33 -0
  249. package/cdn/script-erPJaaTz.js.map +1 -0
  250. package/cdn/{seek-button-element-TErrbilI.js → seek-button-element-5co-k0Dx.js} +7 -6
  251. package/cdn/seek-button-element-5co-k0Dx.js.map +1 -0
  252. package/cdn/seek-button-element-B8TkILg-.js +2 -0
  253. package/cdn/seek-button-element-B8TkILg-.js.map +1 -0
  254. package/cdn/shallow-equal-C7S8rj2f.js +16 -0
  255. package/cdn/shallow-equal-C7S8rj2f.js.map +1 -0
  256. package/cdn/shallow-equal-KV1zFqZi.js +2 -0
  257. package/cdn/shallow-equal-KV1zFqZi.js.map +1 -0
  258. package/cdn/{skin-element-wPSb4AAs.js → skin-element-DrkI8xuM.js} +2 -2
  259. package/cdn/{skin-element-wPSb4AAs.js.map → skin-element-DrkI8xuM.js.map} +1 -1
  260. package/cdn/{skin-element-1_MG2zgS.js → skin-element-DvX6Bxsv.js} +2 -2
  261. package/cdn/{skin-element-1_MG2zgS.js.map → skin-element-DvX6Bxsv.js.map} +1 -1
  262. package/cdn/text-element-BoY6AhMn.js +2 -0
  263. package/cdn/{text-element-Bsyglab8.js.map → text-element-BoY6AhMn.js.map} +1 -1
  264. package/cdn/{text-element-DTB9_2HX.js → text-element-cg6l21cd.js} +3 -3
  265. package/cdn/{text-element-DTB9_2HX.js.map → text-element-cg6l21cd.js.map} +1 -1
  266. package/cdn/time-slider-chapters-element-BfLjdnU4.js +2 -0
  267. package/cdn/time-slider-chapters-element-BfLjdnU4.js.map +1 -0
  268. package/cdn/{time-slider-chapters-element-DPgaLdBt.js → time-slider-chapters-element-CznFQWFm.js} +7 -6
  269. package/cdn/time-slider-chapters-element-CznFQWFm.js.map +1 -0
  270. package/cdn/{translate-text-DP0CzUCC.js → translate-text-BWvoW5-r.js} +2 -7
  271. package/cdn/translate-text-BWvoW5-r.js.map +1 -0
  272. package/cdn/translate-text-TzSgu_oe.js +2 -0
  273. package/cdn/translate-text-TzSgu_oe.js.map +1 -0
  274. package/cdn/{ui-D0AokGxw.js → ui-BwzqkJNK.js} +8 -8
  275. package/cdn/{ui-D0AokGxw.js.map → ui-BwzqkJNK.js.map} +1 -1
  276. package/cdn/ui-DayfItun.js +2 -0
  277. package/cdn/{ui-CecDxhTX.js.map → ui-DayfItun.js.map} +1 -1
  278. package/cdn/ui-PSnD-pv8.js +2 -0
  279. package/cdn/{ui-ChWM6Xz2.js.map → ui-PSnD-pv8.js.map} +1 -1
  280. package/cdn/{ui-p36Szn71.js → ui-fnKp94a7.js} +10 -10
  281. package/cdn/{ui-p36Szn71.js.map → ui-fnKp94a7.js.map} +1 -1
  282. package/cdn/video-headless.dev.js +1 -1
  283. package/cdn/video-headless.js +1 -1
  284. package/cdn/video-minimal-ui.dev.js +2 -2
  285. package/cdn/video-minimal-ui.js +1 -1
  286. package/cdn/video-minimal.dev.js +8 -6
  287. package/cdn/video-minimal.dev.js.map +1 -1
  288. package/cdn/video-minimal.js +1 -1
  289. package/cdn/video-minimal.js.map +1 -1
  290. package/cdn/video-ui.dev.js +2 -2
  291. package/cdn/video-ui.js +1 -1
  292. package/cdn/video.dev.js +9 -7
  293. package/cdn/video.dev.js.map +1 -1
  294. package/cdn/video.js +1 -1
  295. package/cdn/video.js.map +1 -1
  296. package/dist/default/__generated__/skins/default-video/styles/buttons.css +132 -18
  297. package/dist/default/__generated__/skins/default-video/styles/captions.css +22 -0
  298. package/dist/default/__generated__/skins/default-video/styles/container.css +121 -8
  299. package/dist/default/__generated__/skins/default-video/styles/controls.css +436 -21
  300. package/dist/default/__generated__/skins/default-video/styles/dialog.css +169 -0
  301. package/dist/default/__generated__/skins/default-video/styles/indicator.css +459 -0
  302. package/dist/default/__generated__/skins/default-video/styles/menus.css +254 -0
  303. package/dist/default/__generated__/skins/default-video/styles/overlays.css +26 -2
  304. package/dist/default/__generated__/skins/default-video/styles/popups.css +338 -12
  305. package/dist/default/__generated__/skins/default-video/styles/poster.css +4 -4
  306. package/dist/default/__generated__/skins/default-video/styles/sliders.css +355 -31
  307. package/dist/default/__generated__/skins/default-video/styles/styles.css +2455 -216
  308. package/dist/default/__generated__/skins/default-video/styles/theme.css +4 -19
  309. package/dist/default/__generated__/skins/default-video/styles/video.css +29 -0
  310. package/dist/default/__generated__/skins/minimal-video/styles/base.css +25 -0
  311. package/dist/default/__generated__/skins/minimal-video/styles/buttons.css +266 -0
  312. package/dist/default/__generated__/skins/minimal-video/styles/captions.css +22 -0
  313. package/dist/default/__generated__/skins/minimal-video/styles/container.css +158 -0
  314. package/dist/default/__generated__/skins/minimal-video/styles/controls.css +182 -0
  315. package/dist/default/__generated__/skins/minimal-video/styles/dialog.css +77 -0
  316. package/dist/default/__generated__/skins/minimal-video/styles/indicator.css +322 -0
  317. package/dist/default/__generated__/skins/minimal-video/styles/menus.css +254 -0
  318. package/dist/default/__generated__/skins/minimal-video/styles/overlays.css +35 -0
  319. package/dist/default/__generated__/skins/minimal-video/styles/popups.css +371 -0
  320. package/dist/default/__generated__/skins/minimal-video/styles/poster.css +47 -0
  321. package/dist/default/__generated__/skins/minimal-video/styles/sliders.css +436 -0
  322. package/dist/default/__generated__/skins/minimal-video/styles/styles.css +2246 -0
  323. package/dist/default/__generated__/skins/minimal-video/styles/theme.css +7 -0
  324. package/dist/default/__generated__/skins/minimal-video/styles/video.css +29 -0
  325. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  326. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  327. package/dist/default/_virtual/inline-css_src/define/audio/skin.js +1 -1
  328. package/dist/default/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  329. package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
  330. package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
  331. package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
  332. package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
  333. package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
  334. package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
  335. package/dist/default/_virtual/inline-css_src/define/live-video/skin.js +1 -1
  336. package/dist/default/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
  337. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  338. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  339. package/dist/default/_virtual/inline-css_src/define/video/skin.js +1 -1
  340. package/dist/default/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  341. package/dist/default/define/audio/minimal-skin.css +117 -118
  342. package/dist/default/define/audio/skin.css +95 -99
  343. package/dist/default/define/live-audio/minimal-skin.css +117 -118
  344. package/dist/default/define/live-audio/skin.css +95 -99
  345. package/dist/default/define/live-video/minimal-skin.css +158 -137
  346. package/dist/default/define/live-video/minimal-skin.js +1 -1
  347. package/dist/default/define/live-video/minimal-skin.js.map +1 -1
  348. package/dist/default/define/live-video/minimal-skin.tailwind.js +1 -1
  349. package/dist/default/define/live-video/minimal-skin.tailwind.js.map +1 -1
  350. package/dist/default/define/live-video/skin.css +120 -106
  351. package/dist/default/define/live-video/skin.js +1 -1
  352. package/dist/default/define/live-video/skin.js.map +1 -1
  353. package/dist/default/define/live-video/skin.tailwind.js +1 -1
  354. package/dist/default/define/live-video/skin.tailwind.js.map +1 -1
  355. package/dist/default/define/ui/gesture.js +7 -0
  356. package/dist/default/define/ui/gesture.js.map +1 -0
  357. package/dist/default/define/video/minimal-skin.css +158 -137
  358. package/dist/default/define/video/minimal-skin.js +1 -1
  359. package/dist/default/define/video/minimal-skin.js.map +1 -1
  360. package/dist/default/define/video/minimal-skin.tailwind.js +1 -1
  361. package/dist/default/define/video/minimal-skin.tailwind.js.map +1 -1
  362. package/dist/default/define/video/skin.css +120 -106
  363. package/dist/default/define/video/skin.js +1 -1
  364. package/dist/default/define/video/skin.js.map +1 -1
  365. package/dist/default/define/video/skin.tailwind.js +1 -1
  366. package/dist/default/define/video/skin.tailwind.js.map +1 -1
  367. package/dist/default/icons/dist/element/default/icons.js +1 -1
  368. package/dist/default/icons/dist/element/default/icons.js.map +1 -1
  369. package/dist/default/icons/dist/element/minimal/icons.js +1 -1
  370. package/dist/default/icons/dist/element/minimal/icons.js.map +1 -1
  371. package/dist/default/icons/dist/html/default/airplay-exit.js +1 -1
  372. package/dist/default/icons/dist/html/default/airplay-exit.js.map +1 -1
  373. package/dist/default/icons/dist/html/minimal/airplay-exit.js +1 -1
  374. package/dist/default/icons/dist/html/minimal/airplay-exit.js.map +1 -1
  375. package/dist/default/icons/dist/render/default/index.js +1 -1
  376. package/dist/default/icons/dist/render/default/index.js.map +1 -1
  377. package/dist/default/icons/dist/render/minimal/index.js +1 -1
  378. package/dist/default/icons/dist/render/minimal/index.js.map +1 -1
  379. package/dist/default/media/hls-background-video/media.js +18 -0
  380. package/dist/default/media/hls-background-video/media.js.map +1 -1
  381. package/dist/default/media/tiktok-video/media.js +3 -2
  382. package/dist/default/media/tiktok-video/media.js.map +1 -1
  383. package/dist/default/skins/dist/default/default/tailwind/components/button.js +3 -1
  384. package/dist/default/skins/dist/default/default/tailwind/components/button.js.map +1 -1
  385. package/dist/default/skins/dist/default/default/tailwind/components/poster.js +8 -1
  386. package/dist/default/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
  387. package/dist/default/skins/dist/default/default/tailwind/components/slider.js +13 -13
  388. package/dist/default/skins/dist/default/default/tailwind/components/slider.js.map +1 -1
  389. package/dist/default/skins/dist/default/default/tailwind/components/thumbnail.js +1 -1
  390. package/dist/default/skins/dist/default/default/tailwind/components/thumbnail.js.map +1 -1
  391. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js +3 -3
  392. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  393. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js +8 -1
  394. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
  395. package/dist/default/skins/dist/default/minimal/tailwind/components/slider.js +13 -12
  396. package/dist/default/skins/dist/default/minimal/tailwind/components/slider.js.map +1 -1
  397. package/dist/default/skins/dist/default/minimal/tailwind/components/thumbnail.js +1 -1
  398. package/dist/default/skins/dist/default/minimal/tailwind/components/thumbnail.js.map +1 -1
  399. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js +7 -6
  400. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  401. package/dist/default/skins/dist/default/shared/tailwind/icon-state.js +4 -4
  402. package/dist/default/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
  403. package/dist/default/store/provider-mixin.js +22 -8
  404. package/dist/default/store/provider-mixin.js.map +1 -1
  405. package/dist/default/ui/audio-track-radio-group/audio-track-radio-group-element.js +1 -1
  406. package/dist/default/ui/audio-track-radio-group/audio-track-radio-group-element.js.map +1 -1
  407. package/dist/default/ui/captions-radio-group/captions-radio-group-element.js +1 -1
  408. package/dist/default/ui/captions-radio-group/captions-radio-group-element.js.map +1 -1
  409. package/dist/default/ui/gesture/gesture-element.js.map +1 -1
  410. package/dist/default/ui/hotkey/hotkey-element.js.map +1 -1
  411. package/dist/default/ui/menu/context.js.map +1 -1
  412. package/dist/default/ui/menu/menu-element.js +28 -27
  413. package/dist/default/ui/menu/menu-element.js.map +1 -1
  414. package/dist/default/ui/menu/menu-radio-group-element.js +14 -14
  415. package/dist/default/ui/menu/menu-radio-group-element.js.map +1 -1
  416. package/dist/default/ui/playback-rate-button/playback-rate-button-element.js +1 -2
  417. package/dist/default/ui/playback-rate-button/playback-rate-button-element.js.map +1 -1
  418. package/dist/default/ui/playback-rate-radio-group/playback-rate-radio-group-element.js +1 -1
  419. package/dist/default/ui/playback-rate-radio-group/playback-rate-radio-group-element.js.map +1 -1
  420. package/dist/default/ui/poster/poster-element.js +138 -8
  421. package/dist/default/ui/poster/poster-element.js.map +1 -1
  422. package/dist/default/ui/quality-radio-group/quality-radio-group-element.js +1 -1
  423. package/dist/default/ui/quality-radio-group/quality-radio-group-element.js.map +1 -1
  424. package/dist/default/ui/slider/slider-preview-element.js.map +1 -1
  425. package/dist/dev/__generated__/skins/default-video/styles/buttons.css +132 -18
  426. package/dist/dev/__generated__/skins/default-video/styles/captions.css +22 -0
  427. package/dist/dev/__generated__/skins/default-video/styles/container.css +121 -8
  428. package/dist/dev/__generated__/skins/default-video/styles/controls.css +436 -21
  429. package/dist/dev/__generated__/skins/default-video/styles/dialog.css +169 -0
  430. package/dist/dev/__generated__/skins/default-video/styles/indicator.css +459 -0
  431. package/dist/dev/__generated__/skins/default-video/styles/menus.css +254 -0
  432. package/dist/dev/__generated__/skins/default-video/styles/overlays.css +26 -2
  433. package/dist/dev/__generated__/skins/default-video/styles/popups.css +338 -12
  434. package/dist/dev/__generated__/skins/default-video/styles/poster.css +4 -4
  435. package/dist/dev/__generated__/skins/default-video/styles/sliders.css +355 -31
  436. package/dist/dev/__generated__/skins/default-video/styles/styles.css +2455 -216
  437. package/dist/dev/__generated__/skins/default-video/styles/theme.css +4 -19
  438. package/dist/dev/__generated__/skins/default-video/styles/video.css +29 -0
  439. package/dist/dev/__generated__/skins/minimal-video/styles/base.css +25 -0
  440. package/dist/dev/__generated__/skins/minimal-video/styles/buttons.css +266 -0
  441. package/dist/dev/__generated__/skins/minimal-video/styles/captions.css +22 -0
  442. package/dist/dev/__generated__/skins/minimal-video/styles/container.css +158 -0
  443. package/dist/dev/__generated__/skins/minimal-video/styles/controls.css +182 -0
  444. package/dist/dev/__generated__/skins/minimal-video/styles/dialog.css +77 -0
  445. package/dist/dev/__generated__/skins/minimal-video/styles/indicator.css +322 -0
  446. package/dist/dev/__generated__/skins/minimal-video/styles/menus.css +254 -0
  447. package/dist/dev/__generated__/skins/minimal-video/styles/overlays.css +35 -0
  448. package/dist/dev/__generated__/skins/minimal-video/styles/popups.css +371 -0
  449. package/dist/dev/__generated__/skins/minimal-video/styles/poster.css +47 -0
  450. package/dist/dev/__generated__/skins/minimal-video/styles/sliders.css +436 -0
  451. package/dist/dev/__generated__/skins/minimal-video/styles/styles.css +2246 -0
  452. package/dist/dev/__generated__/skins/minimal-video/styles/theme.css +7 -0
  453. package/dist/dev/__generated__/skins/minimal-video/styles/video.css +29 -0
  454. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  455. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  456. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js +1 -1
  457. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  458. package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
  459. package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
  460. package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
  461. package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
  462. package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
  463. package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
  464. package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js +1 -1
  465. package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
  466. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  467. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  468. package/dist/dev/_virtual/inline-css_src/define/video/skin.js +1 -1
  469. package/dist/dev/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  470. package/dist/dev/define/audio/minimal-skin.css +117 -118
  471. package/dist/dev/define/audio/skin.css +95 -99
  472. package/dist/dev/define/live-audio/minimal-skin.css +117 -118
  473. package/dist/dev/define/live-audio/skin.css +95 -99
  474. package/dist/dev/define/live-video/minimal-skin.css +158 -137
  475. package/dist/dev/define/live-video/minimal-skin.d.ts.map +1 -1
  476. package/dist/dev/define/live-video/minimal-skin.js +3 -1
  477. package/dist/dev/define/live-video/minimal-skin.js.map +1 -1
  478. package/dist/dev/define/live-video/minimal-skin.tailwind.d.ts.map +1 -1
  479. package/dist/dev/define/live-video/minimal-skin.tailwind.js +3 -1
  480. package/dist/dev/define/live-video/minimal-skin.tailwind.js.map +1 -1
  481. package/dist/dev/define/live-video/skin.css +120 -106
  482. package/dist/dev/define/live-video/skin.d.ts.map +1 -1
  483. package/dist/dev/define/live-video/skin.js +3 -1
  484. package/dist/dev/define/live-video/skin.js.map +1 -1
  485. package/dist/dev/define/live-video/skin.tailwind.d.ts.map +1 -1
  486. package/dist/dev/define/live-video/skin.tailwind.js +4 -2
  487. package/dist/dev/define/live-video/skin.tailwind.js.map +1 -1
  488. package/dist/dev/define/ui/gesture.d.ts +8 -0
  489. package/dist/dev/define/ui/gesture.d.ts.map +1 -0
  490. package/dist/dev/define/ui/gesture.js +7 -0
  491. package/dist/dev/define/ui/gesture.js.map +1 -0
  492. package/dist/dev/define/video/minimal-skin.css +158 -137
  493. package/dist/dev/define/video/minimal-skin.d.ts.map +1 -1
  494. package/dist/dev/define/video/minimal-skin.js +3 -1
  495. package/dist/dev/define/video/minimal-skin.js.map +1 -1
  496. package/dist/dev/define/video/minimal-skin.tailwind.d.ts.map +1 -1
  497. package/dist/dev/define/video/minimal-skin.tailwind.js +3 -1
  498. package/dist/dev/define/video/minimal-skin.tailwind.js.map +1 -1
  499. package/dist/dev/define/video/skin.css +120 -106
  500. package/dist/dev/define/video/skin.d.ts.map +1 -1
  501. package/dist/dev/define/video/skin.js +3 -1
  502. package/dist/dev/define/video/skin.js.map +1 -1
  503. package/dist/dev/define/video/skin.tailwind.d.ts.map +1 -1
  504. package/dist/dev/define/video/skin.tailwind.js +4 -2
  505. package/dist/dev/define/video/skin.tailwind.js.map +1 -1
  506. package/dist/dev/media/hls-background-video/media.d.ts +16 -0
  507. package/dist/dev/media/hls-background-video/media.d.ts.map +1 -1
  508. package/dist/dev/media/hls-background-video/media.js +18 -0
  509. package/dist/dev/media/hls-background-video/media.js.map +1 -1
  510. package/dist/dev/media/tiktok-video/media.d.ts.map +1 -1
  511. package/dist/dev/media/tiktok-video/media.js +10 -7
  512. package/dist/dev/media/tiktok-video/media.js.map +1 -1
  513. package/dist/dev/packages/icons/dist/element/default/icons.js +1 -1
  514. package/dist/dev/packages/icons/dist/element/default/icons.js.map +1 -1
  515. package/dist/dev/packages/icons/dist/element/minimal/icons.js +1 -1
  516. package/dist/dev/packages/icons/dist/element/minimal/icons.js.map +1 -1
  517. package/dist/dev/packages/icons/dist/html/default/airplay-exit.js +1 -1
  518. package/dist/dev/packages/icons/dist/html/default/airplay-exit.js.map +1 -1
  519. package/dist/dev/packages/icons/dist/html/minimal/airplay-exit.js +1 -1
  520. package/dist/dev/packages/icons/dist/html/minimal/airplay-exit.js.map +1 -1
  521. package/dist/dev/packages/icons/dist/render/default/index.js +1 -1
  522. package/dist/dev/packages/icons/dist/render/default/index.js.map +1 -1
  523. package/dist/dev/packages/icons/dist/render/minimal/index.js +1 -1
  524. package/dist/dev/packages/icons/dist/render/minimal/index.js.map +1 -1
  525. package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js +3 -1
  526. package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js.map +1 -1
  527. package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js +8 -1
  528. package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
  529. package/dist/dev/packages/skins/dist/default/default/tailwind/components/slider.js +13 -13
  530. package/dist/dev/packages/skins/dist/default/default/tailwind/components/slider.js.map +1 -1
  531. package/dist/dev/packages/skins/dist/default/default/tailwind/components/thumbnail.js +1 -1
  532. package/dist/dev/packages/skins/dist/default/default/tailwind/components/thumbnail.js.map +1 -1
  533. package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js +3 -3
  534. package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  535. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js +8 -1
  536. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
  537. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/slider.js +13 -12
  538. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/slider.js.map +1 -1
  539. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/thumbnail.js +1 -1
  540. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/thumbnail.js.map +1 -1
  541. package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js +7 -6
  542. package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  543. package/dist/dev/packages/skins/dist/default/shared/tailwind/icon-state.js +4 -4
  544. package/dist/dev/packages/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
  545. package/dist/dev/store/provider-mixin.d.ts.map +1 -1
  546. package/dist/dev/store/provider-mixin.js +24 -8
  547. package/dist/dev/store/provider-mixin.js.map +1 -1
  548. package/dist/dev/store/types.d.ts +2 -2
  549. package/dist/dev/store/types.d.ts.map +1 -1
  550. package/dist/dev/ui/audio-track-radio-group/audio-track-radio-group-element.js +1 -1
  551. package/dist/dev/ui/audio-track-radio-group/audio-track-radio-group-element.js.map +1 -1
  552. package/dist/dev/ui/captions-radio-group/captions-radio-group-element.js +1 -1
  553. package/dist/dev/ui/captions-radio-group/captions-radio-group-element.js.map +1 -1
  554. package/dist/dev/ui/gesture/gesture-element.d.ts +7 -7
  555. package/dist/dev/ui/gesture/gesture-element.d.ts.map +1 -1
  556. package/dist/dev/ui/gesture/gesture-element.js.map +1 -1
  557. package/dist/dev/ui/hotkey/hotkey-element.d.ts +6 -6
  558. package/dist/dev/ui/hotkey/hotkey-element.d.ts.map +1 -1
  559. package/dist/dev/ui/hotkey/hotkey-element.js.map +1 -1
  560. package/dist/dev/ui/menu/context.d.ts +8 -8
  561. package/dist/dev/ui/menu/context.d.ts.map +1 -1
  562. package/dist/dev/ui/menu/context.js.map +1 -1
  563. package/dist/dev/ui/menu/menu-element.d.ts.map +1 -1
  564. package/dist/dev/ui/menu/menu-element.js +28 -27
  565. package/dist/dev/ui/menu/menu-element.js.map +1 -1
  566. package/dist/dev/ui/menu/menu-radio-group-element.d.ts +1 -1
  567. package/dist/dev/ui/menu/menu-radio-group-element.d.ts.map +1 -1
  568. package/dist/dev/ui/menu/menu-radio-group-element.js +14 -14
  569. package/dist/dev/ui/menu/menu-radio-group-element.js.map +1 -1
  570. package/dist/dev/ui/playback-rate-button/playback-rate-button-element.d.ts.map +1 -1
  571. package/dist/dev/ui/playback-rate-button/playback-rate-button-element.js +1 -2
  572. package/dist/dev/ui/playback-rate-button/playback-rate-button-element.js.map +1 -1
  573. package/dist/dev/ui/playback-rate-radio-group/playback-rate-radio-group-element.js +1 -1
  574. package/dist/dev/ui/playback-rate-radio-group/playback-rate-radio-group-element.js.map +1 -1
  575. package/dist/dev/ui/poster/poster-element.d.ts +20 -18
  576. package/dist/dev/ui/poster/poster-element.d.ts.map +1 -1
  577. package/dist/dev/ui/poster/poster-element.js +145 -8
  578. package/dist/dev/ui/poster/poster-element.js.map +1 -1
  579. package/dist/dev/ui/quality-radio-group/quality-radio-group-element.js +1 -1
  580. package/dist/dev/ui/quality-radio-group/quality-radio-group-element.js.map +1 -1
  581. package/dist/dev/ui/slider/slider-preview-element.d.ts +2 -2
  582. package/dist/dev/ui/slider/slider-preview-element.d.ts.map +1 -1
  583. package/dist/dev/ui/slider/slider-preview-element.js.map +1 -1
  584. package/docs/README.md +1 -1
  585. package/docs/concepts/features.md +2 -2
  586. package/docs/concepts/media-sources.md +79 -1
  587. package/docs/concepts/skins.md +122 -108
  588. package/docs/how-to/build-your-own-component.md +1 -1
  589. package/docs/how-to/customize-skins.md +499 -469
  590. package/docs/how-to/migrate-from-media-chrome.md +359 -0
  591. package/docs/how-to/migrate-from-mux-player.md +535 -0
  592. package/docs/how-to/migrate-from-plyr.md +394 -0
  593. package/docs/how-to/migrate-from-video-js-8.md +594 -0
  594. package/docs/llms.txt +9 -0
  595. package/docs/reference/feature-volume.md +3 -1
  596. package/docs/reference/menu.md +3 -19
  597. package/docs/reference/mute-button.md +34 -0
  598. package/docs/reference/popover.md +2 -2
  599. package/docs/reference/poster.md +211 -21
  600. package/docs/reference/slider.md +1 -1
  601. package/docs/reference/time-slider.md +1 -1
  602. package/docs/reference/tooltip.md +6 -6
  603. package/docs/reference/volume-slider.md +2 -2
  604. package/package.json +15 -9
  605. package/cdn/adapter-Bk03SAxn.js +0 -2
  606. package/cdn/adapter-Bk03SAxn.js.map +0 -1
  607. package/cdn/adapter-XTen-YVQ.js.map +0 -1
  608. package/cdn/bn-DdelKD_n.js +0 -108
  609. package/cdn/bn-DdelKD_n.js.map +0 -1
  610. package/cdn/bn-YS8ruMcO.js +0 -2
  611. package/cdn/bn-YS8ruMcO.js.map +0 -1
  612. package/cdn/compounds-CCvdpvge.js.map +0 -1
  613. package/cdn/compounds-CJ6SbYAh.js +0 -8
  614. package/cdn/compounds-CJ6SbYAh.js.map +0 -1
  615. package/cdn/create-player-BHFyOnWi.js.map +0 -1
  616. package/cdn/create-player-CbpxjDaZ.js +0 -14
  617. package/cdn/create-player-CbpxjDaZ.js.map +0 -1
  618. package/cdn/default-BqQDVloS.js.map +0 -1
  619. package/cdn/default-CXWVp2oG.js +0 -2
  620. package/cdn/default-CXWVp2oG.js.map +0 -1
  621. package/cdn/default-Dw6cIEqT.js +0 -2
  622. package/cdn/default-Dw6cIEqT.js.map +0 -1
  623. package/cdn/default-I2LasfxC.js.map +0 -1
  624. package/cdn/error-surface-DCT1m2p1.js +0 -2
  625. package/cdn/error-surface-DCT1m2p1.js.map +0 -1
  626. package/cdn/error-surface-drmCvBVW.js.map +0 -1
  627. package/cdn/gesture-element-BNfMI8eh.js.map +0 -1
  628. package/cdn/gesture-element-CG-Sx_5t.js.map +0 -1
  629. package/cdn/hls-js-6lW7L4th.js +0 -2
  630. package/cdn/hls-js-DCQzjzB5.js +0 -2
  631. package/cdn/i18n-DfKGl5Rh.js +0 -2
  632. package/cdn/live-button-element-B_y-ZJBy.js.map +0 -1
  633. package/cdn/live-button-element-CWfkQUoy.js +0 -2
  634. package/cdn/media-5ODYtX1-.js +0 -2
  635. package/cdn/media-5ODYtX1-.js.map +0 -1
  636. package/cdn/media-BTipOcKo.js +0 -2
  637. package/cdn/media-B_gQXwri.js.map +0 -1
  638. package/cdn/media-CPWNSZFX.js +0 -41
  639. package/cdn/media-CPWNSZFX.js.map +0 -1
  640. package/cdn/media-CbWsJJhU.js +0 -2
  641. package/cdn/media-Cp3acYc8.js.map +0 -1
  642. package/cdn/media-Dq4zmIJa2.js +0 -2
  643. package/cdn/media-Dq4zmIJa2.js.map +0 -1
  644. package/cdn/media-suYcjCG22.js +0 -445
  645. package/cdn/media-suYcjCG22.js.map +0 -1
  646. package/cdn/minimal-BedCvMBG.js +0 -2
  647. package/cdn/minimal-BedCvMBG.js.map +0 -1
  648. package/cdn/minimal-BoP112ye.js +0 -2
  649. package/cdn/minimal-BoP112ye.js.map +0 -1
  650. package/cdn/minimal-DLosvq31.js.map +0 -1
  651. package/cdn/minimal-DQCLKRyR.js.map +0 -1
  652. package/cdn/minimal-ui-AFk6Ut5f.js +0 -2
  653. package/cdn/minimal-ui-BVKu9LWj.js +0 -2
  654. package/cdn/mixin-CkNZwQXF.js.map +0 -1
  655. package/cdn/mixin-DiB7dIef.js +0 -2
  656. package/cdn/player-B0ccW5-n.js +0 -2
  657. package/cdn/player-iIewo8Y9.js +0 -2
  658. package/cdn/player-srq1RGTj.js +0 -2
  659. package/cdn/poster-element-BP1Ypgbf.js.map +0 -1
  660. package/cdn/poster-element-S-rr412t.js +0 -2
  661. package/cdn/poster-element-S-rr412t.js.map +0 -1
  662. package/cdn/seek-button-element-DxLmm58Y.js +0 -2
  663. package/cdn/seek-button-element-DxLmm58Y.js.map +0 -1
  664. package/cdn/seek-button-element-TErrbilI.js.map +0 -1
  665. package/cdn/select-tracks-nRPBa1NC.js.map +0 -1
  666. package/cdn/select-tracks-xV1s28xD.js +0 -59
  667. package/cdn/select-tracks-xV1s28xD.js.map +0 -1
  668. package/cdn/text-element-Bsyglab8.js +0 -2
  669. package/cdn/time-slider-chapters-element-DPgaLdBt.js.map +0 -1
  670. package/cdn/time-slider-chapters-element-MdlcovBu.js +0 -2
  671. package/cdn/time-slider-chapters-element-MdlcovBu.js.map +0 -1
  672. package/cdn/translate-text-BPMWpzFm.js +0 -2
  673. package/cdn/translate-text-BPMWpzFm.js.map +0 -1
  674. package/cdn/translate-text-DP0CzUCC.js.map +0 -1
  675. package/cdn/ui-CecDxhTX.js +0 -2
  676. package/cdn/ui-ChWM6Xz2.js +0 -2
@@ -0,0 +1,3011 @@
1
+ import { a as isNull, l as isString, u as isUndefined } from "../predicate-faYxAB6Z.js";
2
+ import { t as deepEqual } from "../deep-equal-DOfcXiSw.js";
3
+ import { t as CustomMediaElement } from "../custom-media-element-D2JoODKd.js";
4
+ import { a as escapeHtml } from "../attributes-c6az3W3y.js";
5
+ import { i as safeDefine } from "../context-OhQY847V.js";
6
+ import { n as createTimeRange, r as createPublicPromise, t as MediaPlayedRangesMixin } from "../media-played-ranges-Yd9acuMt.js";
7
+ import { n as tryCall, t as serializeEmbedParams } from "../embed-params-W6T88S8x.js";
8
+ import { n as EMPTY_TEXT_TRACKS, r as EMPTY_TIME_RANGES } from "../constants-CsSwyIX6.js";
9
+ import { t as MediaError } from "../media-error-zO-Hg4un.js";
10
+ import { t as MediaAttachMixin } from "../media-attach-mixin-uThv5NL_.js";
11
+
12
+ //#region ../../node_modules/.pnpm/@vimeo+player@2.30.4/node_modules/@vimeo/player/dist/player.es.js
13
+ /*! @vimeo/player v2.30.4 | (c) 2026 Vimeo | MIT License | https://github.com/vimeo/player.js */
14
+ /**
15
+ * @module lib/functions
16
+ */
17
+ /**
18
+ * Check to see this is a Node environment.
19
+ * @type {boolean}
20
+ */
21
+ const isNode = typeof global !== "undefined" && {}.toString.call(global) === "[object global]";
22
+ /**
23
+ * Check to see if this is a Bun environment.
24
+ * @see https://bun.sh/guides/util/detect-bun
25
+ * @type {boolean}
26
+ */
27
+ const isBun = typeof Bun !== "undefined";
28
+ /**
29
+ * Check to see if this is a Deno environment.
30
+ * @see https://docs.deno.com/api/deno/~/Deno
31
+ * @type {boolean}
32
+ */
33
+ const isDeno = typeof Deno !== "undefined";
34
+ /**
35
+ * Check to see if this is a Cloudflare Worker environment.
36
+ * @see https://community.cloudflare.com/t/how-to-detect-the-cloudflare-worker-runtime/293715
37
+ * @type {boolean}
38
+ */
39
+ const isCloudflareWorker = typeof WebSocketPair === "function" && typeof caches?.default !== "undefined";
40
+ /**
41
+ * Check if this is a server runtime
42
+ * @type {boolean}
43
+ */
44
+ const isServerRuntime = isNode || isBun || isDeno || isCloudflareWorker;
45
+ /**
46
+ * Get the name of the method for a given getter or setter.
47
+ *
48
+ * @param {string} prop The name of the property.
49
+ * @param {string} type Either “get” or “set”.
50
+ * @return {string}
51
+ */
52
+ function getMethodName(prop, type) {
53
+ if (prop.indexOf(type.toLowerCase()) === 0) return prop;
54
+ return `${type.toLowerCase()}${prop.substr(0, 1).toUpperCase()}${prop.substr(1)}`;
55
+ }
56
+ /**
57
+ * Check to see if the object is a DOM Element.
58
+ *
59
+ * @param {*} element The object to check.
60
+ * @return {boolean}
61
+ */
62
+ function isDomElement(element) {
63
+ return Boolean(element && element.nodeType === 1 && "nodeName" in element && element.ownerDocument && element.ownerDocument.defaultView);
64
+ }
65
+ /**
66
+ * Check to see whether the value is a number.
67
+ *
68
+ * @see http://dl.dropboxusercontent.com/u/35146/js/tests/isNumber.html
69
+ * @param {*} value The value to check.
70
+ * @param {boolean} integer Check if the value is an integer.
71
+ * @return {boolean}
72
+ */
73
+ function isInteger(value) {
74
+ return !isNaN(parseFloat(value)) && isFinite(value) && Math.floor(value) == value;
75
+ }
76
+ /**
77
+ * Check to see if the URL is a Vimeo url.
78
+ *
79
+ * @param {string} url The url string.
80
+ * @return {boolean}
81
+ */
82
+ function isVimeoUrl(url) {
83
+ return /^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(url);
84
+ }
85
+ /**
86
+ * Check to see if the URL is for a Vimeo embed.
87
+ *
88
+ * @param {string} url The url string.
89
+ * @return {boolean}
90
+ */
91
+ function isVimeoEmbed(url) {
92
+ return /^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(url);
93
+ }
94
+ function getOembedDomain(url) {
95
+ const match = (url || "").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/);
96
+ const domain = (match && match[1] || "").replace("player.", "");
97
+ for (const customDomain of [
98
+ ".videoji.hk",
99
+ ".vimeo.work",
100
+ ".videoji.cn"
101
+ ]) if (domain.endsWith(customDomain)) return domain;
102
+ return "vimeo.com";
103
+ }
104
+ /**
105
+ * Get the Vimeo URL from an element.
106
+ * The element must have either a data-vimeo-id or data-vimeo-url attribute.
107
+ *
108
+ * @param {object} oEmbedParameters The oEmbed parameters.
109
+ * @return {string}
110
+ */
111
+ function getVimeoUrl() {
112
+ let oEmbedParameters = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
113
+ const id = oEmbedParameters.id;
114
+ const url = oEmbedParameters.url;
115
+ const idOrUrl = id || url;
116
+ if (!idOrUrl) throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");
117
+ if (isInteger(idOrUrl)) return `https://vimeo.com/${idOrUrl}`;
118
+ if (isVimeoUrl(idOrUrl)) return idOrUrl.replace("http:", "https:");
119
+ if (id) throw new TypeError(`“${id}” is not a valid video id.`);
120
+ throw new TypeError(`“${idOrUrl}” is not a vimeo.com url.`);
121
+ }
122
+ /**
123
+ * A utility method for attaching and detaching event handlers
124
+ *
125
+ * @param {EventTarget} target
126
+ * @param {string | string[]} eventName
127
+ * @param {function} callback
128
+ * @param {'addEventListener' | 'on'} onName
129
+ * @param {'removeEventListener' | 'off'} offName
130
+ * @return {{cancel: (function(): void)}}
131
+ */
132
+ const subscribe = function(target, eventName, callback) {
133
+ let onName = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "addEventListener";
134
+ let offName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "removeEventListener";
135
+ const eventNames = typeof eventName === "string" ? [eventName] : eventName;
136
+ eventNames.forEach((evName) => {
137
+ target[onName](evName, callback);
138
+ });
139
+ return { cancel: () => eventNames.forEach((evName) => target[offName](evName, callback)) };
140
+ };
141
+ /**
142
+ * Find the iframe element that contains a specific source window
143
+ *
144
+ * @param {Window} sourceWindow The source window to find the iframe for
145
+ * @param {Document} [doc=document] The document to search within
146
+ * @return {HTMLIFrameElement|null} The iframe element if found, otherwise null
147
+ */
148
+ function findIframeBySourceWindow(sourceWindow) {
149
+ let doc = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : document;
150
+ if (!sourceWindow || !doc || typeof doc.querySelectorAll !== "function") return null;
151
+ const iframes = doc.querySelectorAll("iframe");
152
+ for (let i = 0; i < iframes.length; i++) if (iframes[i] && iframes[i].contentWindow === sourceWindow) return iframes[i];
153
+ return null;
154
+ }
155
+ const arrayIndexOfSupport = typeof Array.prototype.indexOf !== "undefined";
156
+ const postMessageSupport = typeof window !== "undefined" && typeof window.postMessage !== "undefined";
157
+ if (!isServerRuntime && (!arrayIndexOfSupport || !postMessageSupport)) throw new Error("Sorry, the Vimeo Player API is not available in this browser.");
158
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
159
+ function createCommonjsModule(fn, module) {
160
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
161
+ }
162
+ /*!
163
+ * weakmap-polyfill v2.0.4 - ECMAScript6 WeakMap polyfill
164
+ * https://github.com/polygonplanet/weakmap-polyfill
165
+ * Copyright (c) 2015-2021 polygonplanet <polygon.planet.aqua@gmail.com>
166
+ * @license MIT
167
+ */
168
+ (function(self) {
169
+ if (self.WeakMap) return;
170
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
171
+ var hasDefine = Object.defineProperty && function() {
172
+ try {
173
+ return Object.defineProperty({}, "x", { value: 1 }).x === 1;
174
+ } catch (e) {}
175
+ }();
176
+ var defineProperty = function(object, name, value) {
177
+ if (hasDefine) Object.defineProperty(object, name, {
178
+ configurable: true,
179
+ writable: true,
180
+ value
181
+ });
182
+ else object[name] = value;
183
+ };
184
+ self.WeakMap = function() {
185
+ function WeakMap() {
186
+ if (this === void 0) throw new TypeError("Constructor WeakMap requires 'new'");
187
+ defineProperty(this, "_id", genId("_WeakMap"));
188
+ if (arguments.length > 0) throw new TypeError("WeakMap iterable is not supported");
189
+ }
190
+ defineProperty(WeakMap.prototype, "delete", function(key) {
191
+ checkInstance(this, "delete");
192
+ if (!isObject(key)) return false;
193
+ var entry = key[this._id];
194
+ if (entry && entry[0] === key) {
195
+ delete key[this._id];
196
+ return true;
197
+ }
198
+ return false;
199
+ });
200
+ defineProperty(WeakMap.prototype, "get", function(key) {
201
+ checkInstance(this, "get");
202
+ if (!isObject(key)) return;
203
+ var entry = key[this._id];
204
+ if (entry && entry[0] === key) return entry[1];
205
+ });
206
+ defineProperty(WeakMap.prototype, "has", function(key) {
207
+ checkInstance(this, "has");
208
+ if (!isObject(key)) return false;
209
+ var entry = key[this._id];
210
+ if (entry && entry[0] === key) return true;
211
+ return false;
212
+ });
213
+ defineProperty(WeakMap.prototype, "set", function(key, value) {
214
+ checkInstance(this, "set");
215
+ if (!isObject(key)) throw new TypeError("Invalid value used as weak map key");
216
+ var entry = key[this._id];
217
+ if (entry && entry[0] === key) {
218
+ entry[1] = value;
219
+ return this;
220
+ }
221
+ defineProperty(key, this._id, [key, value]);
222
+ return this;
223
+ });
224
+ function checkInstance(x, methodName) {
225
+ if (!isObject(x) || !hasOwnProperty.call(x, "_id")) throw new TypeError(methodName + " method called on incompatible receiver " + typeof x);
226
+ }
227
+ function genId(prefix) {
228
+ return prefix + "_" + rand() + "." + rand();
229
+ }
230
+ function rand() {
231
+ return Math.random().toString().substring(2);
232
+ }
233
+ defineProperty(WeakMap, "_polyfill", true);
234
+ return WeakMap;
235
+ }();
236
+ function isObject(x) {
237
+ return Object(x) === x;
238
+ }
239
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof commonjsGlobal !== "undefined" ? commonjsGlobal : commonjsGlobal);
240
+ var npo_src = createCommonjsModule(function(module) {
241
+ /*! Native Promise Only
242
+ v0.8.1 (c) Kyle Simpson
243
+ MIT License: http://getify.mit-license.org
244
+ */
245
+ (function UMD(name, context, definition) {
246
+ context[name] = context[name] || definition();
247
+ if (module.exports) module.exports = context[name];
248
+ })("Promise", typeof commonjsGlobal != "undefined" ? commonjsGlobal : commonjsGlobal, function DEF() {
249
+ var builtInProp, cycle, scheduling_queue, ToString = Object.prototype.toString, timer = typeof setImmediate != "undefined" ? function timer(fn) {
250
+ return setImmediate(fn);
251
+ } : setTimeout;
252
+ try {
253
+ Object.defineProperty({}, "x", {});
254
+ builtInProp = function builtInProp(obj, name, val, config) {
255
+ return Object.defineProperty(obj, name, {
256
+ value: val,
257
+ writable: true,
258
+ configurable: config !== false
259
+ });
260
+ };
261
+ } catch (err) {
262
+ builtInProp = function builtInProp(obj, name, val) {
263
+ obj[name] = val;
264
+ return obj;
265
+ };
266
+ }
267
+ scheduling_queue = function Queue() {
268
+ var first, last, item;
269
+ function Item(fn, self) {
270
+ this.fn = fn;
271
+ this.self = self;
272
+ this.next = void 0;
273
+ }
274
+ return {
275
+ add: function add(fn, self) {
276
+ item = new Item(fn, self);
277
+ if (last) last.next = item;
278
+ else first = item;
279
+ last = item;
280
+ item = void 0;
281
+ },
282
+ drain: function drain() {
283
+ var f = first;
284
+ first = last = cycle = void 0;
285
+ while (f) {
286
+ f.fn.call(f.self);
287
+ f = f.next;
288
+ }
289
+ }
290
+ };
291
+ }();
292
+ function schedule(fn, self) {
293
+ scheduling_queue.add(fn, self);
294
+ if (!cycle) cycle = timer(scheduling_queue.drain);
295
+ }
296
+ function isThenable(o) {
297
+ var _then, o_type = typeof o;
298
+ if (o != null && (o_type == "object" || o_type == "function")) _then = o.then;
299
+ return typeof _then == "function" ? _then : false;
300
+ }
301
+ function notify() {
302
+ for (var i = 0; i < this.chain.length; i++) notifyIsolated(this, this.state === 1 ? this.chain[i].success : this.chain[i].failure, this.chain[i]);
303
+ this.chain.length = 0;
304
+ }
305
+ function notifyIsolated(self, cb, chain) {
306
+ var ret, _then;
307
+ try {
308
+ if (cb === false) chain.reject(self.msg);
309
+ else {
310
+ if (cb === true) ret = self.msg;
311
+ else ret = cb.call(void 0, self.msg);
312
+ if (ret === chain.promise) chain.reject(TypeError("Promise-chain cycle"));
313
+ else if (_then = isThenable(ret)) _then.call(ret, chain.resolve, chain.reject);
314
+ else chain.resolve(ret);
315
+ }
316
+ } catch (err) {
317
+ chain.reject(err);
318
+ }
319
+ }
320
+ function resolve(msg) {
321
+ var _then, self = this;
322
+ if (self.triggered) return;
323
+ self.triggered = true;
324
+ if (self.def) self = self.def;
325
+ try {
326
+ if (_then = isThenable(msg)) schedule(function() {
327
+ var def_wrapper = new MakeDefWrapper(self);
328
+ try {
329
+ _then.call(msg, function $resolve$() {
330
+ resolve.apply(def_wrapper, arguments);
331
+ }, function $reject$() {
332
+ reject.apply(def_wrapper, arguments);
333
+ });
334
+ } catch (err) {
335
+ reject.call(def_wrapper, err);
336
+ }
337
+ });
338
+ else {
339
+ self.msg = msg;
340
+ self.state = 1;
341
+ if (self.chain.length > 0) schedule(notify, self);
342
+ }
343
+ } catch (err) {
344
+ reject.call(new MakeDefWrapper(self), err);
345
+ }
346
+ }
347
+ function reject(msg) {
348
+ var self = this;
349
+ if (self.triggered) return;
350
+ self.triggered = true;
351
+ if (self.def) self = self.def;
352
+ self.msg = msg;
353
+ self.state = 2;
354
+ if (self.chain.length > 0) schedule(notify, self);
355
+ }
356
+ function iteratePromises(Constructor, arr, resolver, rejecter) {
357
+ for (var idx = 0; idx < arr.length; idx++) (function IIFE(idx) {
358
+ Constructor.resolve(arr[idx]).then(function $resolver$(msg) {
359
+ resolver(idx, msg);
360
+ }, rejecter);
361
+ })(idx);
362
+ }
363
+ function MakeDefWrapper(self) {
364
+ this.def = self;
365
+ this.triggered = false;
366
+ }
367
+ function MakeDef(self) {
368
+ this.promise = self;
369
+ this.state = 0;
370
+ this.triggered = false;
371
+ this.chain = [];
372
+ this.msg = void 0;
373
+ }
374
+ function Promise(executor) {
375
+ if (typeof executor != "function") throw TypeError("Not a function");
376
+ if (this.__NPO__ !== 0) throw TypeError("Not a promise");
377
+ this.__NPO__ = 1;
378
+ var def = new MakeDef(this);
379
+ this["then"] = function then(success, failure) {
380
+ var o = {
381
+ success: typeof success == "function" ? success : true,
382
+ failure: typeof failure == "function" ? failure : false
383
+ };
384
+ o.promise = new this.constructor(function extractChain(resolve, reject) {
385
+ if (typeof resolve != "function" || typeof reject != "function") throw TypeError("Not a function");
386
+ o.resolve = resolve;
387
+ o.reject = reject;
388
+ });
389
+ def.chain.push(o);
390
+ if (def.state !== 0) schedule(notify, def);
391
+ return o.promise;
392
+ };
393
+ this["catch"] = function $catch$(failure) {
394
+ return this.then(void 0, failure);
395
+ };
396
+ try {
397
+ executor.call(void 0, function publicResolve(msg) {
398
+ resolve.call(def, msg);
399
+ }, function publicReject(msg) {
400
+ reject.call(def, msg);
401
+ });
402
+ } catch (err) {
403
+ reject.call(def, err);
404
+ }
405
+ }
406
+ var PromisePrototype = builtInProp({}, "constructor", Promise, false);
407
+ Promise.prototype = PromisePrototype;
408
+ builtInProp(PromisePrototype, "__NPO__", 0, false);
409
+ builtInProp(Promise, "resolve", function Promise$resolve(msg) {
410
+ var Constructor = this;
411
+ if (msg && typeof msg == "object" && msg.__NPO__ === 1) return msg;
412
+ return new Constructor(function executor(resolve, reject) {
413
+ if (typeof resolve != "function" || typeof reject != "function") throw TypeError("Not a function");
414
+ resolve(msg);
415
+ });
416
+ });
417
+ builtInProp(Promise, "reject", function Promise$reject(msg) {
418
+ return new this(function executor(resolve, reject) {
419
+ if (typeof resolve != "function" || typeof reject != "function") throw TypeError("Not a function");
420
+ reject(msg);
421
+ });
422
+ });
423
+ builtInProp(Promise, "all", function Promise$all(arr) {
424
+ var Constructor = this;
425
+ if (ToString.call(arr) != "[object Array]") return Constructor.reject(TypeError("Not an array"));
426
+ if (arr.length === 0) return Constructor.resolve([]);
427
+ return new Constructor(function executor(resolve, reject) {
428
+ if (typeof resolve != "function" || typeof reject != "function") throw TypeError("Not a function");
429
+ var len = arr.length, msgs = Array(len), count = 0;
430
+ iteratePromises(Constructor, arr, function resolver(idx, msg) {
431
+ msgs[idx] = msg;
432
+ if (++count === len) resolve(msgs);
433
+ }, reject);
434
+ });
435
+ });
436
+ builtInProp(Promise, "race", function Promise$race(arr) {
437
+ var Constructor = this;
438
+ if (ToString.call(arr) != "[object Array]") return Constructor.reject(TypeError("Not an array"));
439
+ return new Constructor(function executor(resolve, reject) {
440
+ if (typeof resolve != "function" || typeof reject != "function") throw TypeError("Not a function");
441
+ iteratePromises(Constructor, arr, function resolver(idx, msg) {
442
+ resolve(msg);
443
+ }, reject);
444
+ });
445
+ });
446
+ return Promise;
447
+ });
448
+ });
449
+ /**
450
+ * @module lib/callbacks
451
+ */
452
+ const callbackMap = /* @__PURE__ */ new WeakMap();
453
+ /**
454
+ * Store a callback for a method or event for a player.
455
+ *
456
+ * @param {Player} player The player object.
457
+ * @param {string} name The method or event name.
458
+ * @param {(function(this:Player, *): void|{resolve: function, reject: function})} callback
459
+ * The callback to call or an object with resolve and reject functions for a promise.
460
+ * @return {void}
461
+ */
462
+ function storeCallback(player, name, callback) {
463
+ const playerCallbacks = callbackMap.get(player.element) || {};
464
+ if (!(name in playerCallbacks)) playerCallbacks[name] = [];
465
+ playerCallbacks[name].push(callback);
466
+ callbackMap.set(player.element, playerCallbacks);
467
+ }
468
+ /**
469
+ * Get the callbacks for a player and event or method.
470
+ *
471
+ * @param {Player} player The player object.
472
+ * @param {string} name The method or event name
473
+ * @return {function[]}
474
+ */
475
+ function getCallbacks(player, name) {
476
+ return (callbackMap.get(player.element) || {})[name] || [];
477
+ }
478
+ /**
479
+ * Remove a stored callback for a method or event for a player.
480
+ *
481
+ * @param {Player} player The player object.
482
+ * @param {string} name The method or event name
483
+ * @param {function} [callback] The specific callback to remove.
484
+ * @return {boolean} Was this the last callback?
485
+ */
486
+ function removeCallback(player, name, callback) {
487
+ const playerCallbacks = callbackMap.get(player.element) || {};
488
+ if (!playerCallbacks[name]) return true;
489
+ if (!callback) {
490
+ playerCallbacks[name] = [];
491
+ callbackMap.set(player.element, playerCallbacks);
492
+ return true;
493
+ }
494
+ const index = playerCallbacks[name].indexOf(callback);
495
+ if (index !== -1) playerCallbacks[name].splice(index, 1);
496
+ callbackMap.set(player.element, playerCallbacks);
497
+ return playerCallbacks[name] && playerCallbacks[name].length === 0;
498
+ }
499
+ /**
500
+ * Return the first stored callback for a player and event or method.
501
+ *
502
+ * @param {Player} player The player object.
503
+ * @param {string} name The method or event name.
504
+ * @return {function} The callback, or false if there were none
505
+ */
506
+ function shiftCallbacks(player, name) {
507
+ const playerCallbacks = getCallbacks(player, name);
508
+ if (playerCallbacks.length < 1) return false;
509
+ const callback = playerCallbacks.shift();
510
+ removeCallback(player, name, callback);
511
+ return callback;
512
+ }
513
+ /**
514
+ * Move callbacks associated with an element to another element.
515
+ *
516
+ * @param {HTMLElement} oldElement The old element.
517
+ * @param {HTMLElement} newElement The new element.
518
+ * @return {void}
519
+ */
520
+ function swapCallbacks(oldElement, newElement) {
521
+ const playerCallbacks = callbackMap.get(oldElement);
522
+ callbackMap.set(newElement, playerCallbacks);
523
+ callbackMap.delete(oldElement);
524
+ }
525
+ /**
526
+ * @module lib/postmessage
527
+ */
528
+ /**
529
+ * Parse a message received from postMessage.
530
+ *
531
+ * @param {*} data The data received from postMessage.
532
+ * @return {object}
533
+ */
534
+ function parseMessageData(data) {
535
+ if (typeof data === "string") try {
536
+ data = JSON.parse(data);
537
+ } catch (error) {
538
+ console.warn(error);
539
+ return {};
540
+ }
541
+ return data;
542
+ }
543
+ /**
544
+ * Post a message to the specified target.
545
+ *
546
+ * @param {Player} player The player object to use.
547
+ * @param {string} method The API method to call.
548
+ * @param {string|number|object|Array|undefined} params The parameters to send to the player.
549
+ * @return {void}
550
+ */
551
+ function postMessage(player, method, params) {
552
+ if (!player.element.contentWindow || !player.element.contentWindow.postMessage) return;
553
+ let message = { method };
554
+ if (params !== void 0) message.value = params;
555
+ const ieVersion = parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/, "$1"));
556
+ if (ieVersion >= 8 && ieVersion < 10) message = JSON.stringify(message);
557
+ player.element.contentWindow.postMessage(message, player.origin);
558
+ }
559
+ /**
560
+ * Parse the data received from a message event.
561
+ *
562
+ * @param {Player} player The player that received the message.
563
+ * @param {(Object|string)} data The message data. Strings will be parsed into JSON.
564
+ * @return {void}
565
+ */
566
+ function processData(player, data) {
567
+ data = parseMessageData(data);
568
+ let callbacks = [];
569
+ let param;
570
+ if (data.event) {
571
+ if (data.event === "error") getCallbacks(player, data.data.method).forEach((promise) => {
572
+ const error = new Error(data.data.message);
573
+ error.name = data.data.name;
574
+ promise.reject(error);
575
+ removeCallback(player, data.data.method, promise);
576
+ });
577
+ callbacks = getCallbacks(player, `event:${data.event}`);
578
+ param = data.data;
579
+ } else if (data.method) {
580
+ const callback = shiftCallbacks(player, data.method);
581
+ if (callback) {
582
+ callbacks.push(callback);
583
+ param = data.value;
584
+ }
585
+ }
586
+ callbacks.forEach((callback) => {
587
+ try {
588
+ if (typeof callback === "function") {
589
+ callback.call(player, param);
590
+ return;
591
+ }
592
+ callback.resolve(param);
593
+ } catch (e) {}
594
+ });
595
+ }
596
+ /**
597
+ * @module lib/embed
598
+ */
599
+ const oEmbedParameters = [
600
+ "airplay",
601
+ "audio_tracks",
602
+ "audiotrack",
603
+ "autopause",
604
+ "autoplay",
605
+ "background",
606
+ "byline",
607
+ "cc",
608
+ "chapter_id",
609
+ "chapters",
610
+ "chromecast",
611
+ "color",
612
+ "colors",
613
+ "controls",
614
+ "disable_context_menu",
615
+ "dnt",
616
+ "end_time",
617
+ "fullscreen",
618
+ "height",
619
+ "id",
620
+ "initial_quality",
621
+ "interactive_params",
622
+ "keyboard",
623
+ "loop",
624
+ "maxheight",
625
+ "max_quality",
626
+ "maxwidth",
627
+ "min_quality",
628
+ "muted",
629
+ "play_button_position",
630
+ "playsinline",
631
+ "portrait",
632
+ "preload",
633
+ "progress_bar",
634
+ "quality",
635
+ "quality_selector",
636
+ "responsive",
637
+ "skipping_forward",
638
+ "speed",
639
+ "start_time",
640
+ "texttrack",
641
+ "thumbnail_id",
642
+ "title",
643
+ "transcript",
644
+ "transparent",
645
+ "unmute_button",
646
+ "url",
647
+ "vimeo_logo",
648
+ "volume",
649
+ "watch_full_video",
650
+ "width"
651
+ ];
652
+ /**
653
+ * Get the 'data-vimeo'-prefixed attributes from an element as an object.
654
+ *
655
+ * @param {HTMLElement} element The element.
656
+ * @param {Object} [defaults={}] The default values to use.
657
+ * @return {Object<string, string>}
658
+ */
659
+ function getOEmbedParameters(element) {
660
+ let defaults = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
661
+ return oEmbedParameters.reduce((params, param) => {
662
+ const value = element.getAttribute(`data-vimeo-${param}`);
663
+ if (value || value === "") params[param] = value === "" ? 1 : value;
664
+ return params;
665
+ }, defaults);
666
+ }
667
+ /**
668
+ * Create an embed from oEmbed data inside an element.
669
+ *
670
+ * @param {object} data The oEmbed data.
671
+ * @param {HTMLElement} element The element to put the iframe in.
672
+ * @return {HTMLIFrameElement} The iframe embed.
673
+ */
674
+ function createEmbed(_ref, element) {
675
+ let { html } = _ref;
676
+ if (!element) throw new TypeError("An element must be provided");
677
+ if (element.getAttribute("data-vimeo-initialized") !== null) return element.querySelector("iframe");
678
+ const div = document.createElement("div");
679
+ div.innerHTML = html;
680
+ element.appendChild(div.firstChild);
681
+ element.setAttribute("data-vimeo-initialized", "true");
682
+ return element.querySelector("iframe");
683
+ }
684
+ /**
685
+ * Make an oEmbed call for the specified URL.
686
+ *
687
+ * @param {string} videoUrl The vimeo.com url for the video.
688
+ * @param {Object} [params] Parameters to pass to oEmbed.
689
+ * @param {HTMLElement} element The element.
690
+ * @return {Promise}
691
+ */
692
+ function getOEmbedData(videoUrl) {
693
+ let params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
694
+ let element = arguments.length > 2 ? arguments[2] : void 0;
695
+ return new Promise((resolve, reject) => {
696
+ if (!isVimeoUrl(videoUrl)) throw new TypeError(`“${videoUrl}” is not a vimeo.com url.`);
697
+ let url = `https://${getOembedDomain(videoUrl)}/api/oembed.json?url=${encodeURIComponent(videoUrl)}`;
698
+ for (const param in params) if (params.hasOwnProperty(param)) url += `&${param}=${encodeURIComponent(params[param])}`;
699
+ const xhr = "XDomainRequest" in window ? new XDomainRequest() : new XMLHttpRequest();
700
+ xhr.open("GET", url, true);
701
+ xhr.onload = function() {
702
+ if (xhr.status === 404) {
703
+ reject(/* @__PURE__ */ new Error(`“${videoUrl}” was not found.`));
704
+ return;
705
+ }
706
+ if (xhr.status === 403) {
707
+ reject(/* @__PURE__ */ new Error(`“${videoUrl}” is not embeddable.`));
708
+ return;
709
+ }
710
+ try {
711
+ const json = JSON.parse(xhr.responseText);
712
+ if (json.domain_status_code === 403) {
713
+ createEmbed(json, element);
714
+ reject(/* @__PURE__ */ new Error(`“${videoUrl}” is not embeddable.`));
715
+ return;
716
+ }
717
+ resolve(json);
718
+ } catch (error) {
719
+ reject(error);
720
+ }
721
+ };
722
+ xhr.onerror = function() {
723
+ const status = xhr.status ? ` (${xhr.status})` : "";
724
+ reject(/* @__PURE__ */ new Error(`There was an error fetching the embed code from Vimeo${status}.`));
725
+ };
726
+ xhr.send();
727
+ });
728
+ }
729
+ /**
730
+ * Initialize all embeds within a specific element
731
+ *
732
+ * @param {HTMLElement} [parent=document] The parent element.
733
+ * @return {void}
734
+ */
735
+ function initializeEmbeds() {
736
+ let parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
737
+ const elements = [].slice.call(parent.querySelectorAll("[data-vimeo-id], [data-vimeo-url]"));
738
+ const handleError = (error) => {
739
+ if ("console" in window && console.error) console.error(`There was an error creating an embed: ${error}`);
740
+ };
741
+ elements.forEach((element) => {
742
+ try {
743
+ if (element.getAttribute("data-vimeo-defer") !== null) return;
744
+ const params = getOEmbedParameters(element);
745
+ getOEmbedData(getVimeoUrl(params), params, element).then((data) => {
746
+ return createEmbed(data, element);
747
+ }).catch(handleError);
748
+ } catch (error) {
749
+ handleError(error);
750
+ }
751
+ });
752
+ }
753
+ /**
754
+ * Resize embeds when messaged by the player.
755
+ *
756
+ * @param {HTMLElement} [parent=document] The parent element.
757
+ * @return {void}
758
+ */
759
+ function resizeEmbeds() {
760
+ let parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
761
+ if (window.VimeoPlayerResizeEmbeds_) return;
762
+ window.VimeoPlayerResizeEmbeds_ = true;
763
+ const onMessage = (event) => {
764
+ if (!isVimeoUrl(event.origin)) return;
765
+ if (!event.data || event.data.event !== "spacechange") return;
766
+ const senderIFrame = event.source ? findIframeBySourceWindow(event.source, parent) : null;
767
+ if (senderIFrame) {
768
+ const space = senderIFrame.parentElement;
769
+ space.style.paddingBottom = `${event.data.data[0].bottom}px`;
770
+ }
771
+ };
772
+ window.addEventListener("message", onMessage);
773
+ }
774
+ /**
775
+ * Add chapters to existing metadata for Google SEO
776
+ *
777
+ * @param {HTMLElement} [parent=document] The parent element.
778
+ * @return {void}
779
+ */
780
+ function initAppendVideoMetadata() {
781
+ let parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
782
+ if (window.VimeoSeoMetadataAppended) return;
783
+ window.VimeoSeoMetadataAppended = true;
784
+ const onMessage = (event) => {
785
+ if (!isVimeoUrl(event.origin)) return;
786
+ const data = parseMessageData(event.data);
787
+ if (!data || data.event !== "ready") return;
788
+ const senderIFrame = event.source ? findIframeBySourceWindow(event.source, parent) : null;
789
+ if (senderIFrame && isVimeoEmbed(senderIFrame.src)) new Player(senderIFrame).callMethod("appendVideoMetadata", window.location.href);
790
+ };
791
+ window.addEventListener("message", onMessage);
792
+ }
793
+ /**
794
+ * Seek to time indicated by vimeo_t query parameter if present in URL
795
+ *
796
+ * @param {HTMLElement} [parent=document] The parent element.
797
+ * @return {void}
798
+ */
799
+ function checkUrlTimeParam() {
800
+ let parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : document;
801
+ if (window.VimeoCheckedUrlTimeParam) return;
802
+ window.VimeoCheckedUrlTimeParam = true;
803
+ const handleError = (error) => {
804
+ if ("console" in window && console.error) console.error(`There was an error getting video Id: ${error}`);
805
+ };
806
+ const onMessage = (event) => {
807
+ if (!isVimeoUrl(event.origin)) return;
808
+ const data = parseMessageData(event.data);
809
+ if (!data || data.event !== "ready") return;
810
+ const senderIFrame = event.source ? findIframeBySourceWindow(event.source, parent) : null;
811
+ if (senderIFrame && isVimeoEmbed(senderIFrame.src)) {
812
+ const player = new Player(senderIFrame);
813
+ player.getVideoId().then((videoId) => {
814
+ const matches = new RegExp(`[?&]vimeo_t_${videoId}=([^&#]*)`).exec(window.location.href);
815
+ if (matches && matches[1]) {
816
+ const sec = decodeURI(matches[1]);
817
+ player.setCurrentTime(sec);
818
+ }
819
+ }).catch(handleError);
820
+ }
821
+ };
822
+ window.addEventListener("message", onMessage);
823
+ }
824
+ /**
825
+ * Updates iframe embeds to support DRM content playback by adding the 'encrypted-media' permission
826
+ * to the iframe's allow attribute when DRM initialization fails. This function acts as a fallback
827
+ * mechanism to enable playback of DRM-protected content in embeds that weren't properly configured.
828
+ *
829
+ * @return {void}
830
+ */
831
+ function updateDRMEmbeds() {
832
+ if (window.VimeoDRMEmbedsUpdated) return;
833
+ window.VimeoDRMEmbedsUpdated = true;
834
+ /**
835
+ * Handle message events for DRM initialization failures
836
+ * @param {MessageEvent} event - The message event from the iframe
837
+ */
838
+ const onMessage = (event) => {
839
+ if (!isVimeoUrl(event.origin)) return;
840
+ const data = parseMessageData(event.data);
841
+ if (!data || data.event !== "drminitfailed") return;
842
+ const senderIFrame = event.source ? findIframeBySourceWindow(event.source) : null;
843
+ if (!senderIFrame) return;
844
+ const currentAllow = senderIFrame.getAttribute("allow") || "";
845
+ if (!currentAllow.includes("encrypted-media")) {
846
+ senderIFrame.setAttribute("allow", `${currentAllow}; encrypted-media`);
847
+ const currentUrl = new URL(senderIFrame.getAttribute("src"));
848
+ currentUrl.searchParams.set("forcereload", "drm");
849
+ senderIFrame.setAttribute("src", currentUrl.toString());
850
+ return;
851
+ }
852
+ };
853
+ window.addEventListener("message", onMessage);
854
+ }
855
+ function initializeScreenfull() {
856
+ const fn = function() {
857
+ let val;
858
+ const fnMap = [
859
+ [
860
+ "requestFullscreen",
861
+ "exitFullscreen",
862
+ "fullscreenElement",
863
+ "fullscreenEnabled",
864
+ "fullscreenchange",
865
+ "fullscreenerror"
866
+ ],
867
+ [
868
+ "webkitRequestFullscreen",
869
+ "webkitExitFullscreen",
870
+ "webkitFullscreenElement",
871
+ "webkitFullscreenEnabled",
872
+ "webkitfullscreenchange",
873
+ "webkitfullscreenerror"
874
+ ],
875
+ [
876
+ "webkitRequestFullScreen",
877
+ "webkitCancelFullScreen",
878
+ "webkitCurrentFullScreenElement",
879
+ "webkitCancelFullScreen",
880
+ "webkitfullscreenchange",
881
+ "webkitfullscreenerror"
882
+ ],
883
+ [
884
+ "mozRequestFullScreen",
885
+ "mozCancelFullScreen",
886
+ "mozFullScreenElement",
887
+ "mozFullScreenEnabled",
888
+ "mozfullscreenchange",
889
+ "mozfullscreenerror"
890
+ ],
891
+ [
892
+ "msRequestFullscreen",
893
+ "msExitFullscreen",
894
+ "msFullscreenElement",
895
+ "msFullscreenEnabled",
896
+ "MSFullscreenChange",
897
+ "MSFullscreenError"
898
+ ]
899
+ ];
900
+ let i = 0;
901
+ const l = fnMap.length;
902
+ const ret = {};
903
+ for (; i < l; i++) {
904
+ val = fnMap[i];
905
+ if (val && val[1] in document) {
906
+ for (i = 0; i < val.length; i++) ret[fnMap[0][i]] = val[i];
907
+ return ret;
908
+ }
909
+ }
910
+ return false;
911
+ }();
912
+ const eventNameMap = {
913
+ fullscreenchange: fn.fullscreenchange,
914
+ fullscreenerror: fn.fullscreenerror
915
+ };
916
+ const screenfull = {
917
+ request(element) {
918
+ return new Promise((resolve, reject) => {
919
+ const onFullScreenEntered = function() {
920
+ screenfull.off("fullscreenchange", onFullScreenEntered);
921
+ resolve();
922
+ };
923
+ screenfull.on("fullscreenchange", onFullScreenEntered);
924
+ element = element || document.documentElement;
925
+ const returnPromise = element[fn.requestFullscreen]();
926
+ if (returnPromise instanceof Promise) returnPromise.then(onFullScreenEntered).catch(reject);
927
+ });
928
+ },
929
+ exit() {
930
+ return new Promise((resolve, reject) => {
931
+ if (!screenfull.isFullscreen) {
932
+ resolve();
933
+ return;
934
+ }
935
+ const onFullScreenExit = function() {
936
+ screenfull.off("fullscreenchange", onFullScreenExit);
937
+ resolve();
938
+ };
939
+ screenfull.on("fullscreenchange", onFullScreenExit);
940
+ const returnPromise = document[fn.exitFullscreen]();
941
+ if (returnPromise instanceof Promise) returnPromise.then(onFullScreenExit).catch(reject);
942
+ });
943
+ },
944
+ on(event, callback) {
945
+ const eventName = eventNameMap[event];
946
+ if (eventName) document.addEventListener(eventName, callback);
947
+ },
948
+ off(event, callback) {
949
+ const eventName = eventNameMap[event];
950
+ if (eventName) document.removeEventListener(eventName, callback);
951
+ }
952
+ };
953
+ Object.defineProperties(screenfull, {
954
+ isFullscreen: { get() {
955
+ return Boolean(document[fn.fullscreenElement]);
956
+ } },
957
+ element: {
958
+ enumerable: true,
959
+ get() {
960
+ return document[fn.fullscreenElement];
961
+ }
962
+ },
963
+ isEnabled: {
964
+ enumerable: true,
965
+ get() {
966
+ return Boolean(document[fn.fullscreenEnabled]);
967
+ }
968
+ }
969
+ });
970
+ return screenfull;
971
+ }
972
+ /** @typedef {import('./timing-src-connector.types').PlayerControls} PlayerControls */
973
+ /** @typedef {import('timing-object').ITimingObject} TimingObject */
974
+ /** @typedef {import('./timing-src-connector.types').TimingSrcConnectorOptions} TimingSrcConnectorOptions */
975
+ /** @typedef {(msg: string) => any} Logger */
976
+ /** @typedef {import('timing-object').TConnectionState} TConnectionState */
977
+ /**
978
+ * @type {TimingSrcConnectorOptions}
979
+ *
980
+ * For details on these properties and their effects, see the typescript definition referenced above.
981
+ */
982
+ const defaultOptions = {
983
+ role: "viewer",
984
+ autoPlayMuted: true,
985
+ allowedDrift: .3,
986
+ maxAllowedDrift: 1,
987
+ minCheckInterval: .1,
988
+ maxRateAdjustment: .2,
989
+ maxTimeToCatchUp: 1
990
+ };
991
+ /**
992
+ * There's a proposed W3C spec for the Timing Object which would introduce a new set of APIs that would simplify time-synchronization tasks for browser applications.
993
+ *
994
+ * Proposed spec: https://webtiming.github.io/timingobject/
995
+ * V3 Spec: https://timingsrc.readthedocs.io/en/latest/
996
+ * Demuxed talk: https://www.youtube.com/watch?v=cZSjDaGDmX8
997
+ *
998
+ * This class makes it easy to connect Vimeo.Player to a provided TimingObject via Vimeo.Player.setTimingSrc(myTimingObject, options) and the synchronization will be handled automatically.
999
+ *
1000
+ * There are 5 general responsibilities in TimingSrcConnector:
1001
+ *
1002
+ * 1. `updatePlayer()` which sets the player's currentTime, playbackRate and pause/play state based on current state of the TimingObject.
1003
+ * 2. `updateTimingObject()` which sets the TimingObject's position and velocity from the player's state.
1004
+ * 3. `playerUpdater` which listens for change events on the TimingObject and will respond by calling updatePlayer.
1005
+ * 4. `timingObjectUpdater` which listens to the player events of seeked, play and pause and will respond by calling `updateTimingObject()`.
1006
+ * 5. `maintainPlaybackPosition` this is code that constantly monitors the player to make sure it's always in sync with the TimingObject. This is needed because videos will generally not play with precise time accuracy and there will be some drift which becomes more noticeable over longer periods (as noted in the timing-object spec). More details on this method below.
1007
+ */
1008
+ var TimingSrcConnector = class extends EventTarget {
1009
+ logger;
1010
+ /**
1011
+ * @param {PlayerControls} player
1012
+ * @param {TimingObject} timingObject
1013
+ * @param {TimingSrcConnectorOptions} options
1014
+ * @param {Logger} logger
1015
+ */
1016
+ constructor(player, timingObject) {
1017
+ let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1018
+ let logger = arguments.length > 3 ? arguments[3] : void 0;
1019
+ super();
1020
+ this.logger = logger;
1021
+ this.init(timingObject, player, {
1022
+ ...defaultOptions,
1023
+ ...options
1024
+ });
1025
+ }
1026
+ disconnect() {
1027
+ this.dispatchEvent(new Event("disconnect"));
1028
+ }
1029
+ /**
1030
+ * @param {TimingObject} timingObject
1031
+ * @param {PlayerControls} player
1032
+ * @param {TimingSrcConnectorOptions} options
1033
+ * @return {Promise<void>}
1034
+ */
1035
+ async init(timingObject, player, options) {
1036
+ await this.waitForTOReadyState(timingObject, "open");
1037
+ if (options.role === "viewer") {
1038
+ await this.updatePlayer(timingObject, player, options);
1039
+ const playerUpdater = subscribe(timingObject, "change", () => this.updatePlayer(timingObject, player, options));
1040
+ const positionSync = this.maintainPlaybackPosition(timingObject, player, options);
1041
+ this.addEventListener("disconnect", () => {
1042
+ positionSync.cancel();
1043
+ playerUpdater.cancel();
1044
+ });
1045
+ } else {
1046
+ await this.updateTimingObject(timingObject, player);
1047
+ const timingObjectUpdater = subscribe(player, [
1048
+ "seeked",
1049
+ "play",
1050
+ "pause",
1051
+ "ratechange"
1052
+ ], () => this.updateTimingObject(timingObject, player), "on", "off");
1053
+ this.addEventListener("disconnect", () => timingObjectUpdater.cancel());
1054
+ }
1055
+ }
1056
+ /**
1057
+ * Sets the TimingObject's state to reflect that of the player
1058
+ *
1059
+ * @param {TimingObject} timingObject
1060
+ * @param {PlayerControls} player
1061
+ * @return {Promise<void>}
1062
+ */
1063
+ async updateTimingObject(timingObject, player) {
1064
+ const [position, isPaused, playbackRate] = await Promise.all([
1065
+ player.getCurrentTime(),
1066
+ player.getPaused(),
1067
+ player.getPlaybackRate()
1068
+ ]);
1069
+ timingObject.update({
1070
+ position,
1071
+ velocity: isPaused ? 0 : playbackRate
1072
+ });
1073
+ }
1074
+ /**
1075
+ * Sets the player's timing state to reflect that of the TimingObject
1076
+ *
1077
+ * @param {TimingObject} timingObject
1078
+ * @param {PlayerControls} player
1079
+ * @param {TimingSrcConnectorOptions} options
1080
+ * @return {Promise<void>}
1081
+ */
1082
+ async updatePlayer(timingObject, player, options) {
1083
+ const { position, velocity } = timingObject.query();
1084
+ if (typeof position === "number") player.setCurrentTime(position);
1085
+ if (typeof velocity === "number") {
1086
+ if (velocity === 0) {
1087
+ if (await player.getPaused() === false) player.pause();
1088
+ } else if (velocity > 0) {
1089
+ if (await player.getPaused() === true) {
1090
+ await player.play().catch(async (err) => {
1091
+ if (err.name === "NotAllowedError" && options.autoPlayMuted) {
1092
+ await player.setMuted(true);
1093
+ await player.play().catch((err2) => console.error("Couldn't play the video from TimingSrcConnector. Error:", err2));
1094
+ }
1095
+ });
1096
+ this.updatePlayer(timingObject, player, options);
1097
+ }
1098
+ if (await player.getPlaybackRate() !== velocity) player.setPlaybackRate(velocity);
1099
+ }
1100
+ }
1101
+ }
1102
+ /**
1103
+ * Since video players do not play with 100% time precision, we need to closely monitor
1104
+ * our player to be sure it remains in sync with the TimingObject.
1105
+ *
1106
+ * If out of sync, we use the current conditions and the options provided to determine
1107
+ * whether to re-sync via setting currentTime or adjusting the playbackRate
1108
+ *
1109
+ * @param {TimingObject} timingObject
1110
+ * @param {PlayerControls} player
1111
+ * @param {TimingSrcConnectorOptions} options
1112
+ * @return {{cancel: (function(): void)}}
1113
+ */
1114
+ maintainPlaybackPosition(timingObject, player, options) {
1115
+ const { allowedDrift, maxAllowedDrift, minCheckInterval, maxRateAdjustment, maxTimeToCatchUp } = options;
1116
+ const syncInterval = Math.min(maxTimeToCatchUp, Math.max(minCheckInterval, maxAllowedDrift)) * 1e3;
1117
+ const check = async () => {
1118
+ if (timingObject.query().velocity === 0 || await player.getPaused() === true) return;
1119
+ const diff = timingObject.query().position - await player.getCurrentTime();
1120
+ const diffAbs = Math.abs(diff);
1121
+ this.log(`Drift: ${diff}`);
1122
+ if (diffAbs > maxAllowedDrift) {
1123
+ await this.adjustSpeed(player, 0);
1124
+ player.setCurrentTime(timingObject.query().position);
1125
+ this.log("Resync by currentTime");
1126
+ } else if (diffAbs > allowedDrift) {
1127
+ const min = diffAbs / maxTimeToCatchUp;
1128
+ const max = maxRateAdjustment;
1129
+ const adjustment = min < max ? (max - min) / 2 : max;
1130
+ await this.adjustSpeed(player, adjustment * Math.sign(diff));
1131
+ this.log("Resync by playbackRate");
1132
+ }
1133
+ };
1134
+ const interval = setInterval(() => check(), syncInterval);
1135
+ return { cancel: () => clearInterval(interval) };
1136
+ }
1137
+ /**
1138
+ * @param {string} msg
1139
+ */
1140
+ log(msg) {
1141
+ this.logger?.(`TimingSrcConnector: ${msg}`);
1142
+ }
1143
+ speedAdjustment = 0;
1144
+ /**
1145
+ * @param {PlayerControls} player
1146
+ * @param {number} newAdjustment
1147
+ * @return {Promise<void>}
1148
+ */
1149
+ adjustSpeed = async (player, newAdjustment) => {
1150
+ if (this.speedAdjustment === newAdjustment) return;
1151
+ const newPlaybackRate = await player.getPlaybackRate() - this.speedAdjustment + newAdjustment;
1152
+ this.log(`New playbackRate: ${newPlaybackRate}`);
1153
+ await player.setPlaybackRate(newPlaybackRate);
1154
+ this.speedAdjustment = newAdjustment;
1155
+ };
1156
+ /**
1157
+ * @param {TimingObject} timingObject
1158
+ * @param {TConnectionState} state
1159
+ * @return {Promise<void>}
1160
+ */
1161
+ waitForTOReadyState(timingObject, state) {
1162
+ return new Promise((resolve) => {
1163
+ const check = () => {
1164
+ if (timingObject.readyState === state) resolve();
1165
+ else timingObject.addEventListener("readystatechange", check, { once: true });
1166
+ };
1167
+ check();
1168
+ });
1169
+ }
1170
+ };
1171
+ const playerMap = /* @__PURE__ */ new WeakMap();
1172
+ const readyMap = /* @__PURE__ */ new WeakMap();
1173
+ let screenfull = {};
1174
+ var Player = class {
1175
+ /**
1176
+ * Create a Player.
1177
+ *
1178
+ * @param {(HTMLIFrameElement|HTMLElement|string|jQuery)} element A reference to the Vimeo
1179
+ * player iframe, and id, or a jQuery object.
1180
+ * @param {object} [options] oEmbed parameters to use when creating an embed in the element.
1181
+ * @return {Player}
1182
+ */
1183
+ constructor(element) {
1184
+ let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1185
+ if (window.jQuery && element instanceof jQuery) {
1186
+ if (element.length > 1 && window.console && console.warn) console.warn("A jQuery object with multiple elements was passed, using the first element.");
1187
+ element = element[0];
1188
+ }
1189
+ if (typeof document !== "undefined" && typeof element === "string") element = document.getElementById(element);
1190
+ if (!isDomElement(element)) throw new TypeError("You must pass either a valid element or a valid id.");
1191
+ if (element.nodeName !== "IFRAME") {
1192
+ const iframe = element.querySelector("iframe");
1193
+ if (iframe) element = iframe;
1194
+ }
1195
+ if (element.nodeName === "IFRAME" && !isVimeoUrl(element.getAttribute("src") || "")) throw new Error("The player element passed isn’t a Vimeo embed.");
1196
+ if (playerMap.has(element)) return playerMap.get(element);
1197
+ this._window = element.ownerDocument.defaultView;
1198
+ this.element = element;
1199
+ this.origin = "*";
1200
+ const readyPromise = new npo_src((resolve, reject) => {
1201
+ this._onMessage = (event) => {
1202
+ if (!isVimeoUrl(event.origin) || this.element.contentWindow !== event.source) return;
1203
+ if (this.origin === "*") this.origin = event.origin;
1204
+ const data = parseMessageData(event.data);
1205
+ if (data && data.event === "error" && data.data && data.data.method === "ready") {
1206
+ const error = new Error(data.data.message);
1207
+ error.name = data.data.name;
1208
+ reject(error);
1209
+ return;
1210
+ }
1211
+ const isReadyEvent = data && data.event === "ready";
1212
+ const isPingResponse = data && data.method === "ping";
1213
+ if (isReadyEvent || isPingResponse) {
1214
+ this.element.setAttribute("data-ready", "true");
1215
+ resolve();
1216
+ return;
1217
+ }
1218
+ processData(this, data);
1219
+ };
1220
+ this._window.addEventListener("message", this._onMessage);
1221
+ if (this.element.nodeName !== "IFRAME") {
1222
+ const params = getOEmbedParameters(element, options);
1223
+ getOEmbedData(getVimeoUrl(params), params, element).then((data) => {
1224
+ const iframe = createEmbed(data, element);
1225
+ this.element = iframe;
1226
+ this._originalElement = element;
1227
+ swapCallbacks(element, iframe);
1228
+ playerMap.set(this.element, this);
1229
+ return data;
1230
+ }).catch(reject);
1231
+ }
1232
+ });
1233
+ readyMap.set(this, readyPromise);
1234
+ playerMap.set(this.element, this);
1235
+ if (this.element.nodeName === "IFRAME") postMessage(this, "ping");
1236
+ if (screenfull.isEnabled) {
1237
+ const exitFullscreen = () => screenfull.exit();
1238
+ this.fullscreenchangeHandler = () => {
1239
+ if (screenfull.isFullscreen) storeCallback(this, "event:exitFullscreen", exitFullscreen);
1240
+ else removeCallback(this, "event:exitFullscreen", exitFullscreen);
1241
+ this.ready().then(() => {
1242
+ postMessage(this, "fullscreenchange", screenfull.isFullscreen);
1243
+ });
1244
+ };
1245
+ screenfull.on("fullscreenchange", this.fullscreenchangeHandler);
1246
+ }
1247
+ return this;
1248
+ }
1249
+ /**
1250
+ * Check to see if the URL is a Vimeo URL.
1251
+ *
1252
+ * @param {string} url The URL string.
1253
+ * @return {boolean}
1254
+ */
1255
+ static isVimeoUrl(url) {
1256
+ return isVimeoUrl(url);
1257
+ }
1258
+ /**
1259
+ * Get a promise for a method.
1260
+ *
1261
+ * @param {string} name The API method to call.
1262
+ * @param {...(string|number|object|Array)} args Arguments to send via postMessage.
1263
+ * @return {Promise}
1264
+ */
1265
+ callMethod(name) {
1266
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
1267
+ if (name === void 0 || name === null) throw new TypeError("You must pass a method name.");
1268
+ return new npo_src((resolve, reject) => {
1269
+ return this.ready().then(() => {
1270
+ storeCallback(this, name, {
1271
+ resolve,
1272
+ reject
1273
+ });
1274
+ if (args.length === 0) args = {};
1275
+ else if (args.length === 1) args = args[0];
1276
+ postMessage(this, name, args);
1277
+ }).catch(reject);
1278
+ });
1279
+ }
1280
+ /**
1281
+ * Get a promise for the value of a player property.
1282
+ *
1283
+ * @param {string} name The property name
1284
+ * @return {Promise}
1285
+ */
1286
+ get(name) {
1287
+ return new npo_src((resolve, reject) => {
1288
+ name = getMethodName(name, "get");
1289
+ return this.ready().then(() => {
1290
+ storeCallback(this, name, {
1291
+ resolve,
1292
+ reject
1293
+ });
1294
+ postMessage(this, name);
1295
+ }).catch(reject);
1296
+ });
1297
+ }
1298
+ /**
1299
+ * Get a promise for setting the value of a player property.
1300
+ *
1301
+ * @param {string} name The API method to call.
1302
+ * @param {mixed} value The value to set.
1303
+ * @return {Promise}
1304
+ */
1305
+ set(name, value) {
1306
+ return new npo_src((resolve, reject) => {
1307
+ name = getMethodName(name, "set");
1308
+ if (value === void 0 || value === null) throw new TypeError("There must be a value to set.");
1309
+ return this.ready().then(() => {
1310
+ storeCallback(this, name, {
1311
+ resolve,
1312
+ reject
1313
+ });
1314
+ postMessage(this, name, value);
1315
+ }).catch(reject);
1316
+ });
1317
+ }
1318
+ /**
1319
+ * Add an event listener for the specified event. Will call the
1320
+ * callback with a single parameter, `data`, that contains the data for
1321
+ * that event.
1322
+ *
1323
+ * @param {string} eventName The name of the event.
1324
+ * @param {function(*)} callback The function to call when the event fires.
1325
+ * @return {void}
1326
+ */
1327
+ on(eventName, callback) {
1328
+ if (!eventName) throw new TypeError("You must pass an event name.");
1329
+ if (!callback) throw new TypeError("You must pass a callback function.");
1330
+ if (typeof callback !== "function") throw new TypeError("The callback must be a function.");
1331
+ if (getCallbacks(this, `event:${eventName}`).length === 0) this.callMethod("addEventListener", eventName).catch(() => {});
1332
+ storeCallback(this, `event:${eventName}`, callback);
1333
+ }
1334
+ /**
1335
+ * Remove an event listener for the specified event. Will remove all
1336
+ * listeners for that event if a `callback` isn’t passed, or only that
1337
+ * specific callback if it is passed.
1338
+ *
1339
+ * @param {string} eventName The name of the event.
1340
+ * @param {function} [callback] The specific callback to remove.
1341
+ * @return {void}
1342
+ */
1343
+ off(eventName, callback) {
1344
+ if (!eventName) throw new TypeError("You must pass an event name.");
1345
+ if (callback && typeof callback !== "function") throw new TypeError("The callback must be a function.");
1346
+ if (removeCallback(this, `event:${eventName}`, callback)) this.callMethod("removeEventListener", eventName).catch((e) => {});
1347
+ }
1348
+ /**
1349
+ * A promise to load a new video.
1350
+ *
1351
+ * @promise LoadVideoPromise
1352
+ * @fulfill {number} The video with this id or url successfully loaded.
1353
+ * @reject {TypeError} The id was not a number.
1354
+ */
1355
+ /**
1356
+ * Load a new video into this embed. The promise will be resolved if
1357
+ * the video is successfully loaded, or it will be rejected if it could
1358
+ * not be loaded.
1359
+ *
1360
+ * @param {number|string|object} options The id of the video, the url of the video, or an object with embed options.
1361
+ * @return {LoadVideoPromise}
1362
+ */
1363
+ loadVideo(options) {
1364
+ return this.callMethod("loadVideo", options);
1365
+ }
1366
+ /**
1367
+ * A promise to perform an action when the Player is ready.
1368
+ *
1369
+ * @todo document errors
1370
+ * @promise LoadVideoPromise
1371
+ * @fulfill {void}
1372
+ */
1373
+ /**
1374
+ * Trigger a function when the player iframe has initialized. You do not
1375
+ * need to wait for `ready` to trigger to begin adding event listeners
1376
+ * or calling other methods.
1377
+ *
1378
+ * @return {ReadyPromise}
1379
+ */
1380
+ ready() {
1381
+ const readyPromise = readyMap.get(this) || new npo_src((resolve, reject) => {
1382
+ reject(/* @__PURE__ */ new Error("Unknown player. Probably unloaded."));
1383
+ });
1384
+ return npo_src.resolve(readyPromise);
1385
+ }
1386
+ /**
1387
+ * A promise to add a cue point to the player.
1388
+ *
1389
+ * @promise AddCuePointPromise
1390
+ * @fulfill {string} The id of the cue point to use for removeCuePoint.
1391
+ * @reject {RangeError} the time was less than 0 or greater than the
1392
+ * video’s duration.
1393
+ * @reject {UnsupportedError} Cue points are not supported with the current
1394
+ * player or browser.
1395
+ */
1396
+ /**
1397
+ * Add a cue point to the player.
1398
+ *
1399
+ * @param {number} time The time for the cue point.
1400
+ * @param {object} [data] Arbitrary data to be returned with the cue point.
1401
+ * @return {AddCuePointPromise}
1402
+ */
1403
+ addCuePoint(time) {
1404
+ let data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1405
+ return this.callMethod("addCuePoint", {
1406
+ time,
1407
+ data
1408
+ });
1409
+ }
1410
+ /**
1411
+ * A promise to remove a cue point from the player.
1412
+ *
1413
+ * @promise AddCuePointPromise
1414
+ * @fulfill {string} The id of the cue point that was removed.
1415
+ * @reject {InvalidCuePoint} The cue point with the specified id was not
1416
+ * found.
1417
+ * @reject {UnsupportedError} Cue points are not supported with the current
1418
+ * player or browser.
1419
+ */
1420
+ /**
1421
+ * Remove a cue point from the video.
1422
+ *
1423
+ * @param {string} id The id of the cue point to remove.
1424
+ * @return {RemoveCuePointPromise}
1425
+ */
1426
+ removeCuePoint(id) {
1427
+ return this.callMethod("removeCuePoint", id);
1428
+ }
1429
+ /**
1430
+ * A representation of a text track on a video.
1431
+ *
1432
+ * @typedef {Object} VimeoTextTrack
1433
+ * @property {string} language The ISO language code.
1434
+ * @property {string} kind The kind of track it is (captions or subtitles).
1435
+ * @property {string} label The human‐readable label for the track.
1436
+ */
1437
+ /**
1438
+ * A promise to enable a text track.
1439
+ *
1440
+ * @promise EnableTextTrackPromise
1441
+ * @fulfill {VimeoTextTrack} The text track that was enabled.
1442
+ * @reject {InvalidTrackLanguageError} No track was available with the
1443
+ * specified language.
1444
+ * @reject {InvalidTrackError} No track was available with the specified
1445
+ * language and kind.
1446
+ */
1447
+ /**
1448
+ * Enable the text track with the specified language, and optionally the
1449
+ * specified kind (captions or subtitles).
1450
+ *
1451
+ * When set via the API, the track language will not change the viewer’s
1452
+ * stored preference.
1453
+ *
1454
+ * @param {string} language The two‐letter language code.
1455
+ * @param {string} [kind] The kind of track to enable (captions or subtitles).
1456
+ * @param {boolean} [showing] Whether to enable display of closed captions for enabled text track within the player.
1457
+ * @return {EnableTextTrackPromise}
1458
+ */
1459
+ enableTextTrack(language) {
1460
+ let kind = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
1461
+ let showing = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
1462
+ if (!language) throw new TypeError("You must pass a language.");
1463
+ return this.callMethod("enableTextTrack", {
1464
+ language,
1465
+ kind,
1466
+ showing
1467
+ });
1468
+ }
1469
+ /**
1470
+ * A promise to disable the active text track.
1471
+ *
1472
+ * @promise DisableTextTrackPromise
1473
+ * @fulfill {void} The track was disabled.
1474
+ */
1475
+ /**
1476
+ * Disable the currently-active text track.
1477
+ *
1478
+ * @return {DisableTextTrackPromise}
1479
+ */
1480
+ disableTextTrack() {
1481
+ return this.callMethod("disableTextTrack");
1482
+ }
1483
+ /** @typedef {import('../types/formats.js').VimeoAudioTrack} VimeoAudioTrack */
1484
+ /** @typedef {import('../types/formats.js').AudioLanguage} AudioLanguage */
1485
+ /** @typedef {import('../types/formats.js').AudioKind} AudioKind */
1486
+ /**
1487
+ * A promise to enable an audio track.
1488
+ *
1489
+ * @promise SelectAudioTrackPromise
1490
+ * @fulfill {VimeoAudioTrack} The audio track that was enabled.
1491
+ * @reject {NoAudioTracksError} No audio exists for the video.
1492
+ * @reject {NoAlternateAudioTracksError} No alternate audio tracks exist for the video.
1493
+ * @reject {NoMatchingAudioTrackError} No track was available with the specified
1494
+ * language and kind.
1495
+ */
1496
+ /**
1497
+ * Enable the audio track with the specified language, and optionally the
1498
+ * specified kind (main, translation, descriptions, or commentary).
1499
+ *
1500
+ * When set via the API, the track language will not change the viewer’s
1501
+ * stored preference.
1502
+ *
1503
+ * @param {AudioLanguage} language The two‐letter language code.
1504
+ * @param {AudioKind} [kind] The kind of track to enable (main, translation, descriptions, commentary).
1505
+ * @return {SelectAudioTrackPromise}
1506
+ */
1507
+ selectAudioTrack(language, kind) {
1508
+ if (!language) throw new TypeError("You must pass a language.");
1509
+ return this.callMethod("selectAudioTrack", {
1510
+ language,
1511
+ kind
1512
+ });
1513
+ }
1514
+ /**
1515
+ * Enable the main audio track for the video.
1516
+ *
1517
+ * @return {SelectAudioTrackPromise}
1518
+ */
1519
+ selectDefaultAudioTrack() {
1520
+ return this.callMethod("selectDefaultAudioTrack");
1521
+ }
1522
+ /**
1523
+ * A promise to pause the video.
1524
+ *
1525
+ * @promise PausePromise
1526
+ * @fulfill {void} The video was paused.
1527
+ */
1528
+ /**
1529
+ * Pause the video if it’s playing.
1530
+ *
1531
+ * @return {PausePromise}
1532
+ */
1533
+ pause() {
1534
+ return this.callMethod("pause");
1535
+ }
1536
+ /**
1537
+ * A promise to play the video.
1538
+ *
1539
+ * @promise PlayPromise
1540
+ * @fulfill {void} The video was played.
1541
+ */
1542
+ /**
1543
+ * Play the video if it’s paused. **Note:** on iOS and some other
1544
+ * mobile devices, you cannot programmatically trigger play. Once the
1545
+ * viewer has tapped on the play button in the player, however, you
1546
+ * will be able to use this function.
1547
+ *
1548
+ * @return {PlayPromise}
1549
+ */
1550
+ play() {
1551
+ return this.callMethod("play");
1552
+ }
1553
+ /**
1554
+ * Request that the player enters fullscreen.
1555
+ * @return {Promise}
1556
+ */
1557
+ requestFullscreen() {
1558
+ if (screenfull.isEnabled) return screenfull.request(this.element);
1559
+ return this.callMethod("requestFullscreen");
1560
+ }
1561
+ /**
1562
+ * Request that the player exits fullscreen.
1563
+ * @return {Promise}
1564
+ */
1565
+ exitFullscreen() {
1566
+ if (screenfull.isEnabled) return screenfull.exit();
1567
+ return this.callMethod("exitFullscreen");
1568
+ }
1569
+ /**
1570
+ * Returns true if the player is currently fullscreen.
1571
+ * @return {Promise}
1572
+ */
1573
+ getFullscreen() {
1574
+ if (screenfull.isEnabled) return npo_src.resolve(screenfull.isFullscreen);
1575
+ return this.get("fullscreen");
1576
+ }
1577
+ /**
1578
+ * Request that the player enters picture-in-picture.
1579
+ * @return {Promise}
1580
+ */
1581
+ requestPictureInPicture() {
1582
+ return this.callMethod("requestPictureInPicture");
1583
+ }
1584
+ /**
1585
+ * Request that the player exits picture-in-picture.
1586
+ * @return {Promise}
1587
+ */
1588
+ exitPictureInPicture() {
1589
+ return this.callMethod("exitPictureInPicture");
1590
+ }
1591
+ /**
1592
+ * Returns true if the player is currently picture-in-picture.
1593
+ * @return {Promise}
1594
+ */
1595
+ getPictureInPicture() {
1596
+ return this.get("pictureInPicture");
1597
+ }
1598
+ /**
1599
+ * A promise to prompt the viewer to initiate remote playback.
1600
+ *
1601
+ * @promise RemotePlaybackPromptPromise
1602
+ * @fulfill {void}
1603
+ * @reject {NotFoundError} No remote playback device is available.
1604
+ */
1605
+ /**
1606
+ * Request to prompt the user to initiate remote playback.
1607
+ *
1608
+ * @return {RemotePlaybackPromptPromise}
1609
+ */
1610
+ remotePlaybackPrompt() {
1611
+ return this.callMethod("remotePlaybackPrompt");
1612
+ }
1613
+ /**
1614
+ * A promise to unload the video.
1615
+ *
1616
+ * @promise UnloadPromise
1617
+ * @fulfill {void} The video was unloaded.
1618
+ */
1619
+ /**
1620
+ * Return the player to its initial state.
1621
+ *
1622
+ * @return {UnloadPromise}
1623
+ */
1624
+ unload() {
1625
+ return this.callMethod("unload");
1626
+ }
1627
+ /**
1628
+ * Cleanup the player and remove it from the DOM
1629
+ *
1630
+ * It won't be usable and a new one should be constructed
1631
+ * in order to do any operations.
1632
+ *
1633
+ * @return {Promise}
1634
+ */
1635
+ destroy() {
1636
+ return new npo_src((resolve) => {
1637
+ readyMap.delete(this);
1638
+ playerMap.delete(this.element);
1639
+ if (this._originalElement) {
1640
+ playerMap.delete(this._originalElement);
1641
+ this._originalElement.removeAttribute("data-vimeo-initialized");
1642
+ }
1643
+ if (this.element && this.element.nodeName === "IFRAME" && this.element.parentNode) if (this.element.parentNode.parentNode && this._originalElement && this._originalElement !== this.element.parentNode) this.element.parentNode.parentNode.removeChild(this.element.parentNode);
1644
+ else this.element.parentNode.removeChild(this.element);
1645
+ if (this.element && this.element.nodeName === "DIV" && this.element.parentNode) {
1646
+ this.element.removeAttribute("data-vimeo-initialized");
1647
+ const iframe = this.element.querySelector("iframe");
1648
+ if (iframe && iframe.parentNode) if (iframe.parentNode.parentNode && this._originalElement && this._originalElement !== iframe.parentNode) iframe.parentNode.parentNode.removeChild(iframe.parentNode);
1649
+ else iframe.parentNode.removeChild(iframe);
1650
+ }
1651
+ this._window.removeEventListener("message", this._onMessage);
1652
+ if (screenfull.isEnabled) screenfull.off("fullscreenchange", this.fullscreenchangeHandler);
1653
+ resolve();
1654
+ });
1655
+ }
1656
+ /**
1657
+ * A promise to get the autopause behavior of the video.
1658
+ *
1659
+ * @promise GetAutopausePromise
1660
+ * @fulfill {boolean} Whether autopause is turned on or off.
1661
+ * @reject {UnsupportedError} Autopause is not supported with the current
1662
+ * player or browser.
1663
+ */
1664
+ /**
1665
+ * Get the autopause behavior for this player.
1666
+ *
1667
+ * @return {GetAutopausePromise}
1668
+ */
1669
+ getAutopause() {
1670
+ return this.get("autopause");
1671
+ }
1672
+ /**
1673
+ * A promise to set the autopause behavior of the video.
1674
+ *
1675
+ * @promise SetAutopausePromise
1676
+ * @fulfill {boolean} Whether autopause is turned on or off.
1677
+ * @reject {UnsupportedError} Autopause is not supported with the current
1678
+ * player or browser.
1679
+ */
1680
+ /**
1681
+ * Enable or disable the autopause behavior of this player.
1682
+ *
1683
+ * By default, when another video is played in the same browser, this
1684
+ * player will automatically pause. Unless you have a specific reason
1685
+ * for doing so, we recommend that you leave autopause set to the
1686
+ * default (`true`).
1687
+ *
1688
+ * @param {boolean} autopause
1689
+ * @return {SetAutopausePromise}
1690
+ */
1691
+ setAutopause(autopause) {
1692
+ return this.set("autopause", autopause);
1693
+ }
1694
+ /**
1695
+ * A promise to get the buffered property of the video.
1696
+ *
1697
+ * @promise GetBufferedPromise
1698
+ * @fulfill {Array} Buffered Timeranges converted to an Array.
1699
+ */
1700
+ /**
1701
+ * Get the buffered property of the video.
1702
+ *
1703
+ * @return {GetBufferedPromise}
1704
+ */
1705
+ getBuffered() {
1706
+ return this.get("buffered");
1707
+ }
1708
+ /**
1709
+ * @typedef {Object} CameraProperties
1710
+ * @prop {number} props.yaw - Number between 0 and 360.
1711
+ * @prop {number} props.pitch - Number between -90 and 90.
1712
+ * @prop {number} props.roll - Number between -180 and 180.
1713
+ * @prop {number} props.fov - The field of view in degrees.
1714
+ */
1715
+ /**
1716
+ * A promise to get the camera properties of the player.
1717
+ *
1718
+ * @promise GetCameraPromise
1719
+ * @fulfill {CameraProperties} The camera properties.
1720
+ */
1721
+ /**
1722
+ * For 360° videos get the camera properties for this player.
1723
+ *
1724
+ * @return {GetCameraPromise}
1725
+ */
1726
+ getCameraProps() {
1727
+ return this.get("cameraProps");
1728
+ }
1729
+ /**
1730
+ * A promise to set the camera properties of the player.
1731
+ *
1732
+ * @promise SetCameraPromise
1733
+ * @fulfill {Object} The camera was successfully set.
1734
+ * @reject {RangeError} The range was out of bounds.
1735
+ */
1736
+ /**
1737
+ * For 360° videos set the camera properties for this player.
1738
+ *
1739
+ * @param {CameraProperties} camera The camera properties
1740
+ * @return {SetCameraPromise}
1741
+ */
1742
+ setCameraProps(camera) {
1743
+ return this.set("cameraProps", camera);
1744
+ }
1745
+ /**
1746
+ * A representation of a chapter.
1747
+ *
1748
+ * @typedef {Object} VimeoChapter
1749
+ * @property {number} startTime The start time of the chapter.
1750
+ * @property {object} title The title of the chapter.
1751
+ * @property {number} index The place in the order of Chapters. Starts at 1.
1752
+ */
1753
+ /**
1754
+ * A promise to get chapters for the video.
1755
+ *
1756
+ * @promise GetChaptersPromise
1757
+ * @fulfill {VimeoChapter[]} The chapters for the video.
1758
+ */
1759
+ /**
1760
+ * Get an array of all the chapters for the video.
1761
+ *
1762
+ * @return {GetChaptersPromise}
1763
+ */
1764
+ getChapters() {
1765
+ return this.get("chapters");
1766
+ }
1767
+ /**
1768
+ * A promise to get the currently active chapter.
1769
+ *
1770
+ * @promise GetCurrentChaptersPromise
1771
+ * @fulfill {VimeoChapter|undefined} The current chapter for the video.
1772
+ */
1773
+ /**
1774
+ * Get the currently active chapter for the video.
1775
+ *
1776
+ * @return {GetCurrentChaptersPromise}
1777
+ */
1778
+ getCurrentChapter() {
1779
+ return this.get("currentChapter");
1780
+ }
1781
+ /**
1782
+ * A promise to get the accent color of the player.
1783
+ *
1784
+ * @promise GetColorPromise
1785
+ * @fulfill {string} The hex color of the player.
1786
+ */
1787
+ /**
1788
+ * Get the accent color for this player. Note this is deprecated in place of `getColorTwo`.
1789
+ *
1790
+ * @return {GetColorPromise}
1791
+ */
1792
+ getColor() {
1793
+ return this.get("color");
1794
+ }
1795
+ /**
1796
+ * A promise to get all colors for the player in an array.
1797
+ *
1798
+ * @promise GetColorsPromise
1799
+ * @fulfill {string[]} The hex colors of the player.
1800
+ */
1801
+ /**
1802
+ * Get all the colors for this player in an array: [colorOne, colorTwo, colorThree, colorFour]
1803
+ *
1804
+ * @return {GetColorPromise}
1805
+ */
1806
+ getColors() {
1807
+ return npo_src.all([
1808
+ this.get("colorOne"),
1809
+ this.get("colorTwo"),
1810
+ this.get("colorThree"),
1811
+ this.get("colorFour")
1812
+ ]);
1813
+ }
1814
+ /**
1815
+ * A promise to set the accent color of the player.
1816
+ *
1817
+ * @promise SetColorPromise
1818
+ * @fulfill {string} The color was successfully set.
1819
+ * @reject {TypeError} The string was not a valid hex or rgb color.
1820
+ * @reject {ContrastError} The color was set, but the contrast is
1821
+ * outside of the acceptable range.
1822
+ * @reject {EmbedSettingsError} The owner of the player has chosen to
1823
+ * use a specific color.
1824
+ */
1825
+ /**
1826
+ * Set the accent color of this player to a hex or rgb string. Setting the
1827
+ * color may fail if the owner of the video has set their embed
1828
+ * preferences to force a specific color.
1829
+ * Note this is deprecated in place of `setColorTwo`.
1830
+ *
1831
+ * @param {string} color The hex or rgb color string to set.
1832
+ * @return {SetColorPromise}
1833
+ */
1834
+ setColor(color) {
1835
+ return this.set("color", color);
1836
+ }
1837
+ /**
1838
+ * A promise to set all colors for the player.
1839
+ *
1840
+ * @promise SetColorsPromise
1841
+ * @fulfill {string[]} The colors were successfully set.
1842
+ * @reject {TypeError} The string was not a valid hex or rgb color.
1843
+ * @reject {ContrastError} The color was set, but the contrast is
1844
+ * outside of the acceptable range.
1845
+ * @reject {EmbedSettingsError} The owner of the player has chosen to
1846
+ * use a specific color.
1847
+ */
1848
+ /**
1849
+ * Set the colors of this player to a hex or rgb string. Setting the
1850
+ * color may fail if the owner of the video has set their embed
1851
+ * preferences to force a specific color.
1852
+ * The colors should be passed in as an array: [colorOne, colorTwo, colorThree, colorFour].
1853
+ * If a color should not be set, the index in the array can be left as null.
1854
+ *
1855
+ * @param {string[]} colors Array of the hex or rgb color strings to set.
1856
+ * @return {SetColorsPromise}
1857
+ */
1858
+ setColors(colors) {
1859
+ if (!Array.isArray(colors)) return new npo_src((resolve, reject) => reject(/* @__PURE__ */ new TypeError("Argument must be an array.")));
1860
+ const nullPromise = new npo_src((resolve) => resolve(null));
1861
+ const colorPromises = [
1862
+ colors[0] ? this.set("colorOne", colors[0]) : nullPromise,
1863
+ colors[1] ? this.set("colorTwo", colors[1]) : nullPromise,
1864
+ colors[2] ? this.set("colorThree", colors[2]) : nullPromise,
1865
+ colors[3] ? this.set("colorFour", colors[3]) : nullPromise
1866
+ ];
1867
+ return npo_src.all(colorPromises);
1868
+ }
1869
+ /**
1870
+ * A representation of a cue point.
1871
+ *
1872
+ * @typedef {Object} VimeoCuePoint
1873
+ * @property {number} time The time of the cue point.
1874
+ * @property {object} data The data passed when adding the cue point.
1875
+ * @property {string} id The unique id for use with removeCuePoint.
1876
+ */
1877
+ /**
1878
+ * A promise to get the cue points of a video.
1879
+ *
1880
+ * @promise GetCuePointsPromise
1881
+ * @fulfill {VimeoCuePoint[]} The cue points added to the video.
1882
+ * @reject {UnsupportedError} Cue points are not supported with the current
1883
+ * player or browser.
1884
+ */
1885
+ /**
1886
+ * Get an array of the cue points added to the video.
1887
+ *
1888
+ * @return {GetCuePointsPromise}
1889
+ */
1890
+ getCuePoints() {
1891
+ return this.get("cuePoints");
1892
+ }
1893
+ /**
1894
+ * A promise to get the current time of the video.
1895
+ *
1896
+ * @promise GetCurrentTimePromise
1897
+ * @fulfill {number} The current time in seconds.
1898
+ */
1899
+ /**
1900
+ * Get the current playback position in seconds.
1901
+ *
1902
+ * @return {GetCurrentTimePromise}
1903
+ */
1904
+ getCurrentTime() {
1905
+ return this.get("currentTime");
1906
+ }
1907
+ /**
1908
+ * A promise to set the current time of the video.
1909
+ *
1910
+ * @promise SetCurrentTimePromise
1911
+ * @fulfill {number} The actual current time that was set.
1912
+ * @reject {RangeError} the time was less than 0 or greater than the
1913
+ * video’s duration.
1914
+ */
1915
+ /**
1916
+ * Set the current playback position in seconds. If the player was
1917
+ * paused, it will remain paused. Likewise, if the player was playing,
1918
+ * it will resume playing once the video has buffered.
1919
+ *
1920
+ * You can provide an accurate time and the player will attempt to seek
1921
+ * to as close to that time as possible. The exact time will be the
1922
+ * fulfilled value of the promise.
1923
+ *
1924
+ * @param {number} currentTime
1925
+ * @return {SetCurrentTimePromise}
1926
+ */
1927
+ setCurrentTime(currentTime) {
1928
+ return this.set("currentTime", currentTime);
1929
+ }
1930
+ /**
1931
+ * A promise to get the duration of the video.
1932
+ *
1933
+ * @promise GetDurationPromise
1934
+ * @fulfill {number} The duration in seconds.
1935
+ */
1936
+ /**
1937
+ * Get the duration of the video in seconds. It will be rounded to the
1938
+ * nearest second before playback begins, and to the nearest thousandth
1939
+ * of a second after playback begins.
1940
+ *
1941
+ * @return {GetDurationPromise}
1942
+ */
1943
+ getDuration() {
1944
+ return this.get("duration");
1945
+ }
1946
+ /**
1947
+ * A promise to get the ended state of the video.
1948
+ *
1949
+ * @promise GetEndedPromise
1950
+ * @fulfill {boolean} Whether or not the video has ended.
1951
+ */
1952
+ /**
1953
+ * Get the ended state of the video. The video has ended if
1954
+ * `currentTime === duration`.
1955
+ *
1956
+ * @return {GetEndedPromise}
1957
+ */
1958
+ getEnded() {
1959
+ return this.get("ended");
1960
+ }
1961
+ /**
1962
+ * A promise to get the loop state of the player.
1963
+ *
1964
+ * @promise GetLoopPromise
1965
+ * @fulfill {boolean} Whether or not the player is set to loop.
1966
+ */
1967
+ /**
1968
+ * Get the loop state of the player.
1969
+ *
1970
+ * @return {GetLoopPromise}
1971
+ */
1972
+ getLoop() {
1973
+ return this.get("loop");
1974
+ }
1975
+ /**
1976
+ * A promise to set the loop state of the player.
1977
+ *
1978
+ * @promise SetLoopPromise
1979
+ * @fulfill {boolean} The loop state that was set.
1980
+ */
1981
+ /**
1982
+ * Set the loop state of the player. When set to `true`, the player
1983
+ * will start over immediately once playback ends.
1984
+ *
1985
+ * @param {boolean} loop
1986
+ * @return {SetLoopPromise}
1987
+ */
1988
+ setLoop(loop) {
1989
+ return this.set("loop", loop);
1990
+ }
1991
+ /**
1992
+ * A promise to set the muted state of the player.
1993
+ *
1994
+ * @promise SetMutedPromise
1995
+ * @fulfill {boolean} The muted state that was set.
1996
+ */
1997
+ /**
1998
+ * Set the muted state of the player. When set to `true`, the player
1999
+ * volume will be muted.
2000
+ *
2001
+ * @param {boolean} muted
2002
+ * @return {SetMutedPromise}
2003
+ */
2004
+ setMuted(muted) {
2005
+ return this.set("muted", muted);
2006
+ }
2007
+ /**
2008
+ * A promise to get the muted state of the player.
2009
+ *
2010
+ * @promise GetMutedPromise
2011
+ * @fulfill {boolean} Whether or not the player is muted.
2012
+ */
2013
+ /**
2014
+ * Get the muted state of the player.
2015
+ *
2016
+ * @return {GetMutedPromise}
2017
+ */
2018
+ getMuted() {
2019
+ return this.get("muted");
2020
+ }
2021
+ /**
2022
+ * A promise to get the paused state of the player.
2023
+ *
2024
+ * @promise GetLoopPromise
2025
+ * @fulfill {boolean} Whether or not the video is paused.
2026
+ */
2027
+ /**
2028
+ * Get the paused state of the player.
2029
+ *
2030
+ * @return {GetLoopPromise}
2031
+ */
2032
+ getPaused() {
2033
+ return this.get("paused");
2034
+ }
2035
+ /**
2036
+ * A promise to get the playback rate of the player.
2037
+ *
2038
+ * @promise GetPlaybackRatePromise
2039
+ * @fulfill {number} The playback rate of the player on a scale from 0 to 2.
2040
+ */
2041
+ /**
2042
+ * Get the playback rate of the player on a scale from `0` to `2`.
2043
+ *
2044
+ * @return {GetPlaybackRatePromise}
2045
+ */
2046
+ getPlaybackRate() {
2047
+ return this.get("playbackRate");
2048
+ }
2049
+ /**
2050
+ * A promise to set the playbackrate of the player.
2051
+ *
2052
+ * @promise SetPlaybackRatePromise
2053
+ * @fulfill {number} The playback rate was set.
2054
+ * @reject {RangeError} The playback rate was less than 0 or greater than 2.
2055
+ */
2056
+ /**
2057
+ * Set the playback rate of the player on a scale from `0` to `2`. When set
2058
+ * via the API, the playback rate will not be synchronized to other
2059
+ * players or stored as the viewer's preference.
2060
+ *
2061
+ * @param {number} playbackRate
2062
+ * @return {SetPlaybackRatePromise}
2063
+ */
2064
+ setPlaybackRate(playbackRate) {
2065
+ return this.set("playbackRate", playbackRate);
2066
+ }
2067
+ /**
2068
+ * A promise to get the played property of the video.
2069
+ *
2070
+ * @promise GetPlayedPromise
2071
+ * @fulfill {Array} Played Timeranges converted to an Array.
2072
+ */
2073
+ /**
2074
+ * Get the played property of the video.
2075
+ *
2076
+ * @return {GetPlayedPromise}
2077
+ */
2078
+ getPlayed() {
2079
+ return this.get("played");
2080
+ }
2081
+ /**
2082
+ * A promise to get the qualities available of the current video.
2083
+ *
2084
+ * @promise GetQualitiesPromise
2085
+ * @fulfill {Array} The qualities of the video.
2086
+ */
2087
+ /**
2088
+ * Get the qualities of the current video.
2089
+ *
2090
+ * @return {GetQualitiesPromise}
2091
+ */
2092
+ getQualities() {
2093
+ return this.get("qualities");
2094
+ }
2095
+ /**
2096
+ * A promise to get the current set quality of the video.
2097
+ *
2098
+ * @promise GetQualityPromise
2099
+ * @fulfill {string} The current set quality.
2100
+ */
2101
+ /**
2102
+ * Get the current set quality of the video.
2103
+ *
2104
+ * @return {GetQualityPromise}
2105
+ */
2106
+ getQuality() {
2107
+ return this.get("quality");
2108
+ }
2109
+ /**
2110
+ * A promise to set the video quality.
2111
+ *
2112
+ * @promise SetQualityPromise
2113
+ * @fulfill {number} The quality was set.
2114
+ * @reject {RangeError} The quality is not available.
2115
+ */
2116
+ /**
2117
+ * Set a video quality.
2118
+ *
2119
+ * @param {string} quality
2120
+ * @return {SetQualityPromise}
2121
+ */
2122
+ setQuality(quality) {
2123
+ return this.set("quality", quality);
2124
+ }
2125
+ /**
2126
+ * A promise to get the remote playback availability.
2127
+ *
2128
+ * @promise RemotePlaybackAvailabilityPromise
2129
+ * @fulfill {boolean} Whether remote playback is available.
2130
+ */
2131
+ /**
2132
+ * Get the availability of remote playback.
2133
+ *
2134
+ * @return {RemotePlaybackAvailabilityPromise}
2135
+ */
2136
+ getRemotePlaybackAvailability() {
2137
+ return this.get("remotePlaybackAvailability");
2138
+ }
2139
+ /**
2140
+ * A promise to get the current remote playback state.
2141
+ *
2142
+ * @promise RemotePlaybackStatePromise
2143
+ * @fulfill {string} The state of the remote playback: connecting, connected, or disconnected.
2144
+ */
2145
+ /**
2146
+ * Get the current remote playback state.
2147
+ *
2148
+ * @return {RemotePlaybackStatePromise}
2149
+ */
2150
+ getRemotePlaybackState() {
2151
+ return this.get("remotePlaybackState");
2152
+ }
2153
+ /**
2154
+ * A promise to get the seekable property of the video.
2155
+ *
2156
+ * @promise GetSeekablePromise
2157
+ * @fulfill {Array} Seekable Timeranges converted to an Array.
2158
+ */
2159
+ /**
2160
+ * Get the seekable property of the video.
2161
+ *
2162
+ * @return {GetSeekablePromise}
2163
+ */
2164
+ getSeekable() {
2165
+ return this.get("seekable");
2166
+ }
2167
+ /**
2168
+ * A promise to get the seeking property of the player.
2169
+ *
2170
+ * @promise GetSeekingPromise
2171
+ * @fulfill {boolean} Whether or not the player is currently seeking.
2172
+ */
2173
+ /**
2174
+ * Get if the player is currently seeking.
2175
+ *
2176
+ * @return {GetSeekingPromise}
2177
+ */
2178
+ getSeeking() {
2179
+ return this.get("seeking");
2180
+ }
2181
+ /**
2182
+ * A promise to get the text tracks of a video.
2183
+ *
2184
+ * @promise GetTextTracksPromise
2185
+ * @fulfill {VimeoTextTrack[]} The text tracks associated with the video.
2186
+ */
2187
+ /**
2188
+ * Get an array of the text tracks that exist for the video.
2189
+ *
2190
+ * @return {GetTextTracksPromise}
2191
+ */
2192
+ getTextTracks() {
2193
+ return this.get("textTracks");
2194
+ }
2195
+ /**
2196
+ * A promise to get the audio tracks of a video.
2197
+ *
2198
+ * @promise GetAudioTracksPromise
2199
+ * @fulfill {VimeoAudioTrack[]} The audio tracks associated with the video.
2200
+ */
2201
+ /**
2202
+ * Get an array of the audio tracks that exist for the video.
2203
+ *
2204
+ * @return {GetAudioTracksPromise}
2205
+ */
2206
+ getAudioTracks() {
2207
+ return this.get("audioTracks");
2208
+ }
2209
+ /**
2210
+ * A promise to get the enabled audio track of a video.
2211
+ *
2212
+ * @promise GetAudioTrackPromise
2213
+ * @fulfill {VimeoAudioTrack} The enabled audio track.
2214
+ */
2215
+ /**
2216
+ * Get the enabled audio track for a video.
2217
+ *
2218
+ * @return {GetAudioTrackPromise}
2219
+ */
2220
+ getEnabledAudioTrack() {
2221
+ return this.get("enabledAudioTrack");
2222
+ }
2223
+ /**
2224
+ * Get the main audio track for a video.
2225
+ *
2226
+ * @return {GetAudioTrackPromise}
2227
+ */
2228
+ getDefaultAudioTrack() {
2229
+ return this.get("defaultAudioTrack");
2230
+ }
2231
+ /**
2232
+ * A promise to get the embed code for the video.
2233
+ *
2234
+ * @promise GetVideoEmbedCodePromise
2235
+ * @fulfill {string} The `<iframe>` embed code for the video.
2236
+ */
2237
+ /**
2238
+ * Get the `<iframe>` embed code for the video.
2239
+ *
2240
+ * @return {GetVideoEmbedCodePromise}
2241
+ */
2242
+ getVideoEmbedCode() {
2243
+ return this.get("videoEmbedCode");
2244
+ }
2245
+ /**
2246
+ * A promise to get the id of the video.
2247
+ *
2248
+ * @promise GetVideoIdPromise
2249
+ * @fulfill {number} The id of the video.
2250
+ */
2251
+ /**
2252
+ * Get the id of the video.
2253
+ *
2254
+ * @return {GetVideoIdPromise}
2255
+ */
2256
+ getVideoId() {
2257
+ return this.get("videoId");
2258
+ }
2259
+ /**
2260
+ * A promise to get the title of the video.
2261
+ *
2262
+ * @promise GetVideoTitlePromise
2263
+ * @fulfill {number} The title of the video.
2264
+ */
2265
+ /**
2266
+ * Get the title of the video.
2267
+ *
2268
+ * @return {GetVideoTitlePromise}
2269
+ */
2270
+ getVideoTitle() {
2271
+ return this.get("videoTitle");
2272
+ }
2273
+ /**
2274
+ * A promise to get the native width of the video.
2275
+ *
2276
+ * @promise GetVideoWidthPromise
2277
+ * @fulfill {number} The native width of the video.
2278
+ */
2279
+ /**
2280
+ * Get the native width of the currently‐playing video. The width of
2281
+ * the highest‐resolution available will be used before playback begins.
2282
+ *
2283
+ * @return {GetVideoWidthPromise}
2284
+ */
2285
+ getVideoWidth() {
2286
+ return this.get("videoWidth");
2287
+ }
2288
+ /**
2289
+ * A promise to get the native height of the video.
2290
+ *
2291
+ * @promise GetVideoHeightPromise
2292
+ * @fulfill {number} The native height of the video.
2293
+ */
2294
+ /**
2295
+ * Get the native height of the currently‐playing video. The height of
2296
+ * the highest‐resolution available will be used before playback begins.
2297
+ *
2298
+ * @return {GetVideoHeightPromise}
2299
+ */
2300
+ getVideoHeight() {
2301
+ return this.get("videoHeight");
2302
+ }
2303
+ /**
2304
+ * A promise to get the vimeo.com url for the video.
2305
+ *
2306
+ * @promise GetVideoUrlPromise
2307
+ * @fulfill {number} The vimeo.com url for the video.
2308
+ * @reject {PrivacyError} The url isn’t available because of the video’s privacy setting.
2309
+ */
2310
+ /**
2311
+ * Get the vimeo.com url for the video.
2312
+ *
2313
+ * @return {GetVideoUrlPromise}
2314
+ */
2315
+ getVideoUrl() {
2316
+ return this.get("videoUrl");
2317
+ }
2318
+ /**
2319
+ * A promise to get the volume level of the player.
2320
+ *
2321
+ * @promise GetVolumePromise
2322
+ * @fulfill {number} The volume level of the player on a scale from 0 to 1.
2323
+ */
2324
+ /**
2325
+ * Get the current volume level of the player on a scale from `0` to `1`.
2326
+ *
2327
+ * Most mobile devices do not support an independent volume from the
2328
+ * system volume. In those cases, this method will always return `1`.
2329
+ *
2330
+ * @return {GetVolumePromise}
2331
+ */
2332
+ getVolume() {
2333
+ return this.get("volume");
2334
+ }
2335
+ /**
2336
+ * A promise to set the volume level of the player.
2337
+ *
2338
+ * @promise SetVolumePromise
2339
+ * @fulfill {number} The volume was set.
2340
+ * @reject {RangeError} The volume was less than 0 or greater than 1.
2341
+ */
2342
+ /**
2343
+ * Set the volume of the player on a scale from `0` to `1`. When set
2344
+ * via the API, the volume level will not be synchronized to other
2345
+ * players or stored as the viewer’s preference.
2346
+ *
2347
+ * Most mobile devices do not support setting the volume. An error will
2348
+ * *not* be triggered in that situation.
2349
+ *
2350
+ * @param {number} volume
2351
+ * @return {SetVolumePromise}
2352
+ */
2353
+ setVolume(volume) {
2354
+ return this.set("volume", volume);
2355
+ }
2356
+ /** @typedef {import('timing-object').ITimingObject} TimingObject */
2357
+ /** @typedef {import('./lib/timing-src-connector.types').TimingSrcConnectorOptions} TimingSrcConnectorOptions */
2358
+ /** @typedef {import('./lib/timing-src-connector').TimingSrcConnector} TimingSrcConnector */
2359
+ /**
2360
+ * Connects a TimingObject to the video player (https://webtiming.github.io/timingobject/)
2361
+ *
2362
+ * @param {TimingObject} timingObject
2363
+ * @param {TimingSrcConnectorOptions} options
2364
+ *
2365
+ * @return {Promise<TimingSrcConnector>}
2366
+ */
2367
+ async setTimingSrc(timingObject, options) {
2368
+ if (!timingObject) throw new TypeError("A Timing Object must be provided.");
2369
+ await this.ready();
2370
+ const connector = new TimingSrcConnector(this, timingObject, options);
2371
+ postMessage(this, "notifyTimingObjectConnect");
2372
+ connector.addEventListener("disconnect", () => postMessage(this, "notifyTimingObjectDisconnect"));
2373
+ return connector;
2374
+ }
2375
+ };
2376
+ if (!isServerRuntime) {
2377
+ screenfull = initializeScreenfull();
2378
+ initializeEmbeds();
2379
+ resizeEmbeds();
2380
+ initAppendVideoMetadata();
2381
+ checkUrlTimeParam();
2382
+ updateDRMEmbeds();
2383
+ }
2384
+
2385
+ //#endregion
2386
+ //#region ../media/dist/dev/dom/vimeo/media.js
2387
+ const vimeoMediaDefaultProps = {
2388
+ src: "",
2389
+ autoplay: false,
2390
+ defaultMuted: false,
2391
+ muted: false,
2392
+ loop: false,
2393
+ controls: false,
2394
+ playsInline: true,
2395
+ preload: "metadata",
2396
+ poster: "",
2397
+ source: null
2398
+ };
2399
+ const VimeoMediaBase = MediaPlayedRangesMixin(EventTarget);
2400
+ /**
2401
+ * @fires sourcechange - Fired when `source` changes, either directly or by resolving a new `src`. Read `source` for the new value.
2402
+ * @fires contentdatachange - Fired when the embed reports a title and when that title is cleared. Read `contentData` for the new value.
2403
+ */
2404
+ var VimeoMedia = class extends VimeoMediaBase {
2405
+ #target = null;
2406
+ #player = null;
2407
+ #loadComplete = createPublicPromise();
2408
+ #src = vimeoMediaDefaultProps.src;
2409
+ #autoplay = vimeoMediaDefaultProps.autoplay;
2410
+ #defaultMuted = vimeoMediaDefaultProps.defaultMuted;
2411
+ #loop = vimeoMediaDefaultProps.loop;
2412
+ #controls = vimeoMediaDefaultProps.controls;
2413
+ #playsInline = vimeoMediaDefaultProps.playsInline;
2414
+ #preload = vimeoMediaDefaultProps.preload;
2415
+ #poster = vimeoMediaDefaultProps.poster;
2416
+ #source = vimeoMediaDefaultProps.source;
2417
+ #paused = true;
2418
+ #ended = false;
2419
+ #seeking = false;
2420
+ #currentTime = 0;
2421
+ #duration = NaN;
2422
+ #volume = 1;
2423
+ #muted = false;
2424
+ #playbackRate = 1;
2425
+ #progress = 0;
2426
+ #videoWidth = NaN;
2427
+ #videoHeight = NaN;
2428
+ #readyState = READY_STATE_HAVE_NOTHING;
2429
+ #title = "";
2430
+ #contentData = {};
2431
+ #error = null;
2432
+ #isFullscreen = false;
2433
+ #isPictureInPicture = false;
2434
+ #disablePictureInPicture = false;
2435
+ #textTracksHost = null;
2436
+ #textTracksDisconnect = null;
2437
+ static PLAYER_SOFTWARE_NAME = "vimeo-video";
2438
+ /** Underlying `@vimeo/player` instance. Null until an embed URL can be resolved, which may be after `attach()`. */
2439
+ get engine() {
2440
+ return this.#player;
2441
+ }
2442
+ get target() {
2443
+ return this.#target;
2444
+ }
2445
+ /** Bind the iframe hosting the embed. The player follows once an embed URL resolves, maybe not until `load()`. */
2446
+ attach(target) {
2447
+ if (!target || this.#target === target) return;
2448
+ if (this.#target) this.detach();
2449
+ this.#target = target;
2450
+ this.#beginLoad();
2451
+ this.#createPlayer();
2452
+ }
2453
+ detach() {
2454
+ if (!this.#target) return;
2455
+ this.#teardownTextTracks();
2456
+ this.#player?.destroy().catch(() => {});
2457
+ this.#player = null;
2458
+ this.#target = null;
2459
+ this.#loadComplete.resolve();
2460
+ this.#resetState();
2461
+ }
2462
+ destroy() {
2463
+ this.detach();
2464
+ super.destroy();
2465
+ }
2466
+ get src() {
2467
+ return this.#src;
2468
+ }
2469
+ /** Vimeo URL or id. Setting it re-derives `source`, carrying its embed options over. */
2470
+ set src(value) {
2471
+ const { engine } = this.#source ?? {};
2472
+ const next = {
2473
+ ...engine && { engine },
2474
+ ...value && { src: value }
2475
+ };
2476
+ this.source = Object.keys(next).length > 0 ? next : null;
2477
+ }
2478
+ get currentSrc() {
2479
+ return this.#target?.getAttribute("src") ?? "";
2480
+ }
2481
+ get readyState() {
2482
+ return this.#readyState;
2483
+ }
2484
+ /** Reload the current source via Vimeo's `loadVideo`; no-op until `attach()`. */
2485
+ async load() {
2486
+ if (!this.#player) {
2487
+ if (!this.#target) return;
2488
+ const load = this.#beginLoad();
2489
+ this.#resetState();
2490
+ await Promise.resolve();
2491
+ if (load !== this.#loadComplete) return;
2492
+ this.#createPlayer();
2493
+ return;
2494
+ }
2495
+ const load = this.#beginLoad();
2496
+ this.#resetState();
2497
+ this.dispatchEvent(new Event("emptied"));
2498
+ if (!this.#src) {
2499
+ load.resolve();
2500
+ await this.#player.unload().catch(() => {});
2501
+ return;
2502
+ }
2503
+ this.dispatchEvent(new Event("loadstart"));
2504
+ const loadOptions = toLoadVideoOptions(this.#src, this.#source?.engine?.vimeo);
2505
+ if (!loadOptions) {
2506
+ load.resolve();
2507
+ return;
2508
+ }
2509
+ await this.#player.loadVideo(loadOptions).catch(() => {});
2510
+ }
2511
+ #beginLoad() {
2512
+ this.#loadComplete.resolve();
2513
+ this.#loadComplete = createPublicPromise();
2514
+ return this.#loadComplete;
2515
+ }
2516
+ #createPlayer() {
2517
+ const target = this.#target;
2518
+ if (!target || this.#player) return false;
2519
+ if (!target.getAttribute("src")) {
2520
+ const initialSrc = buildVimeoIframeSrc(this.#src, this.#snapshotProps());
2521
+ if (!initialSrc) {
2522
+ this.#loadComplete.resolve();
2523
+ return false;
2524
+ }
2525
+ target.src = initialSrc;
2526
+ }
2527
+ try {
2528
+ this.#player = new Player(target);
2529
+ } catch {
2530
+ this.#error = new MediaError("The attached iframe is not a Vimeo embed.", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
2531
+ this.dispatchEvent(new Event("error"));
2532
+ this.#loadComplete.resolve();
2533
+ return false;
2534
+ }
2535
+ this.#bindPlayerEvents(this.#player);
2536
+ this.#setupTextTracks(this.#player);
2537
+ this.dispatchEvent(new Event("loadstart"));
2538
+ return true;
2539
+ }
2540
+ get paused() {
2541
+ return this.#paused;
2542
+ }
2543
+ get ended() {
2544
+ return this.#ended;
2545
+ }
2546
+ get seeking() {
2547
+ return this.#seeking;
2548
+ }
2549
+ async play() {
2550
+ await this.#loadComplete;
2551
+ await this.#player?.play();
2552
+ }
2553
+ pause() {
2554
+ this.#player?.pause().catch(() => {});
2555
+ }
2556
+ get currentTime() {
2557
+ return this.#currentTime;
2558
+ }
2559
+ set currentTime(value) {
2560
+ if (this.#currentTime === value) return;
2561
+ this.#currentTime = value;
2562
+ this.#afterLoad((p) => p.setCurrentTime(value));
2563
+ }
2564
+ get duration() {
2565
+ return this.#duration;
2566
+ }
2567
+ get volume() {
2568
+ return this.#volume;
2569
+ }
2570
+ set volume(value) {
2571
+ if (this.#volume === value) return;
2572
+ this.#volume = value;
2573
+ this.#afterLoad((p) => p.setVolume(value));
2574
+ }
2575
+ get muted() {
2576
+ return this.#muted;
2577
+ }
2578
+ set muted(value) {
2579
+ if (this.#muted === value) return;
2580
+ this.#muted = value;
2581
+ this.#afterLoad((p) => p.setMuted(value));
2582
+ }
2583
+ get playbackRate() {
2584
+ return this.#playbackRate;
2585
+ }
2586
+ set playbackRate(value) {
2587
+ if (this.#playbackRate === value) return;
2588
+ this.#playbackRate = value;
2589
+ this.#afterLoad((p) => p.setPlaybackRate(value));
2590
+ }
2591
+ get autoplay() {
2592
+ return this.#autoplay;
2593
+ }
2594
+ set autoplay(value) {
2595
+ this.#autoplay = value;
2596
+ }
2597
+ get defaultMuted() {
2598
+ return this.#defaultMuted;
2599
+ }
2600
+ set defaultMuted(value) {
2601
+ this.#defaultMuted = value;
2602
+ }
2603
+ get loop() {
2604
+ return this.#loop;
2605
+ }
2606
+ set loop(value) {
2607
+ this.#loop = value;
2608
+ this.#afterLoad((p) => p.setLoop(value));
2609
+ }
2610
+ get controls() {
2611
+ return this.#controls;
2612
+ }
2613
+ set controls(value) {
2614
+ this.#controls = value;
2615
+ }
2616
+ get playsInline() {
2617
+ return this.#playsInline;
2618
+ }
2619
+ set playsInline(value) {
2620
+ this.#playsInline = value;
2621
+ }
2622
+ get preload() {
2623
+ return this.#preload;
2624
+ }
2625
+ set preload(value) {
2626
+ this.#preload = value;
2627
+ }
2628
+ get poster() {
2629
+ return this.#poster;
2630
+ }
2631
+ set poster(value) {
2632
+ this.#poster = value;
2633
+ }
2634
+ /** Structured source: `src` plus embed options under `engine.vimeo`. Replacing it re-derives `src`. */
2635
+ get source() {
2636
+ return this.#source;
2637
+ }
2638
+ set source(value) {
2639
+ const source = value ?? null;
2640
+ if (source === this.#source) return;
2641
+ const src = source?.src ?? "";
2642
+ const srcChanged = this.#src !== src;
2643
+ const engineChanged = !deepEqual(this.#source?.engine?.vimeo ?? null, source?.engine?.vimeo ?? null);
2644
+ this.#source = source;
2645
+ this.#src = src;
2646
+ if (srcChanged || engineChanged) this.load();
2647
+ this.dispatchEvent(new Event("sourcechange"));
2648
+ }
2649
+ /**
2650
+ * Metadata Vimeo reports about the loaded video, keyed by what it is — `title`
2651
+ * for now. Unlike a Mux source, none of it can be derived from `src`; the embed
2652
+ * has to report it, so the key is absent until then and empties again across a
2653
+ * source change. `contentdatachange` announces both.
2654
+ */
2655
+ get contentData() {
2656
+ return this.#contentData;
2657
+ }
2658
+ /**
2659
+ * Store the title the embed reported, reporting whether the content data
2660
+ * changed. Announcing is left to the caller, which knows when the rest of what
2661
+ * it is writing is in step.
2662
+ *
2663
+ * Vimeo cannot tell "no title yet" from "the title is blank" — a failed read
2664
+ * falls back to the current value — and a blank would read as a deliberate one,
2665
+ * stopping a consumer's fallback chain. So an empty title is reported as an
2666
+ * absent key rather than an empty string.
2667
+ */
2668
+ #setTitle(value) {
2669
+ if (this.#title === value) return false;
2670
+ this.#title = value;
2671
+ this.#contentData = value ? { title: value } : {};
2672
+ return true;
2673
+ }
2674
+ get buffered() {
2675
+ return this.#progress > 0 ? createTimeRange(0, this.#progress) : EMPTY_TIME_RANGES;
2676
+ }
2677
+ get seekable() {
2678
+ return this.#duration > 0 && Number.isFinite(this.#duration) ? createTimeRange(0, this.#duration) : EMPTY_TIME_RANGES;
2679
+ }
2680
+ get error() {
2681
+ return this.#error;
2682
+ }
2683
+ get textTracks() {
2684
+ this.#textTracksHost ??= globalThis.document?.createElement("video") ?? null;
2685
+ return this.#textTracksHost?.textTracks ?? EMPTY_TEXT_TRACKS;
2686
+ }
2687
+ get videoWidth() {
2688
+ return this.#videoWidth;
2689
+ }
2690
+ get videoHeight() {
2691
+ return this.#videoHeight;
2692
+ }
2693
+ get isFullscreen() {
2694
+ return this.#isFullscreen;
2695
+ }
2696
+ async requestFullscreen() {
2697
+ await this.#loadComplete;
2698
+ await this.#player?.requestFullscreen?.();
2699
+ this.#isFullscreen = true;
2700
+ }
2701
+ async exitFullscreen() {
2702
+ await this.#loadComplete;
2703
+ await this.#player?.exitFullscreen?.();
2704
+ this.#isFullscreen = false;
2705
+ }
2706
+ get isPictureInPicture() {
2707
+ return this.#isPictureInPicture;
2708
+ }
2709
+ get disablePictureInPicture() {
2710
+ return this.#disablePictureInPicture;
2711
+ }
2712
+ set disablePictureInPicture(value) {
2713
+ this.#disablePictureInPicture = value;
2714
+ }
2715
+ async requestPictureInPicture() {
2716
+ await this.#loadComplete;
2717
+ await this.#player?.requestPictureInPicture?.().then(() => {
2718
+ this.#isPictureInPicture = true;
2719
+ }, console.error);
2720
+ }
2721
+ async exitPictureInPicture() {
2722
+ await this.#loadComplete;
2723
+ await this.#player?.exitPictureInPicture?.().then(() => {
2724
+ this.#isPictureInPicture = false;
2725
+ }, console.error);
2726
+ }
2727
+ #afterLoad(fn) {
2728
+ this.#loadComplete.then(() => this.#player && void fn(this.#player).catch(() => {}), () => {});
2729
+ }
2730
+ #snapshotProps() {
2731
+ return {
2732
+ autoplay: this.#autoplay,
2733
+ defaultMuted: this.#defaultMuted,
2734
+ loop: this.#loop,
2735
+ controls: this.#controls,
2736
+ playsInline: this.#playsInline,
2737
+ preload: this.#preload || vimeoMediaDefaultProps.preload,
2738
+ source: this.#source
2739
+ };
2740
+ }
2741
+ #resetState() {
2742
+ this.#currentTime = 0;
2743
+ this.#duration = NaN;
2744
+ this.#muted = false;
2745
+ this.#paused = !this.#autoplay;
2746
+ this.#ended = false;
2747
+ this.#playbackRate = 1;
2748
+ this.#progress = 0;
2749
+ this.#readyState = READY_STATE_HAVE_NOTHING;
2750
+ this.#seeking = false;
2751
+ this.#volume = 1;
2752
+ this.#error = null;
2753
+ this.#videoWidth = NaN;
2754
+ this.#videoHeight = NaN;
2755
+ this.#isFullscreen = false;
2756
+ this.#isPictureInPicture = false;
2757
+ if (this.#setTitle("")) this.dispatchEvent(new Event("contentdatachange"));
2758
+ }
2759
+ async #onLoaded() {
2760
+ const load = this.#loadComplete;
2761
+ this.#readyState = READY_STATE_HAVE_METADATA;
2762
+ const player = this.#player;
2763
+ let contentDataChanged = false;
2764
+ if (player) {
2765
+ const [muted, volume, duration, title] = await Promise.all([
2766
+ player.getMuted().catch(() => this.#muted),
2767
+ player.getVolume().catch(() => this.#volume),
2768
+ player.getDuration().catch(() => this.#duration),
2769
+ player.getVideoTitle().catch(() => this.#title)
2770
+ ]);
2771
+ if (load !== this.#loadComplete) return;
2772
+ this.#muted = muted;
2773
+ this.#volume = volume;
2774
+ this.#duration = duration;
2775
+ contentDataChanged = this.#setTitle(title);
2776
+ }
2777
+ if (contentDataChanged) this.dispatchEvent(new Event("contentdatachange"));
2778
+ for (const type of [
2779
+ "loadedmetadata",
2780
+ "durationchange",
2781
+ "volumechange",
2782
+ "loadcomplete"
2783
+ ]) this.dispatchEvent(new Event(type));
2784
+ load.resolve();
2785
+ }
2786
+ #bindPlayerEvents(player) {
2787
+ const emit = (type) => this.dispatchEvent(new Event(type));
2788
+ player.on("loaded", () => this.#onLoaded());
2789
+ player.on("bufferstart", () => emit("waiting"));
2790
+ player.on("play", () => {
2791
+ this.#paused = false;
2792
+ emit("play");
2793
+ });
2794
+ player.on("playing", () => {
2795
+ this.#readyState = READY_STATE_HAVE_FUTURE_DATA;
2796
+ this.#paused = false;
2797
+ emit("playing");
2798
+ });
2799
+ player.on("seeking", () => {
2800
+ this.#seeking = true;
2801
+ emit("seeking");
2802
+ });
2803
+ player.on("seeked", () => {
2804
+ this.#seeking = false;
2805
+ emit("seeked");
2806
+ });
2807
+ player.on("pause", () => {
2808
+ this.#paused = true;
2809
+ emit("pause");
2810
+ });
2811
+ player.on("ended", () => {
2812
+ this.#paused = true;
2813
+ this.#ended = true;
2814
+ emit("ended");
2815
+ });
2816
+ player.on("playbackratechange", ({ playbackRate }) => {
2817
+ this.#playbackRate = playbackRate;
2818
+ emit("ratechange");
2819
+ });
2820
+ player.on("volumechange", ({ volume }) => {
2821
+ this.#volume = volume;
2822
+ emit("volumechange");
2823
+ });
2824
+ player.on("durationchange", ({ duration }) => {
2825
+ this.#duration = duration;
2826
+ emit("durationchange");
2827
+ });
2828
+ player.on("timeupdate", ({ seconds, duration }) => {
2829
+ this.#currentTime = seconds;
2830
+ if (Number.isFinite(duration) && duration !== this.#duration) this.#duration = duration;
2831
+ emit("timeupdate");
2832
+ });
2833
+ player.on("progress", ({ seconds }) => {
2834
+ this.#progress = seconds;
2835
+ emit("progress");
2836
+ });
2837
+ player.on("resize", ({ videoWidth, videoHeight }) => {
2838
+ this.#videoWidth = videoWidth;
2839
+ this.#videoHeight = videoHeight;
2840
+ emit("resize");
2841
+ });
2842
+ player.on("fullscreenchange", ({ fullscreen }) => {
2843
+ this.#isFullscreen = fullscreen;
2844
+ emit("fullscreenchange");
2845
+ });
2846
+ player.on("enterpictureinpicture", () => {
2847
+ this.#isPictureInPicture = true;
2848
+ emit("enterpictureinpicture");
2849
+ });
2850
+ player.on("leavepictureinpicture", () => {
2851
+ this.#isPictureInPicture = false;
2852
+ emit("leavepictureinpicture");
2853
+ });
2854
+ player.on("error", () => {
2855
+ this.#error = {
2856
+ code: 1,
2857
+ message: "Vimeo playback error"
2858
+ };
2859
+ emit("error");
2860
+ this.#loadComplete.resolve();
2861
+ });
2862
+ }
2863
+ #setupTextTracks(player) {
2864
+ const doc = globalThis.document;
2865
+ if (isUndefined(doc)) return;
2866
+ this.#teardownTextTracks();
2867
+ const host = doc.createElement("video");
2868
+ this.#textTracksHost = host;
2869
+ player.getTextTracks().then((tracks) => {
2870
+ for (const track of tracks) {
2871
+ if (!isString(track.kind) || isNull(track.kind)) continue;
2872
+ tryCall(() => host.addTextTrack?.(track.kind, track.label ?? "", track.language ?? ""));
2873
+ }
2874
+ }).catch(() => {});
2875
+ this.#textTracksDisconnect = new AbortController();
2876
+ host.textTracks?.addEventListener?.("change", () => {
2877
+ const showing = Array.from(host.textTracks).find((t) => t.mode === "showing");
2878
+ if (showing) player.enableTextTrack(showing.language, showing.kind).catch(() => {});
2879
+ else player.disableTextTrack().catch(() => {});
2880
+ }, { signal: this.#textTracksDisconnect.signal });
2881
+ }
2882
+ #teardownTextTracks() {
2883
+ this.#textTracksDisconnect?.abort();
2884
+ this.#textTracksDisconnect = null;
2885
+ this.#textTracksHost = null;
2886
+ }
2887
+ };
2888
+ /**
2889
+ * Parse a Vimeo source: a numeric id, `vimeo.com/<id>`, `vimeo.com/video/<id>`, `player.vimeo.com/video/<id>`, or
2890
+ * `vimeo.com/event/<id>` (live events), plus unlisted/event hashes from `?h=` or a `/<hash>` segment.
2891
+ */
2892
+ function parseVimeoSource(src) {
2893
+ if (!src) return null;
2894
+ if (/^\d+$/.test(src)) return {
2895
+ id: Number(src),
2896
+ kind: "video",
2897
+ hash: null
2898
+ };
2899
+ const match = MATCH_SRC.exec(src);
2900
+ if (!match) return null;
2901
+ const kind = match[1] === "event/" ? "event" : "video";
2902
+ let queryHash = null;
2903
+ try {
2904
+ queryHash = new URL(src).searchParams.get("h");
2905
+ } catch {}
2906
+ return {
2907
+ id: Number(match[2]),
2908
+ kind,
2909
+ hash: queryHash ?? match[3] ?? null
2910
+ };
2911
+ }
2912
+ /** Build the iframe `src` URL for an initial Vimeo embed from the given props. */
2913
+ function buildVimeoIframeSrc(src, props = {}) {
2914
+ const parsed = parseVimeoSource(src);
2915
+ if (!parsed) return "";
2916
+ const params = {
2917
+ controls: props.controls === true ? null : 0,
2918
+ autoplay: props.autoplay,
2919
+ loop: props.loop,
2920
+ muted: props.defaultMuted,
2921
+ playsinline: props.playsInline ?? vimeoMediaDefaultProps.playsInline,
2922
+ preload: props.preload ?? vimeoMediaDefaultProps.preload,
2923
+ transparent: false,
2924
+ h: parsed.hash,
2925
+ ...props.source?.engine?.vimeo ?? void 0
2926
+ };
2927
+ if (parsed.kind === "event") {
2928
+ const hashPath = parsed.hash ? `/${parsed.hash}` : "";
2929
+ delete params.h;
2930
+ return `${EMBED_EVENT_BASE}/${parsed.id}/embed${hashPath}?${serializeEmbedParams(params)}`;
2931
+ }
2932
+ return `${EMBED_VIDEO_BASE}/${parsed.id}?${serializeEmbedParams(params)}`;
2933
+ }
2934
+ const EMBED_VIDEO_BASE = "https://player.vimeo.com/video";
2935
+ const EMBED_EVENT_BASE = "https://vimeo.com/event";
2936
+ const MATCH_SRC = /vimeo\.com\/(video\/|event\/)?(\d+)(?:\/([\w-]+))?/;
2937
+ const READY_STATE_HAVE_NOTHING = 0;
2938
+ const READY_STATE_HAVE_METADATA = 1;
2939
+ const READY_STATE_HAVE_FUTURE_DATA = 3;
2940
+ function toLoadVideoOptions(src, vimeo) {
2941
+ const parsed = parseVimeoSource(src);
2942
+ if (!parsed) return null;
2943
+ return {
2944
+ url: `${parsed.kind === "event" ? `${EMBED_EVENT_BASE}/${parsed.id}/embed` : `${EMBED_VIDEO_BASE}/${parsed.id}`}${parsed.hash ? `?h=${parsed.hash}` : ""}`,
2945
+ ...vimeo
2946
+ };
2947
+ }
2948
+
2949
+ //#endregion
2950
+ //#region src/media/vimeo-video/media.ts
2951
+ var VimeoCustomMediaElement = class extends CustomMediaElement("iframe", VimeoMedia) {
2952
+ static {
2953
+ this.getTemplateHTML = (attrs) => {
2954
+ const initialSrc = buildVimeoIframeSrc(attrs.src ?? "", templateAttrsToEmbedProps(attrs));
2955
+ return `
2956
+ <style>
2957
+ :host {
2958
+ display: inline-block;
2959
+ min-width: 300px;
2960
+ min-height: 150px;
2961
+ position: relative;
2962
+ }
2963
+ iframe {
2964
+ position: absolute;
2965
+ inset: 0;
2966
+ width: 100%;
2967
+ height: 100%;
2968
+ border: 0;
2969
+ }
2970
+ :host(:not([controls])) {
2971
+ pointer-events: none;
2972
+ }
2973
+ </style>
2974
+ <iframe
2975
+ part="iframe"
2976
+ ${initialSrc ? ` src="${escapeHtml(initialSrc)}"` : ""}
2977
+ allow="accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"
2978
+ allowfullscreen
2979
+ frameborder="0"
2980
+ width="100%"
2981
+ height="100%"
2982
+ referrerpolicy="${escapeHtml(attrs.referrerpolicy ?? "")}"
2983
+ ></iframe>
2984
+ `;
2985
+ };
2986
+ }
2987
+ };
2988
+ function templateAttrsToEmbedProps(attrs) {
2989
+ return {
2990
+ autoplay: attrs.autoplay !== void 0,
2991
+ defaultMuted: attrs.muted !== void 0,
2992
+ loop: attrs.loop !== void 0,
2993
+ controls: attrs.controls !== void 0,
2994
+ playsInline: attrs.playsinline !== void 0,
2995
+ preload: attrs.preload ?? "metadata"
2996
+ };
2997
+ }
2998
+ var VimeoVideo = class extends MediaAttachMixin(VimeoCustomMediaElement) {};
2999
+
3000
+ //#endregion
3001
+ //#region src/define/media/vimeo-video.ts
3002
+ var VimeoVideoElement = class extends VimeoVideo {
3003
+ static {
3004
+ this.tagName = "vimeo-video";
3005
+ }
3006
+ };
3007
+ safeDefine(VimeoVideoElement);
3008
+
3009
+ //#endregion
3010
+ export { VimeoVideoElement };
3011
+ //# sourceMappingURL=vimeo-video.dev.js.map