@platform-x/hcltechx-mfe-wrapper 1.0.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/BrightcovePlayer-B2Rrij5a.mjs +177 -0
- package/ChallengeDetailComponent-QSflL_pe.mjs +89 -0
- package/CommonContentComponent-D8PuLEle.mjs +78 -0
- package/DailyMotion-Pq0OS_nv.mjs +136 -0
- package/EngagementHomeComponent-CO2rSsxl.mjs +91 -0
- package/EventDetailComponent-DMKfvnfx.mjs +84 -0
- package/EventList-BM7sWeX5.mjs +22503 -0
- package/EventListComponent-SpgarpPb.mjs +82 -0
- package/Facebook-DVoDyq2n.mjs +121 -0
- package/FilePlayer-TBmUK03G.mjs +202 -0
- package/Kaltura-CLaSL9Gw.mjs +121 -0
- package/Mixcloud-BIUEG_vf.mjs +113 -0
- package/Mux-D2H0Zcnl.mjs +165 -0
- package/Preview-CqNeXEJq.mjs +127 -0
- package/RecentCarousel-DsRr-cur.mjs +243 -0
- package/Share-BTinEfR4.mjs +2243 -0
- package/SoundCloud-CL3-ElQD.mjs +123 -0
- package/Streamable-B6PCkCf3.mjs +115 -0
- package/Twitch-T-goXjKL.mjs +117 -0
- package/Vidyard-D8-XmjAR.mjs +113 -0
- package/Vimeo-jej0FY4O.mjs +146 -0
- package/Wistia-CPzm8ZXT.mjs +124 -0
- package/YouTube-VNohNZKu.mjs +176 -0
- package/index-BTIxC-e5.mjs +20 -0
- package/index-Dluh6sv-.mjs +7333 -0
- package/index.d.ts +2 -0
- package/index.mjs +10 -0
- package/lib/Components/EventDetails/EventDetailComponent.d.ts +1 -0
- package/lib/Components/EventDetails/index.d.ts +2 -0
- package/lib/Components/EventList/EventListComponent.d.ts +2 -0
- package/lib/Components/EventList/index.d.ts +2 -0
- package/lib/Components/FallBackPage/FallBackPage.d.ts +2 -0
- package/lib/Components/Loader/Loader.d.ts +2 -0
- package/lib/contentType-wrapper.d.ts +12 -0
- package/lib/contentTypes/Components/ChallengeDetailComponent.d.ts +2 -0
- package/lib/contentTypes/Components/CommonContentComponent.d.ts +4 -0
- package/lib/contentTypes/Components/EventDetailComponent.d.ts +2 -0
- package/lib/contentTypes/index.d.ts +2 -0
- package/lib/prelems/Components/EngagementHomeComponent.d.ts +2 -0
- package/lib/prelems/Components/EventListComponent.d.ts +10 -0
- package/lib/prelems/index.d.ts +2 -0
- package/lib/prelems-wrapper.d.ts +9 -0
- package/lib/services/ApiConfig.d.ts +1 -0
- package/lib/services/fetchApi.d.ts +11 -0
- package/lib/services/fetchQueries.d.ts +7 -0
- package/lib/services/mutateApi.d.ts +7 -0
- package/lib/services/mutateQueries.d.ts +4 -0
- package/lib/utils/Mapping.d.ts +7 -0
- package/lib/utils/componentMapping.d.ts +11 -0
- package/lib/utils/constants.d.ts +10 -0
- package/lib/utils/types.d.ts +32 -0
- package/mutateApi-DOEWbC_3.mjs +37 -0
- package/package.json +25 -0
- package/style.css +1 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { d as v } from "./EventList-BM7sWeX5.mjs";
|
|
3
|
+
import { useState as g, useEffect as A } from "react";
|
|
4
|
+
import { s as r, f as k, a as L } from "./index-Dluh6sv-.mjs";
|
|
5
|
+
import { m as b } from "./mutateApi-DOEWbC_3.mjs";
|
|
6
|
+
import "@mui/material";
|
|
7
|
+
import "@mui/styles";
|
|
8
|
+
import "@mui/system";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
const J = ({
|
|
11
|
+
data: p,
|
|
12
|
+
prelemAnalyticsProp: h,
|
|
13
|
+
prelemAuthoringHelper: d,
|
|
14
|
+
secondaryArgs: c,
|
|
15
|
+
userId: P,
|
|
16
|
+
filters: y,
|
|
17
|
+
relativePath: S
|
|
18
|
+
}) => {
|
|
19
|
+
const [w, D] = g({}), [E, m] = g(!1), {
|
|
20
|
+
prelemBaseEndpoint: { language: f, site_host: u }
|
|
21
|
+
} = c, n = localStorage.getItem("userId") || P, I = async (l, t, i) => {
|
|
22
|
+
var s, o;
|
|
23
|
+
if (!n) {
|
|
24
|
+
r("User ID is not available. Please log in.");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const e = {
|
|
29
|
+
input: { activity_type: i, target: l.toString(), action: t },
|
|
30
|
+
user_id: n
|
|
31
|
+
}, a = await b.setPersonalGoal(e, f, u);
|
|
32
|
+
((o = (s = a == null ? void 0 : a.data) == null ? void 0 : s.community_setPersonalGoal) == null ? void 0 : o.message) === "Created Successfully!!!" && t === "goal" ? L("Goal updated successfully!") : t !== "entry" && r("Something went wrong, please try after sometime !");
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.error("Error in update goal API:", e), r("Something went wrong, please try after sometime !");
|
|
35
|
+
}
|
|
36
|
+
}, T = async () => {
|
|
37
|
+
var l, t, i, s;
|
|
38
|
+
if (!n) {
|
|
39
|
+
r("User ID is not available. Please log in.");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
m(!0);
|
|
44
|
+
const o = {
|
|
45
|
+
date: "",
|
|
46
|
+
user_id: n
|
|
47
|
+
}, e = await k.fetchPersonalTracker(o, f, u);
|
|
48
|
+
if (((l = e == null ? void 0 : e.errors) == null ? void 0 : l.length) > 0)
|
|
49
|
+
r((t = e == null ? void 0 : e.errors[0]) == null ? void 0 : t.message);
|
|
50
|
+
else if ((i = e == null ? void 0 : e.data) != null && i.community_fetchPersonalTracker) {
|
|
51
|
+
const { steps: a } = (s = e == null ? void 0 : e.data) == null ? void 0 : s.community_fetchPersonalTracker;
|
|
52
|
+
D(a);
|
|
53
|
+
} else
|
|
54
|
+
console.error("GetPersonalData API failed");
|
|
55
|
+
} catch (o) {
|
|
56
|
+
r("Something went wrong !"), console.error("Error in GetPersonalData API:", o);
|
|
57
|
+
} finally {
|
|
58
|
+
m(!1);
|
|
59
|
+
}
|
|
60
|
+
}, G = {
|
|
61
|
+
stepsData: w,
|
|
62
|
+
loading: E,
|
|
63
|
+
updateGoals: I
|
|
64
|
+
};
|
|
65
|
+
return A(() => {
|
|
66
|
+
T();
|
|
67
|
+
}, []), /* @__PURE__ */ _(
|
|
68
|
+
v,
|
|
69
|
+
{
|
|
70
|
+
content: p,
|
|
71
|
+
analytics: h,
|
|
72
|
+
authoringHelper: d,
|
|
73
|
+
secondaryArgs: c,
|
|
74
|
+
stepsDetails: G,
|
|
75
|
+
filters: y,
|
|
76
|
+
relativePath: S
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
J as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { g as _ } from "./index-Dluh6sv-.mjs";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { u as P, p as m } from "./EventList-BM7sWeX5.mjs";
|
|
4
|
+
function v(t, e) {
|
|
5
|
+
for (var r = 0; r < e.length; r++) {
|
|
6
|
+
const o = e[r];
|
|
7
|
+
if (typeof o != "string" && !Array.isArray(o)) {
|
|
8
|
+
for (const s in o)
|
|
9
|
+
if (s !== "default" && !(s in t)) {
|
|
10
|
+
const p = Object.getOwnPropertyDescriptor(o, s);
|
|
11
|
+
p && Object.defineProperty(t, s, p.get ? p : {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: () => o[s]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
+
}
|
|
20
|
+
var O = Object.create, i = Object.defineProperty, D = Object.getOwnPropertyDescriptor, E = Object.getOwnPropertyNames, S = Object.getPrototypeOf, j = Object.prototype.hasOwnProperty, I = (t, e, r) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, k = (t, e) => {
|
|
21
|
+
for (var r in e)
|
|
22
|
+
i(t, r, { get: e[r], enumerable: !0 });
|
|
23
|
+
}, h = (t, e, r, o) => {
|
|
24
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
25
|
+
for (let s of E(e))
|
|
26
|
+
!j.call(t, s) && s !== r && i(t, s, { get: () => e[s], enumerable: !(o = D(e, s)) || o.enumerable });
|
|
27
|
+
return t;
|
|
28
|
+
}, w = (t, e, r) => (r = t != null ? O(S(t)) : {}, h(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
!t || !t.__esModule ? i(r, "default", { value: t, enumerable: !0 }) : r,
|
|
34
|
+
t
|
|
35
|
+
)), F = (t) => h(i({}, "__esModule", { value: !0 }), t), a = (t, e, r) => (I(t, typeof e != "symbol" ? e + "" : e, r), r), b = {};
|
|
36
|
+
k(b, {
|
|
37
|
+
default: () => l
|
|
38
|
+
});
|
|
39
|
+
var d = F(b), u = w(g), n = P, L = m;
|
|
40
|
+
const c = "https://connect.facebook.net/en_US/sdk.js", f = "FB", y = "fbAsyncInit", M = "facebook-player-";
|
|
41
|
+
class l extends u.Component {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments), a(this, "callPlayer", n.callPlayer), a(this, "playerID", this.props.config.playerId || `${M}${(0, n.randomString)()}`), a(this, "mute", () => {
|
|
44
|
+
this.callPlayer("mute");
|
|
45
|
+
}), a(this, "unmute", () => {
|
|
46
|
+
this.callPlayer("unmute");
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
componentDidMount() {
|
|
50
|
+
this.props.onMount && this.props.onMount(this);
|
|
51
|
+
}
|
|
52
|
+
load(e, r) {
|
|
53
|
+
if (r) {
|
|
54
|
+
(0, n.getSDK)(c, f, y).then((o) => o.XFBML.parse());
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
(0, n.getSDK)(c, f, y).then((o) => {
|
|
58
|
+
o.init({
|
|
59
|
+
appId: this.props.config.appId,
|
|
60
|
+
xfbml: !0,
|
|
61
|
+
version: this.props.config.version
|
|
62
|
+
}), o.Event.subscribe("xfbml.render", (s) => {
|
|
63
|
+
this.props.onLoaded();
|
|
64
|
+
}), o.Event.subscribe("xfbml.ready", (s) => {
|
|
65
|
+
s.type === "video" && s.id === this.playerID && (this.player = s.instance, this.player.subscribe("startedPlaying", this.props.onPlay), this.player.subscribe("paused", this.props.onPause), this.player.subscribe("finishedPlaying", this.props.onEnded), this.player.subscribe("startedBuffering", this.props.onBuffer), this.player.subscribe("finishedBuffering", this.props.onBufferEnd), this.player.subscribe("error", this.props.onError), this.props.muted ? this.callPlayer("mute") : this.callPlayer("unmute"), this.props.onReady(), document.getElementById(this.playerID).querySelector("iframe").style.visibility = "visible");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
play() {
|
|
70
|
+
this.callPlayer("play");
|
|
71
|
+
}
|
|
72
|
+
pause() {
|
|
73
|
+
this.callPlayer("pause");
|
|
74
|
+
}
|
|
75
|
+
stop() {
|
|
76
|
+
}
|
|
77
|
+
seekTo(e, r = !0) {
|
|
78
|
+
this.callPlayer("seek", e), r || this.pause();
|
|
79
|
+
}
|
|
80
|
+
setVolume(e) {
|
|
81
|
+
this.callPlayer("setVolume", e);
|
|
82
|
+
}
|
|
83
|
+
getDuration() {
|
|
84
|
+
return this.callPlayer("getDuration");
|
|
85
|
+
}
|
|
86
|
+
getCurrentTime() {
|
|
87
|
+
return this.callPlayer("getCurrentPosition");
|
|
88
|
+
}
|
|
89
|
+
getSecondsLoaded() {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
render() {
|
|
93
|
+
const { attributes: e } = this.props.config, r = {
|
|
94
|
+
width: "100%",
|
|
95
|
+
height: "100%"
|
|
96
|
+
};
|
|
97
|
+
return /* @__PURE__ */ u.default.createElement(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
style: r,
|
|
101
|
+
id: this.playerID,
|
|
102
|
+
className: "fb-video",
|
|
103
|
+
"data-href": this.props.url,
|
|
104
|
+
"data-autoplay": this.props.playing ? "true" : "false",
|
|
105
|
+
"data-allowfullscreen": "true",
|
|
106
|
+
"data-controls": this.props.controls ? "true" : "false",
|
|
107
|
+
...e
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
a(l, "displayName", "Facebook");
|
|
113
|
+
a(l, "canPlay", L.canPlay.facebook);
|
|
114
|
+
a(l, "loopOnEnded", !0);
|
|
115
|
+
const x = /* @__PURE__ */ _(d), R = /* @__PURE__ */ v({
|
|
116
|
+
__proto__: null,
|
|
117
|
+
default: x
|
|
118
|
+
}, [d]);
|
|
119
|
+
export {
|
|
120
|
+
R as F
|
|
121
|
+
};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { g as b } from "./index-Dluh6sv-.mjs";
|
|
2
|
+
import _ from "react";
|
|
3
|
+
import { u as O, p as A } from "./EventList-BM7sWeX5.mjs";
|
|
4
|
+
function R(s, e) {
|
|
5
|
+
for (var t = 0; t < e.length; t++) {
|
|
6
|
+
const i = e[t];
|
|
7
|
+
if (typeof i != "string" && !Array.isArray(i)) {
|
|
8
|
+
for (const n in i)
|
|
9
|
+
if (n !== "default" && !(n in s)) {
|
|
10
|
+
const l = Object.getOwnPropertyDescriptor(i, n);
|
|
11
|
+
l && Object.defineProperty(s, n, l.get ? l : {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: () => i[n]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(Object.defineProperty(s, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
+
}
|
|
20
|
+
var I = Object.create, u = Object.defineProperty, D = Object.getOwnPropertyDescriptor, w = Object.getOwnPropertyNames, M = Object.getPrototypeOf, k = Object.prototype.hasOwnProperty, U = (s, e, t) => e in s ? u(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, N = (s, e) => {
|
|
21
|
+
for (var t in e)
|
|
22
|
+
u(s, t, { get: e[t], enumerable: !0 });
|
|
23
|
+
}, m = (s, e, t, i) => {
|
|
24
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
25
|
+
for (let n of w(e))
|
|
26
|
+
!k.call(s, n) && n !== t && u(s, n, { get: () => e[n], enumerable: !(i = D(e, n)) || i.enumerable });
|
|
27
|
+
return s;
|
|
28
|
+
}, j = (s, e, t) => (t = s != null ? I(M(s)) : {}, m(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
!s || !s.__esModule ? u(t, "default", { value: s, enumerable: !0 }) : t,
|
|
34
|
+
s
|
|
35
|
+
)), H = (s) => m(u({}, "__esModule", { value: !0 }), s), r = (s, e, t) => (U(s, typeof e != "symbol" ? e + "" : e, t), t), E = {};
|
|
36
|
+
N(E, {
|
|
37
|
+
default: () => P
|
|
38
|
+
});
|
|
39
|
+
var g = H(E), d = j(_), a = O, c = A;
|
|
40
|
+
const y = typeof navigator < "u", F = y && navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, v = y && (/iPad|iPhone|iPod/.test(navigator.userAgent) || F) && !window.MSStream, V = y && /^((?!chrome|android).)*safari/i.test(navigator.userAgent) && !window.MSStream, T = "https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js", C = "Hls", B = "https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js", x = "dashjs", K = "https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js", G = "flvjs", X = /www\.dropbox\.com\/.+/, f = /https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/, W = "https://videodelivery.net/{id}/manifest/video.m3u8";
|
|
41
|
+
class P extends d.Component {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments), r(this, "onReady", (...e) => this.props.onReady(...e)), r(this, "onPlay", (...e) => this.props.onPlay(...e)), r(this, "onBuffer", (...e) => this.props.onBuffer(...e)), r(this, "onBufferEnd", (...e) => this.props.onBufferEnd(...e)), r(this, "onPause", (...e) => this.props.onPause(...e)), r(this, "onEnded", (...e) => this.props.onEnded(...e)), r(this, "onError", (...e) => this.props.onError(...e)), r(this, "onPlayBackRateChange", (e) => this.props.onPlaybackRateChange(e.target.playbackRate)), r(this, "onEnablePIP", (...e) => this.props.onEnablePIP(...e)), r(this, "onDisablePIP", (e) => {
|
|
44
|
+
const { onDisablePIP: t, playing: i } = this.props;
|
|
45
|
+
t(e), i && this.play();
|
|
46
|
+
}), r(this, "onPresentationModeChange", (e) => {
|
|
47
|
+
if (this.player && (0, a.supportsWebKitPresentationMode)(this.player)) {
|
|
48
|
+
const { webkitPresentationMode: t } = this.player;
|
|
49
|
+
t === "picture-in-picture" ? this.onEnablePIP(e) : t === "inline" && this.onDisablePIP(e);
|
|
50
|
+
}
|
|
51
|
+
}), r(this, "onSeek", (e) => {
|
|
52
|
+
this.props.onSeek(e.target.currentTime);
|
|
53
|
+
}), r(this, "mute", () => {
|
|
54
|
+
this.player.muted = !0;
|
|
55
|
+
}), r(this, "unmute", () => {
|
|
56
|
+
this.player.muted = !1;
|
|
57
|
+
}), r(this, "renderSourceElement", (e, t) => typeof e == "string" ? /* @__PURE__ */ d.default.createElement("source", { key: t, src: e }) : /* @__PURE__ */ d.default.createElement("source", { key: t, ...e })), r(this, "renderTrack", (e, t) => /* @__PURE__ */ d.default.createElement("track", { key: t, ...e })), r(this, "ref", (e) => {
|
|
58
|
+
this.player && (this.prevPlayer = this.player), this.player = e;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
componentDidMount() {
|
|
62
|
+
this.props.onMount && this.props.onMount(this), this.addListeners(this.player);
|
|
63
|
+
const e = this.getSource(this.props.url);
|
|
64
|
+
e && (this.player.src = e), (v || this.props.config.forceDisableHls) && this.player.load();
|
|
65
|
+
}
|
|
66
|
+
componentDidUpdate(e) {
|
|
67
|
+
this.shouldUseAudio(this.props) !== this.shouldUseAudio(e) && (this.removeListeners(this.prevPlayer, e.url), this.addListeners(this.player)), this.props.url !== e.url && !(0, a.isMediaStream)(this.props.url) && !(this.props.url instanceof Array) && (this.player.srcObject = null);
|
|
68
|
+
}
|
|
69
|
+
componentWillUnmount() {
|
|
70
|
+
this.player.removeAttribute("src"), this.removeListeners(this.player), this.hls && this.hls.destroy();
|
|
71
|
+
}
|
|
72
|
+
addListeners(e) {
|
|
73
|
+
const { url: t, playsinline: i } = this.props;
|
|
74
|
+
e.addEventListener("play", this.onPlay), e.addEventListener("waiting", this.onBuffer), e.addEventListener("playing", this.onBufferEnd), e.addEventListener("pause", this.onPause), e.addEventListener("seeked", this.onSeek), e.addEventListener("ended", this.onEnded), e.addEventListener("error", this.onError), e.addEventListener("ratechange", this.onPlayBackRateChange), e.addEventListener("enterpictureinpicture", this.onEnablePIP), e.addEventListener("leavepictureinpicture", this.onDisablePIP), e.addEventListener("webkitpresentationmodechanged", this.onPresentationModeChange), this.shouldUseHLS(t) || e.addEventListener("canplay", this.onReady), i && (e.setAttribute("playsinline", ""), e.setAttribute("webkit-playsinline", ""), e.setAttribute("x5-playsinline", ""));
|
|
75
|
+
}
|
|
76
|
+
removeListeners(e, t) {
|
|
77
|
+
e.removeEventListener("canplay", this.onReady), e.removeEventListener("play", this.onPlay), e.removeEventListener("waiting", this.onBuffer), e.removeEventListener("playing", this.onBufferEnd), e.removeEventListener("pause", this.onPause), e.removeEventListener("seeked", this.onSeek), e.removeEventListener("ended", this.onEnded), e.removeEventListener("error", this.onError), e.removeEventListener("ratechange", this.onPlayBackRateChange), e.removeEventListener("enterpictureinpicture", this.onEnablePIP), e.removeEventListener("leavepictureinpicture", this.onDisablePIP), e.removeEventListener("webkitpresentationmodechanged", this.onPresentationModeChange), this.shouldUseHLS(t) || e.removeEventListener("canplay", this.onReady);
|
|
78
|
+
}
|
|
79
|
+
shouldUseAudio(e) {
|
|
80
|
+
return e.config.forceVideo || e.config.attributes.poster ? !1 : c.AUDIO_EXTENSIONS.test(e.url) || e.config.forceAudio;
|
|
81
|
+
}
|
|
82
|
+
shouldUseHLS(e) {
|
|
83
|
+
return V && this.props.config.forceSafariHLS || this.props.config.forceHLS ? !0 : v || this.props.config.forceDisableHls ? !1 : c.HLS_EXTENSIONS.test(e) || f.test(e);
|
|
84
|
+
}
|
|
85
|
+
shouldUseDASH(e) {
|
|
86
|
+
return c.DASH_EXTENSIONS.test(e) || this.props.config.forceDASH;
|
|
87
|
+
}
|
|
88
|
+
shouldUseFLV(e) {
|
|
89
|
+
return c.FLV_EXTENSIONS.test(e) || this.props.config.forceFLV;
|
|
90
|
+
}
|
|
91
|
+
load(e) {
|
|
92
|
+
const { hlsVersion: t, hlsOptions: i, dashVersion: n, flvVersion: l } = this.props.config;
|
|
93
|
+
if (this.hls && this.hls.destroy(), this.dash && this.dash.reset(), this.shouldUseHLS(e) && (0, a.getSDK)(T.replace("VERSION", t), C).then((o) => {
|
|
94
|
+
if (this.hls = new o(i), this.hls.on(o.Events.MANIFEST_PARSED, () => {
|
|
95
|
+
this.props.onReady();
|
|
96
|
+
}), this.hls.on(o.Events.ERROR, (h, p) => {
|
|
97
|
+
this.props.onError(h, p, this.hls, o);
|
|
98
|
+
}), f.test(e)) {
|
|
99
|
+
const h = e.match(f)[1];
|
|
100
|
+
this.hls.loadSource(W.replace("{id}", h));
|
|
101
|
+
} else
|
|
102
|
+
this.hls.loadSource(e);
|
|
103
|
+
this.hls.attachMedia(this.player), this.props.onLoaded();
|
|
104
|
+
}), this.shouldUseDASH(e) && (0, a.getSDK)(B.replace("VERSION", n), x).then((o) => {
|
|
105
|
+
this.dash = o.MediaPlayer().create(), this.dash.initialize(this.player, e, this.props.playing), this.dash.on("error", this.props.onError), parseInt(n) < 3 ? this.dash.getDebug().setLogToBrowserConsole(!1) : this.dash.updateSettings({ debug: { logLevel: o.Debug.LOG_LEVEL_NONE } }), this.props.onLoaded();
|
|
106
|
+
}), this.shouldUseFLV(e) && (0, a.getSDK)(K.replace("VERSION", l), G).then((o) => {
|
|
107
|
+
this.flv = o.createPlayer({ type: "flv", url: e }), this.flv.attachMediaElement(this.player), this.flv.on(o.Events.ERROR, (h, p) => {
|
|
108
|
+
this.props.onError(h, p, this.flv, o);
|
|
109
|
+
}), this.flv.load(), this.props.onLoaded();
|
|
110
|
+
}), e instanceof Array)
|
|
111
|
+
this.player.load();
|
|
112
|
+
else if ((0, a.isMediaStream)(e))
|
|
113
|
+
try {
|
|
114
|
+
this.player.srcObject = e;
|
|
115
|
+
} catch {
|
|
116
|
+
this.player.src = window.URL.createObjectURL(e);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
play() {
|
|
120
|
+
const e = this.player.play();
|
|
121
|
+
e && e.catch(this.props.onError);
|
|
122
|
+
}
|
|
123
|
+
pause() {
|
|
124
|
+
this.player.pause();
|
|
125
|
+
}
|
|
126
|
+
stop() {
|
|
127
|
+
this.player.removeAttribute("src"), this.dash && this.dash.reset();
|
|
128
|
+
}
|
|
129
|
+
seekTo(e, t = !0) {
|
|
130
|
+
this.player.currentTime = e, t || this.pause();
|
|
131
|
+
}
|
|
132
|
+
setVolume(e) {
|
|
133
|
+
this.player.volume = e;
|
|
134
|
+
}
|
|
135
|
+
enablePIP() {
|
|
136
|
+
this.player.requestPictureInPicture && document.pictureInPictureElement !== this.player ? this.player.requestPictureInPicture() : (0, a.supportsWebKitPresentationMode)(this.player) && this.player.webkitPresentationMode !== "picture-in-picture" && this.player.webkitSetPresentationMode("picture-in-picture");
|
|
137
|
+
}
|
|
138
|
+
disablePIP() {
|
|
139
|
+
document.exitPictureInPicture && document.pictureInPictureElement === this.player ? document.exitPictureInPicture() : (0, a.supportsWebKitPresentationMode)(this.player) && this.player.webkitPresentationMode !== "inline" && this.player.webkitSetPresentationMode("inline");
|
|
140
|
+
}
|
|
141
|
+
setPlaybackRate(e) {
|
|
142
|
+
try {
|
|
143
|
+
this.player.playbackRate = e;
|
|
144
|
+
} catch (t) {
|
|
145
|
+
this.props.onError(t);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
getDuration() {
|
|
149
|
+
if (!this.player)
|
|
150
|
+
return null;
|
|
151
|
+
const { duration: e, seekable: t } = this.player;
|
|
152
|
+
return e === 1 / 0 && t.length > 0 ? t.end(t.length - 1) : e;
|
|
153
|
+
}
|
|
154
|
+
getCurrentTime() {
|
|
155
|
+
return this.player ? this.player.currentTime : null;
|
|
156
|
+
}
|
|
157
|
+
getSecondsLoaded() {
|
|
158
|
+
if (!this.player)
|
|
159
|
+
return null;
|
|
160
|
+
const { buffered: e } = this.player;
|
|
161
|
+
if (e.length === 0)
|
|
162
|
+
return 0;
|
|
163
|
+
const t = e.end(e.length - 1), i = this.getDuration();
|
|
164
|
+
return t > i ? i : t;
|
|
165
|
+
}
|
|
166
|
+
getSource(e) {
|
|
167
|
+
const t = this.shouldUseHLS(e), i = this.shouldUseDASH(e), n = this.shouldUseFLV(e);
|
|
168
|
+
if (!(e instanceof Array || (0, a.isMediaStream)(e) || t || i || n))
|
|
169
|
+
return X.test(e) ? e.replace("www.dropbox.com", "dl.dropboxusercontent.com") : e;
|
|
170
|
+
}
|
|
171
|
+
render() {
|
|
172
|
+
const { url: e, playing: t, loop: i, controls: n, muted: l, config: o, width: h, height: p } = this.props, L = this.shouldUseAudio(this.props) ? "audio" : "video", S = {
|
|
173
|
+
width: h === "auto" ? h : "100%",
|
|
174
|
+
height: p === "auto" ? p : "100%"
|
|
175
|
+
};
|
|
176
|
+
return /* @__PURE__ */ d.default.createElement(
|
|
177
|
+
L,
|
|
178
|
+
{
|
|
179
|
+
ref: this.ref,
|
|
180
|
+
src: this.getSource(e),
|
|
181
|
+
style: S,
|
|
182
|
+
preload: "auto",
|
|
183
|
+
autoPlay: t || void 0,
|
|
184
|
+
controls: n,
|
|
185
|
+
muted: l,
|
|
186
|
+
loop: i,
|
|
187
|
+
...o.attributes
|
|
188
|
+
},
|
|
189
|
+
e instanceof Array && e.map(this.renderSourceElement),
|
|
190
|
+
o.tracks.map(this.renderTrack)
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
r(P, "displayName", "FilePlayer");
|
|
195
|
+
r(P, "canPlay", c.canPlay.file);
|
|
196
|
+
const z = /* @__PURE__ */ b(g), Y = /* @__PURE__ */ R({
|
|
197
|
+
__proto__: null,
|
|
198
|
+
default: z
|
|
199
|
+
}, [g]);
|
|
200
|
+
export {
|
|
201
|
+
Y as F
|
|
202
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { g as f } from "./index-Dluh6sv-.mjs";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { u as _, p as m } from "./EventList-BM7sWeX5.mjs";
|
|
4
|
+
function P(r, e) {
|
|
5
|
+
for (var t = 0; t < e.length; t++) {
|
|
6
|
+
const o = e[t];
|
|
7
|
+
if (typeof o != "string" && !Array.isArray(o)) {
|
|
8
|
+
for (const a in o)
|
|
9
|
+
if (a !== "default" && !(a in r)) {
|
|
10
|
+
const l = Object.getOwnPropertyDescriptor(o, a);
|
|
11
|
+
l && Object.defineProperty(r, a, l.get ? l : {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: () => o[a]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
+
}
|
|
20
|
+
var g = Object.create, n = Object.defineProperty, b = Object.getOwnPropertyDescriptor, v = Object.getOwnPropertyNames, O = Object.getPrototypeOf, w = Object.prototype.hasOwnProperty, j = (r, e, t) => e in r ? n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, L = (r, e) => {
|
|
21
|
+
for (var t in e)
|
|
22
|
+
n(r, t, { get: e[t], enumerable: !0 });
|
|
23
|
+
}, c = (r, e, t, o) => {
|
|
24
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
25
|
+
for (let a of v(e))
|
|
26
|
+
!w.call(r, a) && a !== t && n(r, a, { get: () => e[a], enumerable: !(o = b(e, a)) || o.enumerable });
|
|
27
|
+
return r;
|
|
28
|
+
}, K = (r, e, t) => (t = r != null ? g(O(r)) : {}, c(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
!r || !r.__esModule ? n(t, "default", { value: r, enumerable: !0 }) : t,
|
|
34
|
+
r
|
|
35
|
+
)), D = (r) => c(n({}, "__esModule", { value: !0 }), r), s = (r, e, t) => (j(r, typeof e != "symbol" ? e + "" : e, t), t), d = {};
|
|
36
|
+
L(d, {
|
|
37
|
+
default: () => i
|
|
38
|
+
});
|
|
39
|
+
var h = D(d), u = K(y), p = _, M = m;
|
|
40
|
+
const S = "https://cdn.embed.ly/player-0.1.0.min.js", T = "playerjs";
|
|
41
|
+
class i extends u.Component {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments), s(this, "callPlayer", p.callPlayer), s(this, "duration", null), s(this, "currentTime", null), s(this, "secondsLoaded", null), s(this, "mute", () => {
|
|
44
|
+
this.callPlayer("mute");
|
|
45
|
+
}), s(this, "unmute", () => {
|
|
46
|
+
this.callPlayer("unmute");
|
|
47
|
+
}), s(this, "ref", (e) => {
|
|
48
|
+
this.iframe = e;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
componentDidMount() {
|
|
52
|
+
this.props.onMount && this.props.onMount(this);
|
|
53
|
+
}
|
|
54
|
+
load(e) {
|
|
55
|
+
(0, p.getSDK)(S, T).then((t) => {
|
|
56
|
+
this.iframe && (this.player = new t.Player(this.iframe), this.player.on("ready", () => {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
this.player.isReady = !0, this.player.setLoop(this.props.loop), this.props.muted && this.player.mute(), this.addListeners(this.player, this.props), this.props.onReady();
|
|
59
|
+
}, 500);
|
|
60
|
+
}));
|
|
61
|
+
}, this.props.onError);
|
|
62
|
+
}
|
|
63
|
+
addListeners(e, t) {
|
|
64
|
+
e.on("play", t.onPlay), e.on("pause", t.onPause), e.on("ended", t.onEnded), e.on("error", t.onError), e.on("timeupdate", ({ duration: o, seconds: a }) => {
|
|
65
|
+
this.duration = o, this.currentTime = a;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
play() {
|
|
69
|
+
this.callPlayer("play");
|
|
70
|
+
}
|
|
71
|
+
pause() {
|
|
72
|
+
this.callPlayer("pause");
|
|
73
|
+
}
|
|
74
|
+
stop() {
|
|
75
|
+
}
|
|
76
|
+
seekTo(e, t = !0) {
|
|
77
|
+
this.callPlayer("setCurrentTime", e), t || this.pause();
|
|
78
|
+
}
|
|
79
|
+
setVolume(e) {
|
|
80
|
+
this.callPlayer("setVolume", e);
|
|
81
|
+
}
|
|
82
|
+
setLoop(e) {
|
|
83
|
+
this.callPlayer("setLoop", e);
|
|
84
|
+
}
|
|
85
|
+
getDuration() {
|
|
86
|
+
return this.duration;
|
|
87
|
+
}
|
|
88
|
+
getCurrentTime() {
|
|
89
|
+
return this.currentTime;
|
|
90
|
+
}
|
|
91
|
+
getSecondsLoaded() {
|
|
92
|
+
return this.secondsLoaded;
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
const e = {
|
|
96
|
+
width: "100%",
|
|
97
|
+
height: "100%"
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ u.default.createElement(
|
|
100
|
+
"iframe",
|
|
101
|
+
{
|
|
102
|
+
ref: this.ref,
|
|
103
|
+
src: this.props.url,
|
|
104
|
+
frameBorder: "0",
|
|
105
|
+
scrolling: "no",
|
|
106
|
+
style: e,
|
|
107
|
+
allow: "encrypted-media; autoplay; fullscreen;",
|
|
108
|
+
referrerPolicy: "no-referrer-when-downgrade"
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
s(i, "displayName", "Kaltura");
|
|
114
|
+
s(i, "canPlay", M.canPlay.kaltura);
|
|
115
|
+
const E = /* @__PURE__ */ f(h), R = /* @__PURE__ */ P({
|
|
116
|
+
__proto__: null,
|
|
117
|
+
default: E
|
|
118
|
+
}, [h]);
|
|
119
|
+
export {
|
|
120
|
+
R as K
|
|
121
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { g as f } from "./index-Dluh6sv-.mjs";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { u as m, p as g } from "./EventList-BM7sWeX5.mjs";
|
|
4
|
+
function v(t, e) {
|
|
5
|
+
for (var r = 0; r < e.length; r++) {
|
|
6
|
+
const s = e[r];
|
|
7
|
+
if (typeof s != "string" && !Array.isArray(s)) {
|
|
8
|
+
for (const o in s)
|
|
9
|
+
if (o !== "default" && !(o in t)) {
|
|
10
|
+
const n = Object.getOwnPropertyDescriptor(s, o);
|
|
11
|
+
n && Object.defineProperty(t, o, n.get ? n : {
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
get: () => s[o]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
+
}
|
|
20
|
+
var P = Object.create, i = Object.defineProperty, O = Object.getOwnPropertyDescriptor, b = Object.getOwnPropertyNames, M = Object.getPrototypeOf, w = Object.prototype.hasOwnProperty, x = (t, e, r) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, j = (t, e) => {
|
|
21
|
+
for (var r in e)
|
|
22
|
+
i(t, r, { get: e[r], enumerable: !0 });
|
|
23
|
+
}, c = (t, e, r, s) => {
|
|
24
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
25
|
+
for (let o of b(e))
|
|
26
|
+
!w.call(t, o) && o !== r && i(t, o, { get: () => e[o], enumerable: !(s = O(e, o)) || s.enumerable });
|
|
27
|
+
return t;
|
|
28
|
+
}, D = (t, e, r) => (r = t != null ? P(M(t)) : {}, c(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
!t || !t.__esModule ? i(r, "default", { value: t, enumerable: !0 }) : r,
|
|
34
|
+
t
|
|
35
|
+
)), S = (t) => c(i({}, "__esModule", { value: !0 }), t), a = (t, e, r) => (x(t, typeof e != "symbol" ? e + "" : e, r), r), d = {};
|
|
36
|
+
j(d, {
|
|
37
|
+
default: () => l
|
|
38
|
+
});
|
|
39
|
+
var h = S(d), p = D(y), u = m, _ = g;
|
|
40
|
+
const L = "https://widget.mixcloud.com/media/js/widgetApi.js", T = "Mixcloud";
|
|
41
|
+
class l extends p.Component {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments), a(this, "callPlayer", u.callPlayer), a(this, "duration", null), a(this, "currentTime", null), a(this, "secondsLoaded", null), a(this, "mute", () => {
|
|
44
|
+
}), a(this, "unmute", () => {
|
|
45
|
+
}), a(this, "ref", (e) => {
|
|
46
|
+
this.iframe = e;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
componentDidMount() {
|
|
50
|
+
this.props.onMount && this.props.onMount(this);
|
|
51
|
+
}
|
|
52
|
+
load(e) {
|
|
53
|
+
(0, u.getSDK)(L, T).then((r) => {
|
|
54
|
+
this.player = r.PlayerWidget(this.iframe), this.player.ready.then(() => {
|
|
55
|
+
this.player.events.play.on(this.props.onPlay), this.player.events.pause.on(this.props.onPause), this.player.events.ended.on(this.props.onEnded), this.player.events.error.on(this.props.error), this.player.events.progress.on((s, o) => {
|
|
56
|
+
this.currentTime = s, this.duration = o;
|
|
57
|
+
}), this.props.onReady();
|
|
58
|
+
});
|
|
59
|
+
}, this.props.onError);
|
|
60
|
+
}
|
|
61
|
+
play() {
|
|
62
|
+
this.callPlayer("play");
|
|
63
|
+
}
|
|
64
|
+
pause() {
|
|
65
|
+
this.callPlayer("pause");
|
|
66
|
+
}
|
|
67
|
+
stop() {
|
|
68
|
+
}
|
|
69
|
+
seekTo(e, r = !0) {
|
|
70
|
+
this.callPlayer("seek", e), r || this.pause();
|
|
71
|
+
}
|
|
72
|
+
setVolume(e) {
|
|
73
|
+
}
|
|
74
|
+
getDuration() {
|
|
75
|
+
return this.duration;
|
|
76
|
+
}
|
|
77
|
+
getCurrentTime() {
|
|
78
|
+
return this.currentTime;
|
|
79
|
+
}
|
|
80
|
+
getSecondsLoaded() {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
const { url: e, config: r } = this.props, s = e.match(_.MATCH_URL_MIXCLOUD)[1], o = {
|
|
85
|
+
width: "100%",
|
|
86
|
+
height: "100%"
|
|
87
|
+
}, n = (0, u.queryString)({
|
|
88
|
+
...r.options,
|
|
89
|
+
feed: `/${s}/`
|
|
90
|
+
});
|
|
91
|
+
return /* @__PURE__ */ p.default.createElement(
|
|
92
|
+
"iframe",
|
|
93
|
+
{
|
|
94
|
+
key: s,
|
|
95
|
+
ref: this.ref,
|
|
96
|
+
style: o,
|
|
97
|
+
src: `https://www.mixcloud.com/widget/iframe/?${n}`,
|
|
98
|
+
frameBorder: "0",
|
|
99
|
+
allow: "autoplay"
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
a(l, "displayName", "Mixcloud");
|
|
105
|
+
a(l, "canPlay", _.canPlay.mixcloud);
|
|
106
|
+
a(l, "loopOnEnded", !0);
|
|
107
|
+
const C = /* @__PURE__ */ f(h), R = /* @__PURE__ */ v({
|
|
108
|
+
__proto__: null,
|
|
109
|
+
default: C
|
|
110
|
+
}, [h]);
|
|
111
|
+
export {
|
|
112
|
+
R as M
|
|
113
|
+
};
|