suada-components 1.9.0 → 1.10.0
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.
- package/dist/{components/DailyMotion-B7yDPBbg.js → DailyMotion-DacNkqsi.js} +1 -1
- package/dist/{components/DailyMotion-BmnymjR1.esm.js → DailyMotion-gaY-1HqX.esm.js} +1 -1
- package/dist/{components/Facebook-D9Ak6ZJU.esm.js → Facebook-C_tH1Bi_.esm.js} +1 -1
- package/dist/{components/Facebook-42iqQU2G.js → Facebook-D4wLMJkY.js} +1 -1
- package/dist/{components/FilePlayer-CAnHK0Cd.js → FilePlayer-B4s5OcYq.js} +1 -1
- package/dist/{components/FilePlayer-wg9lyafD.esm.js → FilePlayer-DqR2mvGK.esm.js} +1 -1
- package/dist/{components/Kaltura-DPaEN-dq.esm.js → Kaltura-C9QbmEfO.esm.js} +1 -1
- package/dist/{components/Kaltura-Ct6kwbgP.js → Kaltura-kCqUZWuf.js} +1 -1
- package/dist/{components/Mixcloud-sBbcL5rG.js → Mixcloud-2c71b3Nf.js} +1 -1
- package/dist/{components/Mixcloud-BobSN3YI.esm.js → Mixcloud-ib_DIXF1.esm.js} +1 -1
- package/dist/{components/Mux-Cosy8sFO.js → Mux-BsXgGo6C.js} +1 -1
- package/dist/{components/Mux-B9YP-rFr.esm.js → Mux-CJ6kEh1R.esm.js} +1 -1
- package/dist/{components/Preview-DiVfo6aa.js → Preview-gEkhA4mX.js} +1 -1
- package/dist/{components/Preview-XcTlhHT1.esm.js → Preview-kqr7fWet.esm.js} +1 -1
- package/dist/{components/SoundCloud-CIWqB-QW.js → SoundCloud-BWup2g--.js} +1 -1
- package/dist/{components/SoundCloud-BTHoyFWT.esm.js → SoundCloud-DJM0bsQG.esm.js} +1 -1
- package/dist/{components/Streamable-DsfQCy3p.esm.js → Streamable-CJltauTy.esm.js} +1 -1
- package/dist/{components/Streamable-9anYiQtU.js → Streamable-UeTHV2nZ.js} +1 -1
- package/dist/{components/Twitch-D1BOr8hj.esm.js → Twitch-C9qq_89Q.esm.js} +1 -1
- package/dist/{components/Twitch-Dud6e1Rv.js → Twitch-_N8mEsiS.js} +1 -1
- package/dist/{components/Vidyard-BuOu85uS.js → Vidyard-CQuxB99Z.js} +1 -1
- package/dist/{components/Vidyard-C1csjpQH.esm.js → Vidyard-gtcLQdYd.esm.js} +1 -1
- package/dist/{components/Vimeo-CHlHIswX.esm.js → Vimeo-Dzp5eoLi.esm.js} +1 -1
- package/dist/{components/Vimeo-DrDJ5O9H.js → Vimeo-nhXVoFTb.js} +1 -1
- package/dist/{components/Wistia-fh9U2CA2.js → Wistia-C1DqA9IW.js} +1 -1
- package/dist/{components/Wistia-D-eYyONb.esm.js → Wistia-DV3BO3z9.esm.js} +1 -1
- package/dist/{components/YouTube-CmnnzZvk.esm.js → YouTube-BKwvJCnt.esm.js} +1 -1
- package/dist/{components/YouTube-DC2uZ14c.js → YouTube-DDou5phH.js} +1 -1
- package/dist/components/CourseCard/CourseCard.styles.d.ts +1 -1
- package/dist/components/DailyMotion-B8IJNjSc.js +180 -0
- package/dist/components/DailyMotion-COg3zgIZ.esm.js +178 -0
- package/dist/components/Facebook-DJ7a3Bj8.js +181 -0
- package/dist/components/Facebook-NS80Vk6j.esm.js +179 -0
- package/dist/components/FilePlayer-D-fc3B0E.esm.js +408 -0
- package/dist/components/FilePlayer-SyLt5qGX.js +410 -0
- package/dist/components/Kaltura-BTFxSMxP.js +178 -0
- package/dist/components/Kaltura-CmFIWSef.esm.js +176 -0
- package/dist/components/Mixcloud-CO5MsWUJ.esm.js +164 -0
- package/dist/components/Mixcloud-DHAfVpcc.js +166 -0
- package/dist/components/Mux-C8-HithD.esm.js +264 -0
- package/dist/components/Mux-bycDxP8G.js +266 -0
- package/dist/components/Preview-Clg3y6sj.esm.js +173 -0
- package/dist/components/Preview-CzpcknZI.js +175 -0
- package/dist/components/SoundCloud-Dz9DeIIM.js +183 -0
- package/dist/components/SoundCloud-LfWEBVy1.esm.js +181 -0
- package/dist/components/Streamable-BpcVhi4M.esm.js +174 -0
- package/dist/components/Streamable-Cs_c-7jS.js +176 -0
- package/dist/components/Twitch-BJ9aSIM2.esm.js +168 -0
- package/dist/components/Twitch-C9bksXF6.js +170 -0
- package/dist/components/VideoPlayer/PiPContext.d.ts +8 -0
- package/dist/components/VideoPlayer/PiPContext.js +149 -0
- package/dist/components/VideoPlayer/PiPContext.js.map +1 -0
- package/dist/components/VideoPlayer/PiPContext.types.d.ts +16 -0
- package/dist/components/VideoPlayer/PiPContext.types.js +2 -0
- package/dist/components/VideoPlayer/PiPContext.types.js.map +1 -0
- package/dist/components/VideoPlayer/usePiP.d.ts +2 -0
- package/dist/components/VideoPlayer/usePiP.js +10 -0
- package/dist/components/VideoPlayer/usePiP.js.map +1 -0
- package/dist/components/VideoPlayer/usePlayerControls.js +46 -64
- package/dist/components/VideoPlayer/usePlayerControls.js.map +1 -1
- package/dist/components/Vidyard-CsUFSBXh.js +174 -0
- package/dist/components/Vidyard-Dc8NHJ7p.esm.js +172 -0
- package/dist/components/Vimeo-CwlScNtK.esm.js +213 -0
- package/dist/components/Vimeo-D6C93592.js +215 -0
- package/dist/components/Wistia-Bxvdn3oO.js +190 -0
- package/dist/components/Wistia-Cwl4fNWW.esm.js +188 -0
- package/dist/components/YouTube-BF85SRPF.js +260 -0
- package/dist/components/YouTube-DKkYzN7-.esm.js +258 -0
- package/dist/components/components/CourseCard/CourseCard.styles.d.ts +1 -1
- package/dist/components/components/VideoPlayer/PiPContext.d.ts +8 -0
- package/dist/components/components/VideoPlayer/PiPContext.types.d.ts +16 -0
- package/dist/components/components/VideoPlayer/usePiP.d.ts +2 -0
- package/dist/components/components/index.d.ts +2 -0
- package/dist/components/{index-DetZ05pw.js → index-C08W0lXg.js} +157 -295
- package/dist/components/{index-DKAGRUEW.esm.js → index-F6zEoSWf.esm.js} +156 -296
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/icons/components/CourseCard/CourseCard.styles.d.ts +1 -1
- package/dist/icons/components/VideoPlayer/PiPContext.d.ts +8 -0
- package/dist/icons/components/VideoPlayer/PiPContext.types.d.ts +16 -0
- package/dist/icons/components/VideoPlayer/usePiP.d.ts +2 -0
- package/dist/icons/components/index.d.ts +2 -0
- package/dist/index-CcTTuhg8.esm.js +94920 -0
- package/dist/index-Dq4qpx9F.js +95142 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +3 -3
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/VideoPlayer/pipManager.d.ts +0 -60
- package/dist/components/VideoPlayer/pipManager.js +0 -272
- package/dist/components/VideoPlayer/pipManager.js.map +0 -1
- package/dist/components/components/VideoPlayer/pipManager.d.ts +0 -60
- package/dist/icons/components/VideoPlayer/pipManager.d.ts +0 -60
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-F6zEoSWf.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 Kaltura_1;
|
|
20
|
+
var hasRequiredKaltura;
|
|
21
|
+
|
|
22
|
+
function requireKaltura () {
|
|
23
|
+
if (hasRequiredKaltura) return Kaltura_1;
|
|
24
|
+
hasRequiredKaltura = 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 Kaltura_exports = {};
|
|
58
|
+
__export(Kaltura_exports, {
|
|
59
|
+
default: () => Kaltura
|
|
60
|
+
});
|
|
61
|
+
Kaltura_1 = __toCommonJS(Kaltura_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://cdn.embed.ly/player-0.1.0.min.js";
|
|
66
|
+
const SDK_GLOBAL = "playerjs";
|
|
67
|
+
class Kaltura 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
|
+
this.callPlayer("mute");
|
|
76
|
+
});
|
|
77
|
+
__publicField(this, "unmute", () => {
|
|
78
|
+
this.callPlayer("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((playerjs) => {
|
|
89
|
+
if (!this.iframe)
|
|
90
|
+
return;
|
|
91
|
+
this.player = new playerjs.Player(this.iframe);
|
|
92
|
+
this.player.on("ready", () => {
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
this.player.isReady = true;
|
|
95
|
+
this.player.setLoop(this.props.loop);
|
|
96
|
+
if (this.props.muted) {
|
|
97
|
+
this.player.mute();
|
|
98
|
+
}
|
|
99
|
+
this.addListeners(this.player, this.props);
|
|
100
|
+
this.props.onReady();
|
|
101
|
+
}, 500);
|
|
102
|
+
});
|
|
103
|
+
}, this.props.onError);
|
|
104
|
+
}
|
|
105
|
+
addListeners(player, props) {
|
|
106
|
+
player.on("play", props.onPlay);
|
|
107
|
+
player.on("pause", props.onPause);
|
|
108
|
+
player.on("ended", props.onEnded);
|
|
109
|
+
player.on("error", props.onError);
|
|
110
|
+
player.on("timeupdate", ({ duration, seconds }) => {
|
|
111
|
+
this.duration = duration;
|
|
112
|
+
this.currentTime = seconds;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
play() {
|
|
116
|
+
this.callPlayer("play");
|
|
117
|
+
}
|
|
118
|
+
pause() {
|
|
119
|
+
this.callPlayer("pause");
|
|
120
|
+
}
|
|
121
|
+
stop() {
|
|
122
|
+
}
|
|
123
|
+
seekTo(seconds, keepPlaying = true) {
|
|
124
|
+
this.callPlayer("setCurrentTime", seconds);
|
|
125
|
+
if (!keepPlaying) {
|
|
126
|
+
this.pause();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
setVolume(fraction) {
|
|
130
|
+
this.callPlayer("setVolume", fraction);
|
|
131
|
+
}
|
|
132
|
+
setLoop(loop) {
|
|
133
|
+
this.callPlayer("setLoop", loop);
|
|
134
|
+
}
|
|
135
|
+
getDuration() {
|
|
136
|
+
return this.duration;
|
|
137
|
+
}
|
|
138
|
+
getCurrentTime() {
|
|
139
|
+
return this.currentTime;
|
|
140
|
+
}
|
|
141
|
+
getSecondsLoaded() {
|
|
142
|
+
return this.secondsLoaded;
|
|
143
|
+
}
|
|
144
|
+
render() {
|
|
145
|
+
const style = {
|
|
146
|
+
width: "100%",
|
|
147
|
+
height: "100%"
|
|
148
|
+
};
|
|
149
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
150
|
+
"iframe",
|
|
151
|
+
{
|
|
152
|
+
ref: this.ref,
|
|
153
|
+
src: this.props.url,
|
|
154
|
+
frameBorder: "0",
|
|
155
|
+
scrolling: "no",
|
|
156
|
+
style,
|
|
157
|
+
allow: "encrypted-media; autoplay; fullscreen;",
|
|
158
|
+
referrerPolicy: "no-referrer-when-downgrade"
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
__publicField(Kaltura, "displayName", "Kaltura");
|
|
164
|
+
__publicField(Kaltura, "canPlay", import_patterns.canPlay.kaltura);
|
|
165
|
+
return Kaltura_1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var KalturaExports = /*@__PURE__*/ requireKaltura();
|
|
169
|
+
var Kaltura = /*@__PURE__*/getDefaultExportFromCjs(KalturaExports);
|
|
170
|
+
|
|
171
|
+
var Kaltura$1 = /*#__PURE__*/_mergeNamespaces({
|
|
172
|
+
__proto__: null,
|
|
173
|
+
default: Kaltura
|
|
174
|
+
}, [KalturaExports]);
|
|
175
|
+
|
|
176
|
+
export { Kaltura$1 as K };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-F6zEoSWf.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 };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-C08W0lXg.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;
|