suada-components 1.8.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.
- package/dist/{components/DailyMotion-SZKPSpD1.js → DailyMotion-B-Q4fBEb.js} +1 -1
- package/dist/{components/DailyMotion-jrl4eEA1.esm.js → DailyMotion-BAvo3Toe.esm.js} +1 -1
- package/dist/{components/Facebook-Ha24RKIX.esm.js → Facebook-C8GOujDt.esm.js} +1 -1
- package/dist/{components/Facebook-DS0ye_bL.js → Facebook-CASik-P5.js} +1 -1
- package/dist/{components/FilePlayer-D-n083nK.esm.js → FilePlayer-BOZIvaDy.esm.js} +1 -1
- package/dist/{components/FilePlayer-B4_DDZXQ.js → FilePlayer-CQ80KWY2.js} +1 -1
- package/dist/{components/Kaltura-BlDrsjbp.esm.js → Kaltura-B12Xdl6X.esm.js} +1 -1
- package/dist/{components/Kaltura-DAMolg_c.js → Kaltura-nYc5k7UB.js} +1 -1
- package/dist/{components/Mixcloud-C1z9BVJ8.js → Mixcloud-DGQnlDAK.js} +1 -1
- package/dist/{components/Mixcloud-B5AIgf8e.esm.js → Mixcloud-JfeQIOki.esm.js} +1 -1
- package/dist/{components/Mux-f77ctQXE.esm.js → Mux-BHWzpAR-.esm.js} +1 -1
- package/dist/{components/Mux-Bgsc5vvM.js → Mux-CiKZc8gj.js} +1 -1
- package/dist/{components/Preview-DhMMn7e2.esm.js → Preview-DSovY9gr.esm.js} +1 -1
- package/dist/{components/Preview-CKXk6Axz.js → Preview-DvZKrgm5.js} +1 -1
- package/dist/{components/SoundCloud-DHLHmaaB.js → SoundCloud-Di7z3nmP.js} +1 -1
- package/dist/{components/SoundCloud-DyYFhGe5.esm.js → SoundCloud-j_R0lK8D.esm.js} +1 -1
- package/dist/{components/Streamable-BBygdIqb.esm.js → Streamable-CRhXZIKP.esm.js} +1 -1
- package/dist/{components/Streamable-BDhbB3m3.js → Streamable-CV1mgzRv.js} +1 -1
- package/dist/{components/Twitch-CAbFCb5f.esm.js → Twitch-6icfp-ZE.esm.js} +1 -1
- package/dist/{components/Twitch-ZG7WuoXD.js → Twitch-Dj66vkCD.js} +1 -1
- package/dist/{components/Vidyard-BsU5Ayr6.esm.js → Vidyard--KX47pZ0.esm.js} +1 -1
- package/dist/{components/Vidyard-CkSCnLg5.js → Vidyard-B-qmApe9.js} +1 -1
- package/dist/{components/Vimeo-4uslT7bX.esm.js → Vimeo-Ba9C6utC.esm.js} +1 -1
- package/dist/{components/Vimeo-DKpnTiZ8.js → Vimeo-DePzl7Sn.js} +1 -1
- package/dist/{components/Wistia-DKdMEz2a.js → Wistia-CXYB3Yus.js} +1 -1
- package/dist/{components/Wistia-BxvIPVO7.esm.js → Wistia-DWJcdcY2.esm.js} +1 -1
- package/dist/{components/YouTube-Cd4b1iuA.esm.js → YouTube-DdBVPxzz.esm.js} +1 -1
- package/dist/{components/YouTube-JSWV2_hs.js → YouTube-vwMoW93C.js} +1 -1
- package/dist/components/CourseCard/CourseCard.styles.d.ts +1 -1
- package/dist/components/DailyMotion-Cr_8IZRR.js +180 -0
- package/dist/components/DailyMotion-D2n1NDDi.esm.js +178 -0
- package/dist/components/Facebook-CDrTA2_L.esm.js +179 -0
- package/dist/components/Facebook-YxZce26V.js +181 -0
- package/dist/components/FilePlayer-BzkVMbQ8.esm.js +408 -0
- package/dist/components/FilePlayer-DqqTufgX.js +410 -0
- package/dist/components/Kaltura-B0UZLr6g.esm.js +176 -0
- package/dist/components/Kaltura-krSxvIBr.js +178 -0
- package/dist/components/Mixcloud-BCT5e47d.js +166 -0
- package/dist/components/Mixcloud-D9qk3D6i.esm.js +164 -0
- package/dist/components/Mux-BZleoaJh.esm.js +264 -0
- package/dist/components/Mux-D_si09u2.js +266 -0
- package/dist/components/Preview-CmduMeEZ.js +175 -0
- package/dist/components/Preview-DQLbQ8_C.esm.js +173 -0
- package/dist/components/SoundCloud-BHgTfaW7.js +183 -0
- package/dist/components/SoundCloud-BgnX8kOF.esm.js +181 -0
- package/dist/components/Streamable-DTAzjVwd.js +176 -0
- package/dist/components/Streamable-DbRbUflP.esm.js +174 -0
- package/dist/components/Twitch-CXOhay4a.esm.js +168 -0
- package/dist/components/Twitch-CnEk-l9R.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/Vidyard-Cn_LcGwi.js +174 -0
- package/dist/components/Vidyard-YcZH6kkW.esm.js +172 -0
- package/dist/components/Vimeo-BUVxWt7t.js +215 -0
- package/dist/components/Vimeo-Cv0qx3aR.esm.js +213 -0
- package/dist/components/Wistia-COWrV8QC.js +190 -0
- package/dist/components/Wistia-PneZ48dn.esm.js +188 -0
- package/dist/components/YouTube-BUyvzJQw.esm.js +258 -0
- package/dist/components/YouTube-DeQdfkWm.js +260 -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-XiB9Yp2-.js → index-Bs-XxxV4.js} +141 -14
- package/dist/components/{index-BTR541gv.esm.js → index-C4Mk2H3N.esm.js} +140 -15
- 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-Bp-idbg5.esm.js +94907 -0
- package/dist/index-CSj9NYxJ.js +95129 -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
|
@@ -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 };
|
|
@@ -0,0 +1,190 @@
|
|
|
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 Wistia_1;
|
|
22
|
+
var hasRequiredWistia;
|
|
23
|
+
|
|
24
|
+
function requireWistia () {
|
|
25
|
+
if (hasRequiredWistia) return Wistia_1;
|
|
26
|
+
hasRequiredWistia = 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 Wistia_exports = {};
|
|
60
|
+
__export(Wistia_exports, {
|
|
61
|
+
default: () => Wistia
|
|
62
|
+
});
|
|
63
|
+
Wistia_1 = __toCommonJS(Wistia_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://fast.wistia.com/assets/external/E-v1.js";
|
|
68
|
+
const SDK_GLOBAL = "Wistia";
|
|
69
|
+
const PLAYER_ID_PREFIX = "wistia-player-";
|
|
70
|
+
class Wistia extends import_react.Component {
|
|
71
|
+
constructor() {
|
|
72
|
+
super(...arguments);
|
|
73
|
+
__publicField(this, "callPlayer", import_utils.callPlayer);
|
|
74
|
+
__publicField(this, "playerID", this.props.config.playerId || `${PLAYER_ID_PREFIX}${(0, import_utils.randomString)()}`);
|
|
75
|
+
// Proxy methods to prevent listener leaks
|
|
76
|
+
__publicField(this, "onPlay", (...args) => this.props.onPlay(...args));
|
|
77
|
+
__publicField(this, "onPause", (...args) => this.props.onPause(...args));
|
|
78
|
+
__publicField(this, "onSeek", (...args) => this.props.onSeek(...args));
|
|
79
|
+
__publicField(this, "onEnded", (...args) => this.props.onEnded(...args));
|
|
80
|
+
__publicField(this, "onPlaybackRateChange", (...args) => this.props.onPlaybackRateChange(...args));
|
|
81
|
+
__publicField(this, "mute", () => {
|
|
82
|
+
this.callPlayer("mute");
|
|
83
|
+
});
|
|
84
|
+
__publicField(this, "unmute", () => {
|
|
85
|
+
this.callPlayer("unmute");
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
componentDidMount() {
|
|
89
|
+
this.props.onMount && this.props.onMount(this);
|
|
90
|
+
}
|
|
91
|
+
load(url) {
|
|
92
|
+
const { playing, muted, controls, onReady, config, onError } = this.props;
|
|
93
|
+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Wistia2) => {
|
|
94
|
+
if (config.customControls) {
|
|
95
|
+
config.customControls.forEach((control) => Wistia2.defineControl(control));
|
|
96
|
+
}
|
|
97
|
+
window._wq = window._wq || [];
|
|
98
|
+
window._wq.push({
|
|
99
|
+
id: this.playerID,
|
|
100
|
+
options: {
|
|
101
|
+
autoPlay: playing,
|
|
102
|
+
silentAutoPlay: "allow",
|
|
103
|
+
muted,
|
|
104
|
+
controlsVisibleOnLoad: controls,
|
|
105
|
+
fullscreenButton: controls,
|
|
106
|
+
playbar: controls,
|
|
107
|
+
playbackRateControl: controls,
|
|
108
|
+
qualityControl: controls,
|
|
109
|
+
volumeControl: controls,
|
|
110
|
+
settingsControl: controls,
|
|
111
|
+
smallPlayButton: controls,
|
|
112
|
+
...config.options
|
|
113
|
+
},
|
|
114
|
+
onReady: (player) => {
|
|
115
|
+
this.player = player;
|
|
116
|
+
this.unbind();
|
|
117
|
+
this.player.bind("play", this.onPlay);
|
|
118
|
+
this.player.bind("pause", this.onPause);
|
|
119
|
+
this.player.bind("seek", this.onSeek);
|
|
120
|
+
this.player.bind("end", this.onEnded);
|
|
121
|
+
this.player.bind("playbackratechange", this.onPlaybackRateChange);
|
|
122
|
+
onReady();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}, onError);
|
|
126
|
+
}
|
|
127
|
+
unbind() {
|
|
128
|
+
this.player.unbind("play", this.onPlay);
|
|
129
|
+
this.player.unbind("pause", this.onPause);
|
|
130
|
+
this.player.unbind("seek", this.onSeek);
|
|
131
|
+
this.player.unbind("end", this.onEnded);
|
|
132
|
+
this.player.unbind("playbackratechange", this.onPlaybackRateChange);
|
|
133
|
+
}
|
|
134
|
+
play() {
|
|
135
|
+
this.callPlayer("play");
|
|
136
|
+
}
|
|
137
|
+
pause() {
|
|
138
|
+
this.callPlayer("pause");
|
|
139
|
+
}
|
|
140
|
+
stop() {
|
|
141
|
+
this.unbind();
|
|
142
|
+
this.callPlayer("remove");
|
|
143
|
+
}
|
|
144
|
+
seekTo(seconds, keepPlaying = true) {
|
|
145
|
+
this.callPlayer("time", seconds);
|
|
146
|
+
if (!keepPlaying) {
|
|
147
|
+
this.pause();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
setVolume(fraction) {
|
|
151
|
+
this.callPlayer("volume", fraction);
|
|
152
|
+
}
|
|
153
|
+
setPlaybackRate(rate) {
|
|
154
|
+
this.callPlayer("playbackRate", rate);
|
|
155
|
+
}
|
|
156
|
+
getDuration() {
|
|
157
|
+
return this.callPlayer("duration");
|
|
158
|
+
}
|
|
159
|
+
getCurrentTime() {
|
|
160
|
+
return this.callPlayer("time");
|
|
161
|
+
}
|
|
162
|
+
getSecondsLoaded() {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
render() {
|
|
166
|
+
const { url } = this.props;
|
|
167
|
+
const videoID = url && url.match(import_patterns.MATCH_URL_WISTIA)[1];
|
|
168
|
+
const className = `wistia_embed wistia_async_${videoID}`;
|
|
169
|
+
const style = {
|
|
170
|
+
width: "100%",
|
|
171
|
+
height: "100%"
|
|
172
|
+
};
|
|
173
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { id: this.playerID, key: videoID, className, style });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
__publicField(Wistia, "displayName", "Wistia");
|
|
177
|
+
__publicField(Wistia, "canPlay", import_patterns.canPlay.wistia);
|
|
178
|
+
__publicField(Wistia, "loopOnEnded", true);
|
|
179
|
+
return Wistia_1;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
var WistiaExports = /*@__PURE__*/ requireWistia();
|
|
183
|
+
var Wistia = /*@__PURE__*/index.getDefaultExportFromCjs(WistiaExports);
|
|
184
|
+
|
|
185
|
+
var Wistia$1 = /*#__PURE__*/_mergeNamespaces({
|
|
186
|
+
__proto__: null,
|
|
187
|
+
default: Wistia
|
|
188
|
+
}, [WistiaExports]);
|
|
189
|
+
|
|
190
|
+
exports.Wistia = Wistia$1;
|