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,178 @@
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 Kaltura_1;
22
+ var hasRequiredKaltura;
23
+
24
+ function requireKaltura () {
25
+ if (hasRequiredKaltura) return Kaltura_1;
26
+ hasRequiredKaltura = 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 Kaltura_exports = {};
60
+ __export(Kaltura_exports, {
61
+ default: () => Kaltura
62
+ });
63
+ Kaltura_1 = __toCommonJS(Kaltura_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://cdn.embed.ly/player-0.1.0.min.js";
68
+ const SDK_GLOBAL = "playerjs";
69
+ class Kaltura extends import_react.Component {
70
+ constructor() {
71
+ super(...arguments);
72
+ __publicField(this, "callPlayer", import_utils.callPlayer);
73
+ __publicField(this, "duration", null);
74
+ __publicField(this, "currentTime", null);
75
+ __publicField(this, "secondsLoaded", null);
76
+ __publicField(this, "mute", () => {
77
+ this.callPlayer("mute");
78
+ });
79
+ __publicField(this, "unmute", () => {
80
+ this.callPlayer("unmute");
81
+ });
82
+ __publicField(this, "ref", (iframe) => {
83
+ this.iframe = iframe;
84
+ });
85
+ }
86
+ componentDidMount() {
87
+ this.props.onMount && this.props.onMount(this);
88
+ }
89
+ load(url) {
90
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((playerjs) => {
91
+ if (!this.iframe)
92
+ return;
93
+ this.player = new playerjs.Player(this.iframe);
94
+ this.player.on("ready", () => {
95
+ setTimeout(() => {
96
+ this.player.isReady = true;
97
+ this.player.setLoop(this.props.loop);
98
+ if (this.props.muted) {
99
+ this.player.mute();
100
+ }
101
+ this.addListeners(this.player, this.props);
102
+ this.props.onReady();
103
+ }, 500);
104
+ });
105
+ }, this.props.onError);
106
+ }
107
+ addListeners(player, props) {
108
+ player.on("play", props.onPlay);
109
+ player.on("pause", props.onPause);
110
+ player.on("ended", props.onEnded);
111
+ player.on("error", props.onError);
112
+ player.on("timeupdate", ({ duration, seconds }) => {
113
+ this.duration = duration;
114
+ this.currentTime = seconds;
115
+ });
116
+ }
117
+ play() {
118
+ this.callPlayer("play");
119
+ }
120
+ pause() {
121
+ this.callPlayer("pause");
122
+ }
123
+ stop() {
124
+ }
125
+ seekTo(seconds, keepPlaying = true) {
126
+ this.callPlayer("setCurrentTime", seconds);
127
+ if (!keepPlaying) {
128
+ this.pause();
129
+ }
130
+ }
131
+ setVolume(fraction) {
132
+ this.callPlayer("setVolume", fraction);
133
+ }
134
+ setLoop(loop) {
135
+ this.callPlayer("setLoop", loop);
136
+ }
137
+ getDuration() {
138
+ return this.duration;
139
+ }
140
+ getCurrentTime() {
141
+ return this.currentTime;
142
+ }
143
+ getSecondsLoaded() {
144
+ return this.secondsLoaded;
145
+ }
146
+ render() {
147
+ const style = {
148
+ width: "100%",
149
+ height: "100%"
150
+ };
151
+ return /* @__PURE__ */ import_react.default.createElement(
152
+ "iframe",
153
+ {
154
+ ref: this.ref,
155
+ src: this.props.url,
156
+ frameBorder: "0",
157
+ scrolling: "no",
158
+ style,
159
+ allow: "encrypted-media; autoplay; fullscreen;",
160
+ referrerPolicy: "no-referrer-when-downgrade"
161
+ }
162
+ );
163
+ }
164
+ }
165
+ __publicField(Kaltura, "displayName", "Kaltura");
166
+ __publicField(Kaltura, "canPlay", import_patterns.canPlay.kaltura);
167
+ return Kaltura_1;
168
+ }
169
+
170
+ var KalturaExports = /*@__PURE__*/ requireKaltura();
171
+ var Kaltura = /*@__PURE__*/index.getDefaultExportFromCjs(KalturaExports);
172
+
173
+ var Kaltura$1 = /*#__PURE__*/_mergeNamespaces({
174
+ __proto__: null,
175
+ default: Kaltura
176
+ }, [KalturaExports]);
177
+
178
+ exports.Kaltura = Kaltura$1;
@@ -0,0 +1,166 @@
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 Mixcloud_1;
22
+ var hasRequiredMixcloud;
23
+
24
+ function requireMixcloud () {
25
+ if (hasRequiredMixcloud) return Mixcloud_1;
26
+ hasRequiredMixcloud = 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 Mixcloud_exports = {};
60
+ __export(Mixcloud_exports, {
61
+ default: () => Mixcloud
62
+ });
63
+ Mixcloud_1 = __toCommonJS(Mixcloud_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://widget.mixcloud.com/media/js/widgetApi.js";
68
+ const SDK_GLOBAL = "Mixcloud";
69
+ class Mixcloud extends import_react.Component {
70
+ constructor() {
71
+ super(...arguments);
72
+ __publicField(this, "callPlayer", import_utils.callPlayer);
73
+ __publicField(this, "duration", null);
74
+ __publicField(this, "currentTime", null);
75
+ __publicField(this, "secondsLoaded", null);
76
+ __publicField(this, "mute", () => {
77
+ });
78
+ __publicField(this, "unmute", () => {
79
+ });
80
+ __publicField(this, "ref", (iframe) => {
81
+ this.iframe = iframe;
82
+ });
83
+ }
84
+ componentDidMount() {
85
+ this.props.onMount && this.props.onMount(this);
86
+ }
87
+ load(url) {
88
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Mixcloud2) => {
89
+ this.player = Mixcloud2.PlayerWidget(this.iframe);
90
+ this.player.ready.then(() => {
91
+ this.player.events.play.on(this.props.onPlay);
92
+ this.player.events.pause.on(this.props.onPause);
93
+ this.player.events.ended.on(this.props.onEnded);
94
+ this.player.events.error.on(this.props.error);
95
+ this.player.events.progress.on((seconds, duration) => {
96
+ this.currentTime = seconds;
97
+ this.duration = duration;
98
+ });
99
+ this.props.onReady();
100
+ });
101
+ }, this.props.onError);
102
+ }
103
+ play() {
104
+ this.callPlayer("play");
105
+ }
106
+ pause() {
107
+ this.callPlayer("pause");
108
+ }
109
+ stop() {
110
+ }
111
+ seekTo(seconds, keepPlaying = true) {
112
+ this.callPlayer("seek", seconds);
113
+ if (!keepPlaying) {
114
+ this.pause();
115
+ }
116
+ }
117
+ setVolume(fraction) {
118
+ }
119
+ getDuration() {
120
+ return this.duration;
121
+ }
122
+ getCurrentTime() {
123
+ return this.currentTime;
124
+ }
125
+ getSecondsLoaded() {
126
+ return null;
127
+ }
128
+ render() {
129
+ const { url, config } = this.props;
130
+ const id = url.match(import_patterns.MATCH_URL_MIXCLOUD)[1];
131
+ const style = {
132
+ width: "100%",
133
+ height: "100%"
134
+ };
135
+ const query = (0, import_utils.queryString)({
136
+ ...config.options,
137
+ feed: `/${id}/`
138
+ });
139
+ return /* @__PURE__ */ import_react.default.createElement(
140
+ "iframe",
141
+ {
142
+ key: id,
143
+ ref: this.ref,
144
+ style,
145
+ src: `https://www.mixcloud.com/widget/iframe/?${query}`,
146
+ frameBorder: "0",
147
+ allow: "autoplay"
148
+ }
149
+ );
150
+ }
151
+ }
152
+ __publicField(Mixcloud, "displayName", "Mixcloud");
153
+ __publicField(Mixcloud, "canPlay", import_patterns.canPlay.mixcloud);
154
+ __publicField(Mixcloud, "loopOnEnded", true);
155
+ return Mixcloud_1;
156
+ }
157
+
158
+ var MixcloudExports = /*@__PURE__*/ requireMixcloud();
159
+ var Mixcloud = /*@__PURE__*/index.getDefaultExportFromCjs(MixcloudExports);
160
+
161
+ var Mixcloud$1 = /*#__PURE__*/_mergeNamespaces({
162
+ __proto__: null,
163
+ default: Mixcloud
164
+ }, [MixcloudExports]);
165
+
166
+ exports.Mixcloud = Mixcloud$1;
@@ -0,0 +1,164 @@
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 Mixcloud_1;
20
+ var hasRequiredMixcloud;
21
+
22
+ function requireMixcloud () {
23
+ if (hasRequiredMixcloud) return Mixcloud_1;
24
+ hasRequiredMixcloud = 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 Mixcloud_exports = {};
58
+ __export(Mixcloud_exports, {
59
+ default: () => Mixcloud
60
+ });
61
+ Mixcloud_1 = __toCommonJS(Mixcloud_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://widget.mixcloud.com/media/js/widgetApi.js";
66
+ const SDK_GLOBAL = "Mixcloud";
67
+ class Mixcloud extends import_react.Component {
68
+ constructor() {
69
+ super(...arguments);
70
+ __publicField(this, "callPlayer", import_utils.callPlayer);
71
+ __publicField(this, "duration", null);
72
+ __publicField(this, "currentTime", null);
73
+ __publicField(this, "secondsLoaded", null);
74
+ __publicField(this, "mute", () => {
75
+ });
76
+ __publicField(this, "unmute", () => {
77
+ });
78
+ __publicField(this, "ref", (iframe) => {
79
+ this.iframe = iframe;
80
+ });
81
+ }
82
+ componentDidMount() {
83
+ this.props.onMount && this.props.onMount(this);
84
+ }
85
+ load(url) {
86
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Mixcloud2) => {
87
+ this.player = Mixcloud2.PlayerWidget(this.iframe);
88
+ this.player.ready.then(() => {
89
+ this.player.events.play.on(this.props.onPlay);
90
+ this.player.events.pause.on(this.props.onPause);
91
+ this.player.events.ended.on(this.props.onEnded);
92
+ this.player.events.error.on(this.props.error);
93
+ this.player.events.progress.on((seconds, duration) => {
94
+ this.currentTime = seconds;
95
+ this.duration = duration;
96
+ });
97
+ this.props.onReady();
98
+ });
99
+ }, this.props.onError);
100
+ }
101
+ play() {
102
+ this.callPlayer("play");
103
+ }
104
+ pause() {
105
+ this.callPlayer("pause");
106
+ }
107
+ stop() {
108
+ }
109
+ seekTo(seconds, keepPlaying = true) {
110
+ this.callPlayer("seek", seconds);
111
+ if (!keepPlaying) {
112
+ this.pause();
113
+ }
114
+ }
115
+ setVolume(fraction) {
116
+ }
117
+ getDuration() {
118
+ return this.duration;
119
+ }
120
+ getCurrentTime() {
121
+ return this.currentTime;
122
+ }
123
+ getSecondsLoaded() {
124
+ return null;
125
+ }
126
+ render() {
127
+ const { url, config } = this.props;
128
+ const id = url.match(import_patterns.MATCH_URL_MIXCLOUD)[1];
129
+ const style = {
130
+ width: "100%",
131
+ height: "100%"
132
+ };
133
+ const query = (0, import_utils.queryString)({
134
+ ...config.options,
135
+ feed: `/${id}/`
136
+ });
137
+ return /* @__PURE__ */ import_react.default.createElement(
138
+ "iframe",
139
+ {
140
+ key: id,
141
+ ref: this.ref,
142
+ style,
143
+ src: `https://www.mixcloud.com/widget/iframe/?${query}`,
144
+ frameBorder: "0",
145
+ allow: "autoplay"
146
+ }
147
+ );
148
+ }
149
+ }
150
+ __publicField(Mixcloud, "displayName", "Mixcloud");
151
+ __publicField(Mixcloud, "canPlay", import_patterns.canPlay.mixcloud);
152
+ __publicField(Mixcloud, "loopOnEnded", true);
153
+ return Mixcloud_1;
154
+ }
155
+
156
+ var MixcloudExports = /*@__PURE__*/ requireMixcloud();
157
+ var Mixcloud = /*@__PURE__*/getDefaultExportFromCjs(MixcloudExports);
158
+
159
+ var Mixcloud$1 = /*#__PURE__*/_mergeNamespaces({
160
+ __proto__: null,
161
+ default: Mixcloud
162
+ }, [MixcloudExports]);
163
+
164
+ export { Mixcloud$1 as M };