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,176 @@
|
|
|
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 Streamable_1;
|
|
22
|
+
var hasRequiredStreamable;
|
|
23
|
+
|
|
24
|
+
function requireStreamable () {
|
|
25
|
+
if (hasRequiredStreamable) return Streamable_1;
|
|
26
|
+
hasRequiredStreamable = 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 Streamable_exports = {};
|
|
60
|
+
__export(Streamable_exports, {
|
|
61
|
+
default: () => Streamable
|
|
62
|
+
});
|
|
63
|
+
Streamable_1 = __toCommonJS(Streamable_exports);
|
|
64
|
+
var import_react = __toESM(React);
|
|
65
|
+
var import_utils = /*@__PURE__*/ index.requireUtils();
|
|
66
|
+
var import_patterns = /*@__PURE__*/ index.requirePatterns();
|
|
67
|
+
const SDK_URL = "https://cdn.embed.ly/player-0.1.0.min.js";
|
|
68
|
+
const SDK_GLOBAL = "playerjs";
|
|
69
|
+
class Streamable extends import_react.Component {
|
|
70
|
+
constructor() {
|
|
71
|
+
super(...arguments);
|
|
72
|
+
__publicField(this, "callPlayer", import_utils.callPlayer);
|
|
73
|
+
__publicField(this, "duration", null);
|
|
74
|
+
__publicField(this, "currentTime", null);
|
|
75
|
+
__publicField(this, "secondsLoaded", null);
|
|
76
|
+
__publicField(this, "mute", () => {
|
|
77
|
+
this.callPlayer("mute");
|
|
78
|
+
});
|
|
79
|
+
__publicField(this, "unmute", () => {
|
|
80
|
+
this.callPlayer("unmute");
|
|
81
|
+
});
|
|
82
|
+
__publicField(this, "ref", (iframe) => {
|
|
83
|
+
this.iframe = iframe;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
componentDidMount() {
|
|
87
|
+
this.props.onMount && this.props.onMount(this);
|
|
88
|
+
}
|
|
89
|
+
load(url) {
|
|
90
|
+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((playerjs) => {
|
|
91
|
+
if (!this.iframe)
|
|
92
|
+
return;
|
|
93
|
+
this.player = new playerjs.Player(this.iframe);
|
|
94
|
+
this.player.setLoop(this.props.loop);
|
|
95
|
+
this.player.on("ready", this.props.onReady);
|
|
96
|
+
this.player.on("play", this.props.onPlay);
|
|
97
|
+
this.player.on("pause", this.props.onPause);
|
|
98
|
+
this.player.on("seeked", this.props.onSeek);
|
|
99
|
+
this.player.on("ended", this.props.onEnded);
|
|
100
|
+
this.player.on("error", this.props.onError);
|
|
101
|
+
this.player.on("timeupdate", ({ duration, seconds }) => {
|
|
102
|
+
this.duration = duration;
|
|
103
|
+
this.currentTime = seconds;
|
|
104
|
+
});
|
|
105
|
+
this.player.on("buffered", ({ percent }) => {
|
|
106
|
+
if (this.duration) {
|
|
107
|
+
this.secondsLoaded = this.duration * percent;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
if (this.props.muted) {
|
|
111
|
+
this.player.mute();
|
|
112
|
+
}
|
|
113
|
+
}, this.props.onError);
|
|
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 * 100);
|
|
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 id = this.props.url.match(import_patterns.MATCH_URL_STREAMABLE)[1];
|
|
146
|
+
const style = {
|
|
147
|
+
width: "100%",
|
|
148
|
+
height: "100%"
|
|
149
|
+
};
|
|
150
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
151
|
+
"iframe",
|
|
152
|
+
{
|
|
153
|
+
ref: this.ref,
|
|
154
|
+
src: `https://streamable.com/o/${id}`,
|
|
155
|
+
frameBorder: "0",
|
|
156
|
+
scrolling: "no",
|
|
157
|
+
style,
|
|
158
|
+
allow: "encrypted-media; autoplay; fullscreen;"
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
__publicField(Streamable, "displayName", "Streamable");
|
|
164
|
+
__publicField(Streamable, "canPlay", import_patterns.canPlay.streamable);
|
|
165
|
+
return Streamable_1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var StreamableExports = /*@__PURE__*/ requireStreamable();
|
|
169
|
+
var Streamable = /*@__PURE__*/index.getDefaultExportFromCjs(StreamableExports);
|
|
170
|
+
|
|
171
|
+
var Streamable$1 = /*#__PURE__*/_mergeNamespaces({
|
|
172
|
+
__proto__: null,
|
|
173
|
+
default: Streamable
|
|
174
|
+
}, [StreamableExports]);
|
|
175
|
+
|
|
176
|
+
exports.Streamable = Streamable$1;
|
|
@@ -0,0 +1,174 @@
|
|
|
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 Streamable_1;
|
|
20
|
+
var hasRequiredStreamable;
|
|
21
|
+
|
|
22
|
+
function requireStreamable () {
|
|
23
|
+
if (hasRequiredStreamable) return Streamable_1;
|
|
24
|
+
hasRequiredStreamable = 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 Streamable_exports = {};
|
|
58
|
+
__export(Streamable_exports, {
|
|
59
|
+
default: () => Streamable
|
|
60
|
+
});
|
|
61
|
+
Streamable_1 = __toCommonJS(Streamable_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 Streamable 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.setLoop(this.props.loop);
|
|
93
|
+
this.player.on("ready", this.props.onReady);
|
|
94
|
+
this.player.on("play", this.props.onPlay);
|
|
95
|
+
this.player.on("pause", this.props.onPause);
|
|
96
|
+
this.player.on("seeked", this.props.onSeek);
|
|
97
|
+
this.player.on("ended", this.props.onEnded);
|
|
98
|
+
this.player.on("error", this.props.onError);
|
|
99
|
+
this.player.on("timeupdate", ({ duration, seconds }) => {
|
|
100
|
+
this.duration = duration;
|
|
101
|
+
this.currentTime = seconds;
|
|
102
|
+
});
|
|
103
|
+
this.player.on("buffered", ({ percent }) => {
|
|
104
|
+
if (this.duration) {
|
|
105
|
+
this.secondsLoaded = this.duration * percent;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
if (this.props.muted) {
|
|
109
|
+
this.player.mute();
|
|
110
|
+
}
|
|
111
|
+
}, this.props.onError);
|
|
112
|
+
}
|
|
113
|
+
play() {
|
|
114
|
+
this.callPlayer("play");
|
|
115
|
+
}
|
|
116
|
+
pause() {
|
|
117
|
+
this.callPlayer("pause");
|
|
118
|
+
}
|
|
119
|
+
stop() {
|
|
120
|
+
}
|
|
121
|
+
seekTo(seconds, keepPlaying = true) {
|
|
122
|
+
this.callPlayer("setCurrentTime", seconds);
|
|
123
|
+
if (!keepPlaying) {
|
|
124
|
+
this.pause();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
setVolume(fraction) {
|
|
128
|
+
this.callPlayer("setVolume", fraction * 100);
|
|
129
|
+
}
|
|
130
|
+
setLoop(loop) {
|
|
131
|
+
this.callPlayer("setLoop", loop);
|
|
132
|
+
}
|
|
133
|
+
getDuration() {
|
|
134
|
+
return this.duration;
|
|
135
|
+
}
|
|
136
|
+
getCurrentTime() {
|
|
137
|
+
return this.currentTime;
|
|
138
|
+
}
|
|
139
|
+
getSecondsLoaded() {
|
|
140
|
+
return this.secondsLoaded;
|
|
141
|
+
}
|
|
142
|
+
render() {
|
|
143
|
+
const id = this.props.url.match(import_patterns.MATCH_URL_STREAMABLE)[1];
|
|
144
|
+
const style = {
|
|
145
|
+
width: "100%",
|
|
146
|
+
height: "100%"
|
|
147
|
+
};
|
|
148
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
149
|
+
"iframe",
|
|
150
|
+
{
|
|
151
|
+
ref: this.ref,
|
|
152
|
+
src: `https://streamable.com/o/${id}`,
|
|
153
|
+
frameBorder: "0",
|
|
154
|
+
scrolling: "no",
|
|
155
|
+
style,
|
|
156
|
+
allow: "encrypted-media; autoplay; fullscreen;"
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
__publicField(Streamable, "displayName", "Streamable");
|
|
162
|
+
__publicField(Streamable, "canPlay", import_patterns.canPlay.streamable);
|
|
163
|
+
return Streamable_1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var StreamableExports = /*@__PURE__*/ requireStreamable();
|
|
167
|
+
var Streamable = /*@__PURE__*/getDefaultExportFromCjs(StreamableExports);
|
|
168
|
+
|
|
169
|
+
var Streamable$1 = /*#__PURE__*/_mergeNamespaces({
|
|
170
|
+
__proto__: null,
|
|
171
|
+
default: Streamable
|
|
172
|
+
}, [StreamableExports]);
|
|
173
|
+
|
|
174
|
+
export { Streamable$1 as S };
|
|
@@ -0,0 +1,168 @@
|
|
|
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 Twitch_1;
|
|
20
|
+
var hasRequiredTwitch;
|
|
21
|
+
|
|
22
|
+
function requireTwitch () {
|
|
23
|
+
if (hasRequiredTwitch) return Twitch_1;
|
|
24
|
+
hasRequiredTwitch = 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 Twitch_exports = {};
|
|
58
|
+
__export(Twitch_exports, {
|
|
59
|
+
default: () => Twitch
|
|
60
|
+
});
|
|
61
|
+
Twitch_1 = __toCommonJS(Twitch_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.twitch.tv/js/embed/v1.js";
|
|
66
|
+
const SDK_GLOBAL = "Twitch";
|
|
67
|
+
const PLAYER_ID_PREFIX = "twitch-player-";
|
|
68
|
+
class Twitch extends import_react.Component {
|
|
69
|
+
constructor() {
|
|
70
|
+
super(...arguments);
|
|
71
|
+
__publicField(this, "callPlayer", import_utils.callPlayer);
|
|
72
|
+
__publicField(this, "playerID", this.props.config.playerId || `${PLAYER_ID_PREFIX}${(0, import_utils.randomString)()}`);
|
|
73
|
+
__publicField(this, "mute", () => {
|
|
74
|
+
this.callPlayer("setMuted", true);
|
|
75
|
+
});
|
|
76
|
+
__publicField(this, "unmute", () => {
|
|
77
|
+
this.callPlayer("setMuted", false);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
componentDidMount() {
|
|
81
|
+
this.props.onMount && this.props.onMount(this);
|
|
82
|
+
}
|
|
83
|
+
load(url, isReady) {
|
|
84
|
+
const { playsinline, onError, config, controls } = this.props;
|
|
85
|
+
const isChannel = import_patterns.MATCH_URL_TWITCH_CHANNEL.test(url);
|
|
86
|
+
const id = isChannel ? url.match(import_patterns.MATCH_URL_TWITCH_CHANNEL)[1] : url.match(import_patterns.MATCH_URL_TWITCH_VIDEO)[1];
|
|
87
|
+
if (isReady) {
|
|
88
|
+
if (isChannel) {
|
|
89
|
+
this.player.setChannel(id);
|
|
90
|
+
} else {
|
|
91
|
+
this.player.setVideo("v" + id);
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Twitch2) => {
|
|
96
|
+
this.player = new Twitch2.Player(this.playerID, {
|
|
97
|
+
video: isChannel ? "" : id,
|
|
98
|
+
channel: isChannel ? id : "",
|
|
99
|
+
height: "100%",
|
|
100
|
+
width: "100%",
|
|
101
|
+
playsinline,
|
|
102
|
+
autoplay: this.props.playing,
|
|
103
|
+
muted: this.props.muted,
|
|
104
|
+
// https://github.com/CookPete/react-player/issues/733#issuecomment-549085859
|
|
105
|
+
controls: isChannel ? true : controls,
|
|
106
|
+
time: (0, import_utils.parseStartTime)(url),
|
|
107
|
+
...config.options
|
|
108
|
+
});
|
|
109
|
+
const { READY, PLAYING, PAUSE, ENDED, ONLINE, OFFLINE, SEEK } = Twitch2.Player;
|
|
110
|
+
this.player.addEventListener(READY, this.props.onReady);
|
|
111
|
+
this.player.addEventListener(PLAYING, this.props.onPlay);
|
|
112
|
+
this.player.addEventListener(PAUSE, this.props.onPause);
|
|
113
|
+
this.player.addEventListener(ENDED, this.props.onEnded);
|
|
114
|
+
this.player.addEventListener(SEEK, this.props.onSeek);
|
|
115
|
+
this.player.addEventListener(ONLINE, this.props.onLoaded);
|
|
116
|
+
this.player.addEventListener(OFFLINE, this.props.onLoaded);
|
|
117
|
+
}, onError);
|
|
118
|
+
}
|
|
119
|
+
play() {
|
|
120
|
+
this.callPlayer("play");
|
|
121
|
+
}
|
|
122
|
+
pause() {
|
|
123
|
+
this.callPlayer("pause");
|
|
124
|
+
}
|
|
125
|
+
stop() {
|
|
126
|
+
this.callPlayer("pause");
|
|
127
|
+
}
|
|
128
|
+
seekTo(seconds, keepPlaying = true) {
|
|
129
|
+
this.callPlayer("seek", seconds);
|
|
130
|
+
if (!keepPlaying) {
|
|
131
|
+
this.pause();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
setVolume(fraction) {
|
|
135
|
+
this.callPlayer("setVolume", fraction);
|
|
136
|
+
}
|
|
137
|
+
getDuration() {
|
|
138
|
+
return this.callPlayer("getDuration");
|
|
139
|
+
}
|
|
140
|
+
getCurrentTime() {
|
|
141
|
+
return this.callPlayer("getCurrentTime");
|
|
142
|
+
}
|
|
143
|
+
getSecondsLoaded() {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
const style = {
|
|
148
|
+
width: "100%",
|
|
149
|
+
height: "100%"
|
|
150
|
+
};
|
|
151
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style, id: this.playerID });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
__publicField(Twitch, "displayName", "Twitch");
|
|
155
|
+
__publicField(Twitch, "canPlay", import_patterns.canPlay.twitch);
|
|
156
|
+
__publicField(Twitch, "loopOnEnded", true);
|
|
157
|
+
return Twitch_1;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
var TwitchExports = /*@__PURE__*/ requireTwitch();
|
|
161
|
+
var Twitch = /*@__PURE__*/getDefaultExportFromCjs(TwitchExports);
|
|
162
|
+
|
|
163
|
+
var Twitch$1 = /*#__PURE__*/_mergeNamespaces({
|
|
164
|
+
__proto__: null,
|
|
165
|
+
default: Twitch
|
|
166
|
+
}, [TwitchExports]);
|
|
167
|
+
|
|
168
|
+
export { Twitch$1 as T };
|
|
@@ -0,0 +1,170 @@
|
|
|
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 Twitch_1;
|
|
22
|
+
var hasRequiredTwitch;
|
|
23
|
+
|
|
24
|
+
function requireTwitch () {
|
|
25
|
+
if (hasRequiredTwitch) return Twitch_1;
|
|
26
|
+
hasRequiredTwitch = 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 Twitch_exports = {};
|
|
60
|
+
__export(Twitch_exports, {
|
|
61
|
+
default: () => Twitch
|
|
62
|
+
});
|
|
63
|
+
Twitch_1 = __toCommonJS(Twitch_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.twitch.tv/js/embed/v1.js";
|
|
68
|
+
const SDK_GLOBAL = "Twitch";
|
|
69
|
+
const PLAYER_ID_PREFIX = "twitch-player-";
|
|
70
|
+
class Twitch 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
|
+
__publicField(this, "mute", () => {
|
|
76
|
+
this.callPlayer("setMuted", true);
|
|
77
|
+
});
|
|
78
|
+
__publicField(this, "unmute", () => {
|
|
79
|
+
this.callPlayer("setMuted", false);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
componentDidMount() {
|
|
83
|
+
this.props.onMount && this.props.onMount(this);
|
|
84
|
+
}
|
|
85
|
+
load(url, isReady) {
|
|
86
|
+
const { playsinline, onError, config, controls } = this.props;
|
|
87
|
+
const isChannel = import_patterns.MATCH_URL_TWITCH_CHANNEL.test(url);
|
|
88
|
+
const id = isChannel ? url.match(import_patterns.MATCH_URL_TWITCH_CHANNEL)[1] : url.match(import_patterns.MATCH_URL_TWITCH_VIDEO)[1];
|
|
89
|
+
if (isReady) {
|
|
90
|
+
if (isChannel) {
|
|
91
|
+
this.player.setChannel(id);
|
|
92
|
+
} else {
|
|
93
|
+
this.player.setVideo("v" + id);
|
|
94
|
+
}
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Twitch2) => {
|
|
98
|
+
this.player = new Twitch2.Player(this.playerID, {
|
|
99
|
+
video: isChannel ? "" : id,
|
|
100
|
+
channel: isChannel ? id : "",
|
|
101
|
+
height: "100%",
|
|
102
|
+
width: "100%",
|
|
103
|
+
playsinline,
|
|
104
|
+
autoplay: this.props.playing,
|
|
105
|
+
muted: this.props.muted,
|
|
106
|
+
// https://github.com/CookPete/react-player/issues/733#issuecomment-549085859
|
|
107
|
+
controls: isChannel ? true : controls,
|
|
108
|
+
time: (0, import_utils.parseStartTime)(url),
|
|
109
|
+
...config.options
|
|
110
|
+
});
|
|
111
|
+
const { READY, PLAYING, PAUSE, ENDED, ONLINE, OFFLINE, SEEK } = Twitch2.Player;
|
|
112
|
+
this.player.addEventListener(READY, this.props.onReady);
|
|
113
|
+
this.player.addEventListener(PLAYING, this.props.onPlay);
|
|
114
|
+
this.player.addEventListener(PAUSE, this.props.onPause);
|
|
115
|
+
this.player.addEventListener(ENDED, this.props.onEnded);
|
|
116
|
+
this.player.addEventListener(SEEK, this.props.onSeek);
|
|
117
|
+
this.player.addEventListener(ONLINE, this.props.onLoaded);
|
|
118
|
+
this.player.addEventListener(OFFLINE, this.props.onLoaded);
|
|
119
|
+
}, onError);
|
|
120
|
+
}
|
|
121
|
+
play() {
|
|
122
|
+
this.callPlayer("play");
|
|
123
|
+
}
|
|
124
|
+
pause() {
|
|
125
|
+
this.callPlayer("pause");
|
|
126
|
+
}
|
|
127
|
+
stop() {
|
|
128
|
+
this.callPlayer("pause");
|
|
129
|
+
}
|
|
130
|
+
seekTo(seconds, keepPlaying = true) {
|
|
131
|
+
this.callPlayer("seek", seconds);
|
|
132
|
+
if (!keepPlaying) {
|
|
133
|
+
this.pause();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
setVolume(fraction) {
|
|
137
|
+
this.callPlayer("setVolume", fraction);
|
|
138
|
+
}
|
|
139
|
+
getDuration() {
|
|
140
|
+
return this.callPlayer("getDuration");
|
|
141
|
+
}
|
|
142
|
+
getCurrentTime() {
|
|
143
|
+
return this.callPlayer("getCurrentTime");
|
|
144
|
+
}
|
|
145
|
+
getSecondsLoaded() {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
const style = {
|
|
150
|
+
width: "100%",
|
|
151
|
+
height: "100%"
|
|
152
|
+
};
|
|
153
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style, id: this.playerID });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
__publicField(Twitch, "displayName", "Twitch");
|
|
157
|
+
__publicField(Twitch, "canPlay", import_patterns.canPlay.twitch);
|
|
158
|
+
__publicField(Twitch, "loopOnEnded", true);
|
|
159
|
+
return Twitch_1;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
var TwitchExports = /*@__PURE__*/ requireTwitch();
|
|
163
|
+
var Twitch = /*@__PURE__*/index.getDefaultExportFromCjs(TwitchExports);
|
|
164
|
+
|
|
165
|
+
var Twitch$1 = /*#__PURE__*/_mergeNamespaces({
|
|
166
|
+
__proto__: null,
|
|
167
|
+
default: Twitch
|
|
168
|
+
}, [TwitchExports]);
|
|
169
|
+
|
|
170
|
+
exports.Twitch = Twitch$1;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PiPContextType } from './PiPContext.types';
|
|
3
|
+
export declare const PiPContext: React.Context<PiPContextType | undefined>;
|
|
4
|
+
interface PiPProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const PiPProvider: React.FC<PiPProviderProps>;
|
|
8
|
+
export {};
|