suada-components 1.9.0 → 1.9.1

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 (96) hide show
  1. package/dist/{components/DailyMotion-B7yDPBbg.js → DailyMotion-B-Q4fBEb.js} +1 -1
  2. package/dist/{components/DailyMotion-BmnymjR1.esm.js → DailyMotion-BAvo3Toe.esm.js} +1 -1
  3. package/dist/{components/Facebook-D9Ak6ZJU.esm.js → Facebook-C8GOujDt.esm.js} +1 -1
  4. package/dist/{components/Facebook-42iqQU2G.js → Facebook-CASik-P5.js} +1 -1
  5. package/dist/{components/FilePlayer-wg9lyafD.esm.js → FilePlayer-BOZIvaDy.esm.js} +1 -1
  6. package/dist/{components/FilePlayer-CAnHK0Cd.js → FilePlayer-CQ80KWY2.js} +1 -1
  7. package/dist/{components/Kaltura-DPaEN-dq.esm.js → Kaltura-B12Xdl6X.esm.js} +1 -1
  8. package/dist/{components/Kaltura-Ct6kwbgP.js → Kaltura-nYc5k7UB.js} +1 -1
  9. package/dist/{components/Mixcloud-sBbcL5rG.js → Mixcloud-DGQnlDAK.js} +1 -1
  10. package/dist/{components/Mixcloud-BobSN3YI.esm.js → Mixcloud-JfeQIOki.esm.js} +1 -1
  11. package/dist/{components/Mux-B9YP-rFr.esm.js → Mux-BHWzpAR-.esm.js} +1 -1
  12. package/dist/{components/Mux-Cosy8sFO.js → Mux-CiKZc8gj.js} +1 -1
  13. package/dist/{components/Preview-XcTlhHT1.esm.js → Preview-DSovY9gr.esm.js} +1 -1
  14. package/dist/{components/Preview-DiVfo6aa.js → Preview-DvZKrgm5.js} +1 -1
  15. package/dist/{components/SoundCloud-CIWqB-QW.js → SoundCloud-Di7z3nmP.js} +1 -1
  16. package/dist/{components/SoundCloud-BTHoyFWT.esm.js → SoundCloud-j_R0lK8D.esm.js} +1 -1
  17. package/dist/{components/Streamable-DsfQCy3p.esm.js → Streamable-CRhXZIKP.esm.js} +1 -1
  18. package/dist/{components/Streamable-9anYiQtU.js → Streamable-CV1mgzRv.js} +1 -1
  19. package/dist/{components/Twitch-D1BOr8hj.esm.js → Twitch-6icfp-ZE.esm.js} +1 -1
  20. package/dist/{components/Twitch-Dud6e1Rv.js → Twitch-Dj66vkCD.js} +1 -1
  21. package/dist/{components/Vidyard-C1csjpQH.esm.js → Vidyard--KX47pZ0.esm.js} +1 -1
  22. package/dist/{components/Vidyard-BuOu85uS.js → Vidyard-B-qmApe9.js} +1 -1
  23. package/dist/{components/Vimeo-CHlHIswX.esm.js → Vimeo-Ba9C6utC.esm.js} +1 -1
  24. package/dist/{components/Vimeo-DrDJ5O9H.js → Vimeo-DePzl7Sn.js} +1 -1
  25. package/dist/{components/Wistia-fh9U2CA2.js → Wistia-CXYB3Yus.js} +1 -1
  26. package/dist/{components/Wistia-D-eYyONb.esm.js → Wistia-DWJcdcY2.esm.js} +1 -1
  27. package/dist/{components/YouTube-CmnnzZvk.esm.js → YouTube-DdBVPxzz.esm.js} +1 -1
  28. package/dist/{components/YouTube-DC2uZ14c.js → YouTube-vwMoW93C.js} +1 -1
  29. package/dist/components/CourseCard/CourseCard.styles.d.ts +1 -1
  30. package/dist/components/DailyMotion-Cr_8IZRR.js +180 -0
  31. package/dist/components/DailyMotion-D2n1NDDi.esm.js +178 -0
  32. package/dist/components/Facebook-CDrTA2_L.esm.js +179 -0
  33. package/dist/components/Facebook-YxZce26V.js +181 -0
  34. package/dist/components/FilePlayer-BzkVMbQ8.esm.js +408 -0
  35. package/dist/components/FilePlayer-DqqTufgX.js +410 -0
  36. package/dist/components/Kaltura-B0UZLr6g.esm.js +176 -0
  37. package/dist/components/Kaltura-krSxvIBr.js +178 -0
  38. package/dist/components/Mixcloud-BCT5e47d.js +166 -0
  39. package/dist/components/Mixcloud-D9qk3D6i.esm.js +164 -0
  40. package/dist/components/Mux-BZleoaJh.esm.js +264 -0
  41. package/dist/components/Mux-D_si09u2.js +266 -0
  42. package/dist/components/Preview-CmduMeEZ.js +175 -0
  43. package/dist/components/Preview-DQLbQ8_C.esm.js +173 -0
  44. package/dist/components/SoundCloud-BHgTfaW7.js +183 -0
  45. package/dist/components/SoundCloud-BgnX8kOF.esm.js +181 -0
  46. package/dist/components/Streamable-DTAzjVwd.js +176 -0
  47. package/dist/components/Streamable-DbRbUflP.esm.js +174 -0
  48. package/dist/components/Twitch-CXOhay4a.esm.js +168 -0
  49. package/dist/components/Twitch-CnEk-l9R.js +170 -0
  50. package/dist/components/VideoPlayer/PiPContext.d.ts +8 -0
  51. package/dist/components/VideoPlayer/PiPContext.js +149 -0
  52. package/dist/components/VideoPlayer/PiPContext.js.map +1 -0
  53. package/dist/components/VideoPlayer/PiPContext.types.d.ts +16 -0
  54. package/dist/components/VideoPlayer/PiPContext.types.js +2 -0
  55. package/dist/components/VideoPlayer/PiPContext.types.js.map +1 -0
  56. package/dist/components/VideoPlayer/usePiP.d.ts +2 -0
  57. package/dist/components/VideoPlayer/usePiP.js +10 -0
  58. package/dist/components/VideoPlayer/usePiP.js.map +1 -0
  59. package/dist/components/VideoPlayer/usePlayerControls.js +12 -40
  60. package/dist/components/VideoPlayer/usePlayerControls.js.map +1 -1
  61. package/dist/components/Vidyard-Cn_LcGwi.js +174 -0
  62. package/dist/components/Vidyard-YcZH6kkW.esm.js +172 -0
  63. package/dist/components/Vimeo-BUVxWt7t.js +215 -0
  64. package/dist/components/Vimeo-Cv0qx3aR.esm.js +213 -0
  65. package/dist/components/Wistia-COWrV8QC.js +190 -0
  66. package/dist/components/Wistia-PneZ48dn.esm.js +188 -0
  67. package/dist/components/YouTube-BUyvzJQw.esm.js +258 -0
  68. package/dist/components/YouTube-DeQdfkWm.js +260 -0
  69. package/dist/components/components/CourseCard/CourseCard.styles.d.ts +1 -1
  70. package/dist/components/components/VideoPlayer/PiPContext.d.ts +8 -0
  71. package/dist/components/components/VideoPlayer/PiPContext.types.d.ts +16 -0
  72. package/dist/components/components/VideoPlayer/usePiP.d.ts +2 -0
  73. package/dist/components/components/index.d.ts +2 -0
  74. package/dist/components/{index-DetZ05pw.js → index-Bs-XxxV4.js} +153 -304
  75. package/dist/components/{index-DKAGRUEW.esm.js → index-C4Mk2H3N.esm.js} +152 -305
  76. package/dist/components/index.d.ts +2 -0
  77. package/dist/components/index.esm.js +1 -1
  78. package/dist/components/index.js +2 -0
  79. package/dist/components/index.js.map +1 -1
  80. package/dist/icons/components/CourseCard/CourseCard.styles.d.ts +1 -1
  81. package/dist/icons/components/VideoPlayer/PiPContext.d.ts +8 -0
  82. package/dist/icons/components/VideoPlayer/PiPContext.types.d.ts +16 -0
  83. package/dist/icons/components/VideoPlayer/usePiP.d.ts +2 -0
  84. package/dist/icons/components/index.d.ts +2 -0
  85. package/dist/index-Bp-idbg5.esm.js +94907 -0
  86. package/dist/index-CSj9NYxJ.js +95129 -0
  87. package/dist/index.d.ts +2 -0
  88. package/dist/index.esm.js +3 -3
  89. package/dist/index.js +3 -0
  90. package/dist/index.js.map +1 -1
  91. package/package.json +1 -1
  92. package/dist/components/VideoPlayer/pipManager.d.ts +0 -60
  93. package/dist/components/VideoPlayer/pipManager.js +0 -272
  94. package/dist/components/VideoPlayer/pipManager.js.map +0 -1
  95. package/dist/components/components/VideoPlayer/pipManager.d.ts +0 -60
  96. package/dist/icons/components/VideoPlayer/pipManager.d.ts +0 -60
@@ -0,0 +1,172 @@
1
+ import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-C4Mk2H3N.esm.js';
2
+ import React__default from 'react';
3
+
4
+ function _mergeNamespaces(n, m) {
5
+ m.forEach(function (e) {
6
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
7
+ if (k !== 'default' && !(k in n)) {
8
+ var d = Object.getOwnPropertyDescriptor(e, k);
9
+ Object.defineProperty(n, k, d.get ? d : {
10
+ enumerable: true,
11
+ get: function () { return e[k]; }
12
+ });
13
+ }
14
+ });
15
+ });
16
+ return Object.freeze(n);
17
+ }
18
+
19
+ var Vidyard_1;
20
+ var hasRequiredVidyard;
21
+
22
+ function requireVidyard () {
23
+ if (hasRequiredVidyard) return Vidyard_1;
24
+ hasRequiredVidyard = 1;
25
+ var __create = Object.create;
26
+ var __defProp = Object.defineProperty;
27
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
28
+ var __getOwnPropNames = Object.getOwnPropertyNames;
29
+ var __getProtoOf = Object.getPrototypeOf;
30
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
31
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
32
+ var __export = (target, all) => {
33
+ for (var name in all)
34
+ __defProp(target, name, { get: all[name], enumerable: true });
35
+ };
36
+ var __copyProps = (to, from, except, desc) => {
37
+ if (from && typeof from === "object" || typeof from === "function") {
38
+ for (let key of __getOwnPropNames(from))
39
+ if (!__hasOwnProp.call(to, key) && key !== except)
40
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
41
+ }
42
+ return to;
43
+ };
44
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
45
+ // If the importer is in node compatibility mode or this is not an ESM
46
+ // file that has been converted to a CommonJS file using a Babel-
47
+ // compatible transform (i.e. "__esModule" has not been set), then set
48
+ // "default" to the CommonJS "module.exports" for node compatibility.
49
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
50
+ mod
51
+ ));
52
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
53
+ var __publicField = (obj, key, value) => {
54
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
55
+ return value;
56
+ };
57
+ var Vidyard_exports = {};
58
+ __export(Vidyard_exports, {
59
+ default: () => Vidyard
60
+ });
61
+ Vidyard_1 = __toCommonJS(Vidyard_exports);
62
+ var import_react = __toESM(React__default);
63
+ var import_utils = /*@__PURE__*/ requireUtils();
64
+ var import_patterns = /*@__PURE__*/ requirePatterns();
65
+ const SDK_URL = "https://play.vidyard.com/embed/v4.js";
66
+ const SDK_GLOBAL = "VidyardV4";
67
+ const SDK_GLOBAL_READY = "onVidyardAPI";
68
+ class Vidyard extends import_react.Component {
69
+ constructor() {
70
+ super(...arguments);
71
+ __publicField(this, "callPlayer", import_utils.callPlayer);
72
+ __publicField(this, "mute", () => {
73
+ this.setVolume(0);
74
+ });
75
+ __publicField(this, "unmute", () => {
76
+ if (this.props.volume !== null) {
77
+ this.setVolume(this.props.volume);
78
+ }
79
+ });
80
+ __publicField(this, "ref", (container) => {
81
+ this.container = container;
82
+ });
83
+ }
84
+ componentDidMount() {
85
+ this.props.onMount && this.props.onMount(this);
86
+ }
87
+ load(url) {
88
+ const { playing, config, onError, onDuration } = this.props;
89
+ const id = url && url.match(import_patterns.MATCH_URL_VIDYARD)[1];
90
+ if (this.player) {
91
+ this.stop();
92
+ }
93
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then((Vidyard2) => {
94
+ if (!this.container)
95
+ return;
96
+ Vidyard2.api.addReadyListener((data, player) => {
97
+ if (this.player) {
98
+ return;
99
+ }
100
+ this.player = player;
101
+ this.player.on("ready", this.props.onReady);
102
+ this.player.on("play", this.props.onPlay);
103
+ this.player.on("pause", this.props.onPause);
104
+ this.player.on("seek", this.props.onSeek);
105
+ this.player.on("playerComplete", this.props.onEnded);
106
+ }, id);
107
+ Vidyard2.api.renderPlayer({
108
+ uuid: id,
109
+ container: this.container,
110
+ autoplay: playing ? 1 : 0,
111
+ ...config.options
112
+ });
113
+ Vidyard2.api.getPlayerMetadata(id).then((meta) => {
114
+ this.duration = meta.length_in_seconds;
115
+ onDuration(meta.length_in_seconds);
116
+ });
117
+ }, onError);
118
+ }
119
+ play() {
120
+ this.callPlayer("play");
121
+ }
122
+ pause() {
123
+ this.callPlayer("pause");
124
+ }
125
+ stop() {
126
+ window.VidyardV4.api.destroyPlayer(this.player);
127
+ }
128
+ seekTo(amount, keepPlaying = true) {
129
+ this.callPlayer("seek", amount);
130
+ if (!keepPlaying) {
131
+ this.pause();
132
+ }
133
+ }
134
+ setVolume(fraction) {
135
+ this.callPlayer("setVolume", fraction);
136
+ }
137
+ setPlaybackRate(rate) {
138
+ this.callPlayer("setPlaybackSpeed", rate);
139
+ }
140
+ getDuration() {
141
+ return this.duration;
142
+ }
143
+ getCurrentTime() {
144
+ return this.callPlayer("currentTime");
145
+ }
146
+ getSecondsLoaded() {
147
+ return null;
148
+ }
149
+ render() {
150
+ const { display } = this.props;
151
+ const style = {
152
+ width: "100%",
153
+ height: "100%",
154
+ display
155
+ };
156
+ return /* @__PURE__ */ import_react.default.createElement("div", { style }, /* @__PURE__ */ import_react.default.createElement("div", { ref: this.ref }));
157
+ }
158
+ }
159
+ __publicField(Vidyard, "displayName", "Vidyard");
160
+ __publicField(Vidyard, "canPlay", import_patterns.canPlay.vidyard);
161
+ return Vidyard_1;
162
+ }
163
+
164
+ var VidyardExports = /*@__PURE__*/ requireVidyard();
165
+ var Vidyard = /*@__PURE__*/getDefaultExportFromCjs(VidyardExports);
166
+
167
+ var Vidyard$1 = /*#__PURE__*/_mergeNamespaces({
168
+ __proto__: null,
169
+ default: Vidyard
170
+ }, [VidyardExports]);
171
+
172
+ export { Vidyard$1 as V };
@@ -0,0 +1,215 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-Bs-XxxV4.js');
4
+ var React = require('react');
5
+
6
+ function _mergeNamespaces(n, m) {
7
+ m.forEach(function (e) {
8
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default' && !(k in n)) {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
14
+ });
15
+ }
16
+ });
17
+ });
18
+ return Object.freeze(n);
19
+ }
20
+
21
+ var Vimeo_1;
22
+ var hasRequiredVimeo;
23
+
24
+ function requireVimeo () {
25
+ if (hasRequiredVimeo) return Vimeo_1;
26
+ hasRequiredVimeo = 1;
27
+ var __create = Object.create;
28
+ var __defProp = Object.defineProperty;
29
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
30
+ var __getOwnPropNames = Object.getOwnPropertyNames;
31
+ var __getProtoOf = Object.getPrototypeOf;
32
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
33
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34
+ var __export = (target, all) => {
35
+ for (var name in all)
36
+ __defProp(target, name, { get: all[name], enumerable: true });
37
+ };
38
+ var __copyProps = (to, from, except, desc) => {
39
+ if (from && typeof from === "object" || typeof from === "function") {
40
+ for (let key of __getOwnPropNames(from))
41
+ if (!__hasOwnProp.call(to, key) && key !== except)
42
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
43
+ }
44
+ return to;
45
+ };
46
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
47
+ // If the importer is in node compatibility mode or this is not an ESM
48
+ // file that has been converted to a CommonJS file using a Babel-
49
+ // compatible transform (i.e. "__esModule" has not been set), then set
50
+ // "default" to the CommonJS "module.exports" for node compatibility.
51
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
52
+ mod
53
+ ));
54
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
55
+ var __publicField = (obj, key, value) => {
56
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
57
+ return value;
58
+ };
59
+ var Vimeo_exports = {};
60
+ __export(Vimeo_exports, {
61
+ default: () => Vimeo
62
+ });
63
+ Vimeo_1 = __toCommonJS(Vimeo_exports);
64
+ var import_react = __toESM(React);
65
+ var import_utils = /*@__PURE__*/ index.requireUtils();
66
+ var import_patterns = /*@__PURE__*/ index.requirePatterns();
67
+ const SDK_URL = "https://player.vimeo.com/api/player.js";
68
+ const SDK_GLOBAL = "Vimeo";
69
+ const cleanUrl = (url) => {
70
+ return url.replace("/manage/videos", "");
71
+ };
72
+ class Vimeo extends import_react.Component {
73
+ constructor() {
74
+ super(...arguments);
75
+ // Prevent checking isLoading when URL changes
76
+ __publicField(this, "callPlayer", import_utils.callPlayer);
77
+ __publicField(this, "duration", null);
78
+ __publicField(this, "currentTime", null);
79
+ __publicField(this, "secondsLoaded", null);
80
+ __publicField(this, "mute", () => {
81
+ this.setMuted(true);
82
+ });
83
+ __publicField(this, "unmute", () => {
84
+ this.setMuted(false);
85
+ });
86
+ __publicField(this, "ref", (container) => {
87
+ this.container = container;
88
+ });
89
+ }
90
+ componentDidMount() {
91
+ this.props.onMount && this.props.onMount(this);
92
+ }
93
+ load(url) {
94
+ this.duration = null;
95
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Vimeo2) => {
96
+ if (!this.container)
97
+ return;
98
+ const { playerOptions, title } = this.props.config;
99
+ this.player = new Vimeo2.Player(this.container, {
100
+ url: cleanUrl(url),
101
+ autoplay: this.props.playing,
102
+ muted: this.props.muted,
103
+ loop: this.props.loop,
104
+ playsinline: this.props.playsinline,
105
+ controls: this.props.controls,
106
+ ...playerOptions
107
+ });
108
+ this.player.ready().then(() => {
109
+ const iframe = this.container.querySelector("iframe");
110
+ iframe.style.width = "100%";
111
+ iframe.style.height = "100%";
112
+ if (title) {
113
+ iframe.title = title;
114
+ }
115
+ }).catch(this.props.onError);
116
+ this.player.on("loaded", () => {
117
+ this.props.onReady();
118
+ this.refreshDuration();
119
+ });
120
+ this.player.on("play", () => {
121
+ this.props.onPlay();
122
+ this.refreshDuration();
123
+ });
124
+ this.player.on("pause", this.props.onPause);
125
+ this.player.on("seeked", (e) => this.props.onSeek(e.seconds));
126
+ this.player.on("ended", this.props.onEnded);
127
+ this.player.on("error", this.props.onError);
128
+ this.player.on("timeupdate", ({ seconds }) => {
129
+ this.currentTime = seconds;
130
+ });
131
+ this.player.on("progress", ({ seconds }) => {
132
+ this.secondsLoaded = seconds;
133
+ });
134
+ this.player.on("bufferstart", this.props.onBuffer);
135
+ this.player.on("bufferend", this.props.onBufferEnd);
136
+ this.player.on("playbackratechange", (e) => this.props.onPlaybackRateChange(e.playbackRate));
137
+ }, this.props.onError);
138
+ }
139
+ refreshDuration() {
140
+ this.player.getDuration().then((duration) => {
141
+ this.duration = duration;
142
+ });
143
+ }
144
+ play() {
145
+ const promise = this.callPlayer("play");
146
+ if (promise) {
147
+ promise.catch(this.props.onError);
148
+ }
149
+ }
150
+ pause() {
151
+ this.callPlayer("pause");
152
+ }
153
+ stop() {
154
+ this.callPlayer("unload");
155
+ }
156
+ seekTo(seconds, keepPlaying = true) {
157
+ this.callPlayer("setCurrentTime", seconds);
158
+ if (!keepPlaying) {
159
+ this.pause();
160
+ }
161
+ }
162
+ setVolume(fraction) {
163
+ this.callPlayer("setVolume", fraction);
164
+ }
165
+ setMuted(muted) {
166
+ this.callPlayer("setMuted", muted);
167
+ }
168
+ setLoop(loop) {
169
+ this.callPlayer("setLoop", loop);
170
+ }
171
+ setPlaybackRate(rate) {
172
+ this.callPlayer("setPlaybackRate", rate);
173
+ }
174
+ getDuration() {
175
+ return this.duration;
176
+ }
177
+ getCurrentTime() {
178
+ return this.currentTime;
179
+ }
180
+ getSecondsLoaded() {
181
+ return this.secondsLoaded;
182
+ }
183
+ render() {
184
+ const { display } = this.props;
185
+ const style = {
186
+ width: "100%",
187
+ height: "100%",
188
+ overflow: "hidden",
189
+ display
190
+ };
191
+ return /* @__PURE__ */ import_react.default.createElement(
192
+ "div",
193
+ {
194
+ key: this.props.url,
195
+ ref: this.ref,
196
+ style
197
+ }
198
+ );
199
+ }
200
+ }
201
+ __publicField(Vimeo, "displayName", "Vimeo");
202
+ __publicField(Vimeo, "canPlay", import_patterns.canPlay.vimeo);
203
+ __publicField(Vimeo, "forceLoad", true);
204
+ return Vimeo_1;
205
+ }
206
+
207
+ var VimeoExports = /*@__PURE__*/ requireVimeo();
208
+ var Vimeo = /*@__PURE__*/index.getDefaultExportFromCjs(VimeoExports);
209
+
210
+ var Vimeo$1 = /*#__PURE__*/_mergeNamespaces({
211
+ __proto__: null,
212
+ default: Vimeo
213
+ }, [VimeoExports]);
214
+
215
+ exports.Vimeo = Vimeo$1;
@@ -0,0 +1,213 @@
1
+ import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-C4Mk2H3N.esm.js';
2
+ import React__default from 'react';
3
+
4
+ function _mergeNamespaces(n, m) {
5
+ m.forEach(function (e) {
6
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
7
+ if (k !== 'default' && !(k in n)) {
8
+ var d = Object.getOwnPropertyDescriptor(e, k);
9
+ Object.defineProperty(n, k, d.get ? d : {
10
+ enumerable: true,
11
+ get: function () { return e[k]; }
12
+ });
13
+ }
14
+ });
15
+ });
16
+ return Object.freeze(n);
17
+ }
18
+
19
+ var Vimeo_1;
20
+ var hasRequiredVimeo;
21
+
22
+ function requireVimeo () {
23
+ if (hasRequiredVimeo) return Vimeo_1;
24
+ hasRequiredVimeo = 1;
25
+ var __create = Object.create;
26
+ var __defProp = Object.defineProperty;
27
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
28
+ var __getOwnPropNames = Object.getOwnPropertyNames;
29
+ var __getProtoOf = Object.getPrototypeOf;
30
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
31
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
32
+ var __export = (target, all) => {
33
+ for (var name in all)
34
+ __defProp(target, name, { get: all[name], enumerable: true });
35
+ };
36
+ var __copyProps = (to, from, except, desc) => {
37
+ if (from && typeof from === "object" || typeof from === "function") {
38
+ for (let key of __getOwnPropNames(from))
39
+ if (!__hasOwnProp.call(to, key) && key !== except)
40
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
41
+ }
42
+ return to;
43
+ };
44
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
45
+ // If the importer is in node compatibility mode or this is not an ESM
46
+ // file that has been converted to a CommonJS file using a Babel-
47
+ // compatible transform (i.e. "__esModule" has not been set), then set
48
+ // "default" to the CommonJS "module.exports" for node compatibility.
49
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
50
+ mod
51
+ ));
52
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
53
+ var __publicField = (obj, key, value) => {
54
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
55
+ return value;
56
+ };
57
+ var Vimeo_exports = {};
58
+ __export(Vimeo_exports, {
59
+ default: () => Vimeo
60
+ });
61
+ Vimeo_1 = __toCommonJS(Vimeo_exports);
62
+ var import_react = __toESM(React__default);
63
+ var import_utils = /*@__PURE__*/ requireUtils();
64
+ var import_patterns = /*@__PURE__*/ requirePatterns();
65
+ const SDK_URL = "https://player.vimeo.com/api/player.js";
66
+ const SDK_GLOBAL = "Vimeo";
67
+ const cleanUrl = (url) => {
68
+ return url.replace("/manage/videos", "");
69
+ };
70
+ class Vimeo extends import_react.Component {
71
+ constructor() {
72
+ super(...arguments);
73
+ // Prevent checking isLoading when URL changes
74
+ __publicField(this, "callPlayer", import_utils.callPlayer);
75
+ __publicField(this, "duration", null);
76
+ __publicField(this, "currentTime", null);
77
+ __publicField(this, "secondsLoaded", null);
78
+ __publicField(this, "mute", () => {
79
+ this.setMuted(true);
80
+ });
81
+ __publicField(this, "unmute", () => {
82
+ this.setMuted(false);
83
+ });
84
+ __publicField(this, "ref", (container) => {
85
+ this.container = container;
86
+ });
87
+ }
88
+ componentDidMount() {
89
+ this.props.onMount && this.props.onMount(this);
90
+ }
91
+ load(url) {
92
+ this.duration = null;
93
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Vimeo2) => {
94
+ if (!this.container)
95
+ return;
96
+ const { playerOptions, title } = this.props.config;
97
+ this.player = new Vimeo2.Player(this.container, {
98
+ url: cleanUrl(url),
99
+ autoplay: this.props.playing,
100
+ muted: this.props.muted,
101
+ loop: this.props.loop,
102
+ playsinline: this.props.playsinline,
103
+ controls: this.props.controls,
104
+ ...playerOptions
105
+ });
106
+ this.player.ready().then(() => {
107
+ const iframe = this.container.querySelector("iframe");
108
+ iframe.style.width = "100%";
109
+ iframe.style.height = "100%";
110
+ if (title) {
111
+ iframe.title = title;
112
+ }
113
+ }).catch(this.props.onError);
114
+ this.player.on("loaded", () => {
115
+ this.props.onReady();
116
+ this.refreshDuration();
117
+ });
118
+ this.player.on("play", () => {
119
+ this.props.onPlay();
120
+ this.refreshDuration();
121
+ });
122
+ this.player.on("pause", this.props.onPause);
123
+ this.player.on("seeked", (e) => this.props.onSeek(e.seconds));
124
+ this.player.on("ended", this.props.onEnded);
125
+ this.player.on("error", this.props.onError);
126
+ this.player.on("timeupdate", ({ seconds }) => {
127
+ this.currentTime = seconds;
128
+ });
129
+ this.player.on("progress", ({ seconds }) => {
130
+ this.secondsLoaded = seconds;
131
+ });
132
+ this.player.on("bufferstart", this.props.onBuffer);
133
+ this.player.on("bufferend", this.props.onBufferEnd);
134
+ this.player.on("playbackratechange", (e) => this.props.onPlaybackRateChange(e.playbackRate));
135
+ }, this.props.onError);
136
+ }
137
+ refreshDuration() {
138
+ this.player.getDuration().then((duration) => {
139
+ this.duration = duration;
140
+ });
141
+ }
142
+ play() {
143
+ const promise = this.callPlayer("play");
144
+ if (promise) {
145
+ promise.catch(this.props.onError);
146
+ }
147
+ }
148
+ pause() {
149
+ this.callPlayer("pause");
150
+ }
151
+ stop() {
152
+ this.callPlayer("unload");
153
+ }
154
+ seekTo(seconds, keepPlaying = true) {
155
+ this.callPlayer("setCurrentTime", seconds);
156
+ if (!keepPlaying) {
157
+ this.pause();
158
+ }
159
+ }
160
+ setVolume(fraction) {
161
+ this.callPlayer("setVolume", fraction);
162
+ }
163
+ setMuted(muted) {
164
+ this.callPlayer("setMuted", muted);
165
+ }
166
+ setLoop(loop) {
167
+ this.callPlayer("setLoop", loop);
168
+ }
169
+ setPlaybackRate(rate) {
170
+ this.callPlayer("setPlaybackRate", rate);
171
+ }
172
+ getDuration() {
173
+ return this.duration;
174
+ }
175
+ getCurrentTime() {
176
+ return this.currentTime;
177
+ }
178
+ getSecondsLoaded() {
179
+ return this.secondsLoaded;
180
+ }
181
+ render() {
182
+ const { display } = this.props;
183
+ const style = {
184
+ width: "100%",
185
+ height: "100%",
186
+ overflow: "hidden",
187
+ display
188
+ };
189
+ return /* @__PURE__ */ import_react.default.createElement(
190
+ "div",
191
+ {
192
+ key: this.props.url,
193
+ ref: this.ref,
194
+ style
195
+ }
196
+ );
197
+ }
198
+ }
199
+ __publicField(Vimeo, "displayName", "Vimeo");
200
+ __publicField(Vimeo, "canPlay", import_patterns.canPlay.vimeo);
201
+ __publicField(Vimeo, "forceLoad", true);
202
+ return Vimeo_1;
203
+ }
204
+
205
+ var VimeoExports = /*@__PURE__*/ requireVimeo();
206
+ var Vimeo = /*@__PURE__*/getDefaultExportFromCjs(VimeoExports);
207
+
208
+ var Vimeo$1 = /*#__PURE__*/_mergeNamespaces({
209
+ __proto__: null,
210
+ default: Vimeo
211
+ }, [VimeoExports]);
212
+
213
+ export { Vimeo$1 as V };