@hanifhan1f/vidstack-react 1.12.19 → 1.12.21

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 (59) hide show
  1. package/dev/chunks/vidstack-BPymmnxm.js +551 -0
  2. package/dev/chunks/vidstack-BSpAxhO6.js +643 -0
  3. package/dev/chunks/vidstack-BoLZuw80.js +34 -0
  4. package/dev/chunks/vidstack-CFOPpDTy.js +476 -0
  5. package/dev/chunks/vidstack-CXrXBlpD.js +11692 -0
  6. package/dev/chunks/vidstack-DOtIyh4c.js +288 -0
  7. package/dev/chunks/vidstack-DY2iivhG.js +84 -0
  8. package/dev/chunks/vidstack-Dov8gjdq.js +401 -0
  9. package/dev/chunks/vidstack-DwdhbP5c.js +189 -0
  10. package/dev/chunks/vidstack-DweQYzVw.js +180 -0
  11. package/dev/chunks/vidstack-H9OdEKUQ.js +375 -0
  12. package/dev/chunks/vidstack-KntYDWMe.js +668 -0
  13. package/dev/chunks/vidstack-NCBSBZE-.js +61 -0
  14. package/dev/chunks/vidstack-UWMPvwsa.js +1537 -0
  15. package/dev/player/vidstack-default-components.js +5 -5
  16. package/dev/player/vidstack-default-layout.js +5 -5
  17. package/dev/player/vidstack-plyr-layout.js +4 -4
  18. package/dev/player/vidstack-remotion.js +3 -3
  19. package/dev/vidstack.js +7 -7
  20. package/package.json +1 -1
  21. package/player/styles/default/layouts/video.css +94 -77
  22. package/prod/chunks/vidstack-B9nEslvl.js +11197 -0
  23. package/prod/chunks/vidstack-BOObgZd8.js +504 -0
  24. package/prod/chunks/vidstack-B_wD853-.js +386 -0
  25. package/prod/chunks/vidstack-C4tNkfXj.js +470 -0
  26. package/prod/chunks/vidstack-CNJwYQRW.js +84 -0
  27. package/prod/chunks/vidstack-CVzVtf1j.js +61 -0
  28. package/prod/chunks/vidstack-CiQEyk_l.js +189 -0
  29. package/prod/chunks/vidstack-CiTWSpv_.js +34 -0
  30. package/prod/chunks/vidstack-CzjHdPIT.js +375 -0
  31. package/prod/chunks/vidstack-Djmla_FM.js +545 -0
  32. package/prod/chunks/vidstack-DpQw1Y33.js +663 -0
  33. package/prod/chunks/vidstack-VTpvHAdU.js +1537 -0
  34. package/prod/chunks/vidstack-dbLRgf2L.js +159 -0
  35. package/prod/chunks/vidstack-rHvQ8f6c.js +288 -0
  36. package/prod/player/vidstack-default-components.js +5 -5
  37. package/prod/player/vidstack-default-layout.js +5 -5
  38. package/prod/player/vidstack-plyr-layout.js +4 -4
  39. package/prod/player/vidstack-remotion.js +3 -3
  40. package/prod/vidstack.js +7 -7
  41. package/server/chunks/vidstack-BV_VpWlJ.js +1537 -0
  42. package/server/chunks/vidstack-ByG5MvLs.js +545 -0
  43. package/server/chunks/vidstack-C0xOpWYR.js +470 -0
  44. package/server/chunks/vidstack-C481iXqe.js +386 -0
  45. package/server/chunks/vidstack-CbNRZgUA.js +11197 -0
  46. package/server/chunks/vidstack-D7D9kiW6.js +34 -0
  47. package/server/chunks/vidstack-DJJmNib6.js +504 -0
  48. package/server/chunks/vidstack-DWt5LAKE.js +375 -0
  49. package/server/chunks/vidstack-DsZKgA8y.js +663 -0
  50. package/server/chunks/vidstack-NXcLNXxO.js +84 -0
  51. package/server/chunks/vidstack-OKdxH1xx.js +189 -0
  52. package/server/chunks/vidstack-iVN8uBAv.js +288 -0
  53. package/server/chunks/vidstack-m8aA99tE.js +159 -0
  54. package/server/chunks/vidstack-rUHVQoo3.js +61 -0
  55. package/server/player/vidstack-default-components.js +5 -5
  56. package/server/player/vidstack-default-layout.js +5 -5
  57. package/server/player/vidstack-plyr-layout.js +4 -4
  58. package/server/player/vidstack-remotion.js +3 -3
  59. package/server/vidstack.js +7 -7
@@ -0,0 +1,61 @@
1
+ "use client"
2
+
3
+ import { appendParamsToURL, IS_SERVER } from './vidstack-CXrXBlpD.js';
4
+ import { signal, listenEvent, effect, peek, isString } from './vidstack-D_bWd66h.js';
5
+
6
+ class EmbedProvider {
7
+ #iframe;
8
+ src = signal("");
9
+ /**
10
+ * Defines which referrer is sent when fetching the resource.
11
+ *
12
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy}
13
+ */
14
+ referrerPolicy = null;
15
+ get iframe() {
16
+ return this.#iframe;
17
+ }
18
+ constructor(iframe) {
19
+ this.#iframe = iframe;
20
+ iframe.setAttribute("frameBorder", "0");
21
+ iframe.setAttribute("aria-hidden", "true");
22
+ iframe.setAttribute(
23
+ "allow",
24
+ "autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"
25
+ );
26
+ if (this.referrerPolicy !== null) {
27
+ iframe.setAttribute("referrerpolicy", this.referrerPolicy);
28
+ }
29
+ }
30
+ setup() {
31
+ listenEvent(window, "message", this.#onWindowMessage.bind(this));
32
+ listenEvent(this.#iframe, "load", this.onLoad.bind(this));
33
+ effect(this.#watchSrc.bind(this));
34
+ }
35
+ #watchSrc() {
36
+ const src = this.src();
37
+ if (!src.length) {
38
+ this.#iframe.setAttribute("src", "");
39
+ return;
40
+ }
41
+ const params = peek(() => this.buildParams());
42
+ this.#iframe.setAttribute("src", appendParamsToURL(src, params));
43
+ }
44
+ postMessage(message, target) {
45
+ if (IS_SERVER) return;
46
+ this.#iframe.contentWindow?.postMessage(JSON.stringify(message), target ?? "*");
47
+ }
48
+ #onWindowMessage(event) {
49
+ const origin = this.getOrigin(), isOriginMatch = (event.source === null || event.source === this.#iframe?.contentWindow) && (!isString(origin) || origin === event.origin);
50
+ if (!isOriginMatch) return;
51
+ try {
52
+ const message = JSON.parse(event.data);
53
+ if (message) this.onMessage(message, event);
54
+ return;
55
+ } catch (e) {
56
+ }
57
+ if (event.data) this.onMessage(event.data, event);
58
+ }
59
+ }
60
+
61
+ export { EmbedProvider };