suada-components 1.0.2504170948 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BreadCrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Button/Button.interface.d.ts +1 -0
- package/dist/components/DailyMotion-B2EpqlJO.esm.js +178 -0
- package/dist/components/DailyMotion-BYA5rhY5.js +180 -0
- package/dist/components/Facebook-DBxSErS8.esm.js +179 -0
- package/dist/components/Facebook-DJMdBwGM.js +181 -0
- package/dist/components/FilePlayer-DLiC_Doh.esm.js +408 -0
- package/dist/components/FilePlayer-DRqq2T-L.js +410 -0
- package/dist/components/Kaltura-BAvKhQp8.esm.js +176 -0
- package/dist/components/Kaltura-DFK3UxTc.js +178 -0
- package/dist/components/Mixcloud-C0S4Txcb.esm.js +164 -0
- package/dist/components/Mixcloud-CnG6kbdi.js +166 -0
- package/dist/components/Mux-BCS9rYAf.esm.js +264 -0
- package/dist/components/Mux-ChXwYRDL.js +266 -0
- package/dist/components/Preview-CPdzmWpt.js +175 -0
- package/dist/components/Preview-MgDcO7wW.esm.js +173 -0
- package/dist/components/SoundCloud-BxxMgfs2.esm.js +181 -0
- package/dist/components/SoundCloud-CcFGRoSv.js +183 -0
- package/dist/components/Streamable-BIBOfZ0w.js +176 -0
- package/dist/components/Streamable-Drn6K8AN.esm.js +174 -0
- package/dist/components/Twitch-CGC2HQMj.esm.js +168 -0
- package/dist/components/Twitch-DoUQRPQR.js +170 -0
- package/dist/components/VideoPlayer/Controls/Controls.d.ts +4 -0
- package/dist/components/VideoPlayer/Controls/Controls.interface.d.ts +32 -0
- package/dist/components/VideoPlayer/Controls/Controls.interface.js +2 -0
- package/dist/components/VideoPlayer/Controls/Controls.interface.js.map +1 -0
- package/dist/components/VideoPlayer/Controls/Controls.js +36 -0
- package/dist/components/VideoPlayer/Controls/Controls.js.map +1 -0
- package/dist/components/VideoPlayer/Controls/Controls.styles.d.ts +16 -0
- package/dist/components/VideoPlayer/Controls/Controls.styles.js +25 -0
- package/dist/components/VideoPlayer/Controls/Controls.styles.js.map +1 -0
- package/dist/components/VideoPlayer/Controls/index.d.ts +1 -0
- package/dist/components/VideoPlayer/Controls/index.js +2 -0
- package/dist/components/VideoPlayer/Controls/index.js.map +1 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.d.ts +4 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.interface.d.ts +18 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.interface.js +2 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.interface.js.map +1 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.js +20 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.js.map +1 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.styles.d.ts +4 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.styles.js +18 -0
- package/dist/components/VideoPlayer/PlaybackSpeedMenu.styles.js.map +1 -0
- package/dist/components/VideoPlayer/Player.d.ts +3 -11
- package/dist/components/VideoPlayer/Player.interface.d.ts +63 -0
- package/dist/components/VideoPlayer/Player.interface.js +2 -0
- package/dist/components/VideoPlayer/Player.interface.js.map +1 -0
- package/dist/components/VideoPlayer/Player.js +82 -97
- package/dist/components/VideoPlayer/Player.js.map +1 -1
- package/dist/components/VideoPlayer/Player.styles.d.ts +8 -0
- package/dist/components/VideoPlayer/Player.styles.js +17 -0
- package/dist/components/VideoPlayer/Player.styles.js.map +1 -0
- package/dist/components/VideoPlayer/VideoPlayer.stories.d.ts +10 -26
- package/dist/components/VideoPlayer/VideoPlayer.stories.js +174 -19
- package/dist/components/VideoPlayer/VideoPlayer.stories.js.map +1 -1
- package/dist/components/VideoPlayer/constants/index.d.ts +2 -0
- package/dist/components/VideoPlayer/constants/index.js +31 -0
- package/dist/components/VideoPlayer/constants/index.js.map +1 -0
- package/dist/components/VideoPlayer/parseVtt.d.ts +6 -0
- package/dist/components/VideoPlayer/parseVtt.js +35 -0
- package/dist/components/VideoPlayer/parseVtt.js.map +1 -0
- package/dist/components/VideoPlayer/timeConversion.d.ts +5 -0
- package/dist/components/VideoPlayer/timeConversion.js +70 -0
- package/dist/components/VideoPlayer/timeConversion.js.map +1 -0
- package/dist/components/VideoPlayer/useDynamicPosition.d.ts +16 -0
- package/dist/components/VideoPlayer/useDynamicPosition.js +50 -0
- package/dist/components/VideoPlayer/useDynamicPosition.js.map +1 -0
- package/dist/components/VideoPlayer/useEventListener.d.ts +3 -0
- package/dist/components/VideoPlayer/useEventListener.js +27 -0
- package/dist/components/VideoPlayer/useEventListener.js.map +1 -0
- package/dist/components/VideoPlayer/useMenuToggle.d.ts +22 -0
- package/dist/components/VideoPlayer/useMenuToggle.js +25 -0
- package/dist/components/VideoPlayer/useMenuToggle.js.map +1 -0
- package/dist/components/VideoPlayer/useOnOutsideClick.d.ts +3 -0
- package/dist/components/VideoPlayer/useOnOutsideClick.js +16 -0
- package/dist/components/VideoPlayer/useOnOutsideClick.js.map +1 -0
- package/dist/components/VideoPlayer/usePlayerControls.d.ts +3 -0
- package/dist/components/VideoPlayer/usePlayerControls.js +330 -0
- package/dist/components/VideoPlayer/usePlayerControls.js.map +1 -0
- package/dist/components/Vidyard-B-jW75yA.esm.js +172 -0
- package/dist/components/Vidyard-If2H-ayj.js +174 -0
- package/dist/components/Vimeo-Cvg3rB5o.esm.js +213 -0
- package/dist/components/Vimeo-hI3cddOi.js +215 -0
- package/dist/components/Wistia-BtYIM6Uo.esm.js +188 -0
- package/dist/components/Wistia-CZwfIsgx.js +190 -0
- package/dist/components/YouTube-D1u9T9FZ.js +260 -0
- package/dist/components/YouTube-vwMwhQ13.esm.js +258 -0
- package/dist/components/components/Button/Button.interface.d.ts +1 -0
- package/dist/components/components/VideoPlayer/Controls/Controls.d.ts +4 -0
- package/dist/components/components/VideoPlayer/Controls/Controls.interface.d.ts +32 -0
- package/dist/components/components/VideoPlayer/Controls/Controls.styles.d.ts +16 -0
- package/dist/components/components/VideoPlayer/Controls/index.d.ts +1 -0
- package/dist/components/components/VideoPlayer/PlaybackSpeedMenu.d.ts +4 -0
- package/dist/components/components/VideoPlayer/PlaybackSpeedMenu.interface.d.ts +18 -0
- package/dist/components/components/VideoPlayer/PlaybackSpeedMenu.styles.d.ts +4 -0
- package/dist/components/components/VideoPlayer/Player.d.ts +3 -11
- package/dist/components/components/VideoPlayer/Player.interface.d.ts +63 -0
- package/dist/components/components/VideoPlayer/Player.styles.d.ts +8 -0
- package/dist/components/components/VideoPlayer/constants/index.d.ts +2 -0
- package/dist/components/components/VideoPlayer/parseVtt.d.ts +6 -0
- package/dist/components/components/VideoPlayer/timeConversion.d.ts +5 -0
- package/dist/components/components/VideoPlayer/useDynamicPosition.d.ts +16 -0
- package/dist/components/components/VideoPlayer/useEventListener.d.ts +3 -0
- package/dist/components/components/VideoPlayer/useMenuToggle.d.ts +22 -0
- package/dist/components/components/VideoPlayer/useOnOutsideClick.d.ts +3 -0
- package/dist/components/components/VideoPlayer/usePlayerControls.d.ts +3 -0
- package/dist/components/icons/Heart.d.ts +7 -0
- package/dist/components/icons/Maximize.d.ts +3 -0
- package/dist/components/icons/Meter.d.ts +3 -0
- package/dist/components/icons/Minimize.d.ts +3 -0
- package/dist/components/icons/Pause.d.ts +3 -0
- package/dist/components/icons/Play.d.ts +3 -0
- package/dist/components/icons/Rewind.d.ts +7 -0
- package/dist/components/icons/Skip.d.ts +8 -0
- package/dist/components/icons/Subtitles.d.ts +7 -0
- package/dist/components/icons/VideoCheckmark.d.ts +3 -0
- package/dist/components/icons/VolumeMute.d.ts +8 -0
- package/dist/components/icons/VolumeUp.d.ts +8 -0
- package/dist/components/icons/index.d.ts +11 -0
- package/dist/components/index-DLzCbCHu.esm.js +94482 -0
- package/dist/components/index-wLnkslO9.js +94536 -0
- package/dist/components/index.esm.js +3 -122501
- package/dist/icons/Heart.d.ts +7 -0
- package/dist/icons/Heart.js +28 -0
- package/dist/icons/Heart.js.map +1 -0
- package/dist/icons/Maximize.d.ts +3 -0
- package/dist/icons/Maximize.js +28 -0
- package/dist/icons/Maximize.js.map +1 -0
- package/dist/icons/Meter.d.ts +3 -0
- package/dist/icons/Meter.js +28 -0
- package/dist/icons/Meter.js.map +1 -0
- package/dist/icons/Minimize.d.ts +3 -0
- package/dist/icons/Minimize.js +28 -0
- package/dist/icons/Minimize.js.map +1 -0
- package/dist/icons/Pause.d.ts +3 -0
- package/dist/icons/Pause.js +28 -0
- package/dist/icons/Pause.js.map +1 -0
- package/dist/icons/Play.d.ts +3 -0
- package/dist/icons/Play.js +28 -0
- package/dist/icons/Play.js.map +1 -0
- package/dist/icons/Rewind.d.ts +7 -0
- package/dist/icons/Rewind.js +28 -0
- package/dist/icons/Rewind.js.map +1 -0
- package/dist/icons/Skip.d.ts +8 -0
- package/dist/icons/Skip.js +28 -0
- package/dist/icons/Skip.js.map +1 -0
- package/dist/icons/Subtitles.d.ts +7 -0
- package/dist/icons/Subtitles.js +28 -0
- package/dist/icons/Subtitles.js.map +1 -0
- package/dist/icons/VideoCheckmark.d.ts +3 -0
- package/dist/icons/VideoCheckmark.js +28 -0
- package/dist/icons/VideoCheckmark.js.map +1 -0
- package/dist/icons/VolumeMute.d.ts +8 -0
- package/dist/icons/VolumeMute.js +28 -0
- package/dist/icons/VolumeMute.js.map +1 -0
- package/dist/icons/VolumeUp.d.ts +8 -0
- package/dist/icons/VolumeUp.js +28 -0
- package/dist/icons/VolumeUp.js.map +1 -0
- package/dist/icons/components/Button/Button.interface.d.ts +1 -0
- package/dist/icons/components/VideoPlayer/Controls/Controls.d.ts +4 -0
- package/dist/icons/components/VideoPlayer/Controls/Controls.interface.d.ts +32 -0
- package/dist/icons/components/VideoPlayer/Controls/Controls.styles.d.ts +16 -0
- package/dist/icons/components/VideoPlayer/Controls/index.d.ts +1 -0
- package/dist/icons/components/VideoPlayer/PlaybackSpeedMenu.d.ts +4 -0
- package/dist/icons/components/VideoPlayer/PlaybackSpeedMenu.interface.d.ts +18 -0
- package/dist/icons/components/VideoPlayer/PlaybackSpeedMenu.styles.d.ts +4 -0
- package/dist/icons/components/VideoPlayer/Player.d.ts +3 -11
- package/dist/icons/components/VideoPlayer/Player.interface.d.ts +63 -0
- package/dist/icons/components/VideoPlayer/Player.styles.d.ts +8 -0
- package/dist/icons/components/VideoPlayer/constants/index.d.ts +2 -0
- package/dist/icons/components/VideoPlayer/parseVtt.d.ts +6 -0
- package/dist/icons/components/VideoPlayer/timeConversion.d.ts +5 -0
- package/dist/icons/components/VideoPlayer/useDynamicPosition.d.ts +16 -0
- package/dist/icons/components/VideoPlayer/useEventListener.d.ts +3 -0
- package/dist/icons/components/VideoPlayer/useMenuToggle.d.ts +22 -0
- package/dist/icons/components/VideoPlayer/useOnOutsideClick.d.ts +3 -0
- package/dist/icons/components/VideoPlayer/usePlayerControls.d.ts +3 -0
- package/dist/icons/icons/Heart.d.ts +7 -0
- package/dist/icons/icons/Maximize.d.ts +3 -0
- package/dist/icons/icons/Meter.d.ts +3 -0
- package/dist/icons/icons/Minimize.d.ts +3 -0
- package/dist/icons/icons/Pause.d.ts +3 -0
- package/dist/icons/icons/Play.d.ts +3 -0
- package/dist/icons/icons/Rewind.d.ts +7 -0
- package/dist/icons/icons/Skip.d.ts +8 -0
- package/dist/icons/icons/Subtitles.d.ts +7 -0
- package/dist/icons/icons/VideoCheckmark.d.ts +3 -0
- package/dist/icons/icons/VolumeMute.d.ts +8 -0
- package/dist/icons/icons/VolumeUp.d.ts +8 -0
- package/dist/icons/icons/index.d.ts +11 -0
- package/dist/icons/index.d.ts +11 -0
- package/dist/icons/index.esm.js +308 -1
- package/dist/icons/index.js +11 -0
- package/dist/icons/index.js.map +1 -1
- package/package.json +3 -1
- package/dist/components/VideoPlayer/styled-components.d.ts +0 -9
- package/dist/components/VideoPlayer/styled-components.js +0 -19
- package/dist/components/VideoPlayer/styled-components.js.map +0 -1
- package/dist/components/components/VideoPlayer/styled-components.d.ts +0 -9
- package/dist/icons/components/VideoPlayer/styled-components.d.ts +0 -9
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { r as requireUtils, a as requirePatterns, g as getDefaultExportFromCjs } from './index-DLzCbCHu.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 Wistia_1;
|
|
20
|
+
var hasRequiredWistia;
|
|
21
|
+
|
|
22
|
+
function requireWistia () {
|
|
23
|
+
if (hasRequiredWistia) return Wistia_1;
|
|
24
|
+
hasRequiredWistia = 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 Wistia_exports = {};
|
|
58
|
+
__export(Wistia_exports, {
|
|
59
|
+
default: () => Wistia
|
|
60
|
+
});
|
|
61
|
+
Wistia_1 = __toCommonJS(Wistia_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://fast.wistia.com/assets/external/E-v1.js";
|
|
66
|
+
const SDK_GLOBAL = "Wistia";
|
|
67
|
+
const PLAYER_ID_PREFIX = "wistia-player-";
|
|
68
|
+
class Wistia 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
|
+
// Proxy methods to prevent listener leaks
|
|
74
|
+
__publicField(this, "onPlay", (...args) => this.props.onPlay(...args));
|
|
75
|
+
__publicField(this, "onPause", (...args) => this.props.onPause(...args));
|
|
76
|
+
__publicField(this, "onSeek", (...args) => this.props.onSeek(...args));
|
|
77
|
+
__publicField(this, "onEnded", (...args) => this.props.onEnded(...args));
|
|
78
|
+
__publicField(this, "onPlaybackRateChange", (...args) => this.props.onPlaybackRateChange(...args));
|
|
79
|
+
__publicField(this, "mute", () => {
|
|
80
|
+
this.callPlayer("mute");
|
|
81
|
+
});
|
|
82
|
+
__publicField(this, "unmute", () => {
|
|
83
|
+
this.callPlayer("unmute");
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
componentDidMount() {
|
|
87
|
+
this.props.onMount && this.props.onMount(this);
|
|
88
|
+
}
|
|
89
|
+
load(url) {
|
|
90
|
+
const { playing, muted, controls, onReady, config, onError } = this.props;
|
|
91
|
+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Wistia2) => {
|
|
92
|
+
if (config.customControls) {
|
|
93
|
+
config.customControls.forEach((control) => Wistia2.defineControl(control));
|
|
94
|
+
}
|
|
95
|
+
window._wq = window._wq || [];
|
|
96
|
+
window._wq.push({
|
|
97
|
+
id: this.playerID,
|
|
98
|
+
options: {
|
|
99
|
+
autoPlay: playing,
|
|
100
|
+
silentAutoPlay: "allow",
|
|
101
|
+
muted,
|
|
102
|
+
controlsVisibleOnLoad: controls,
|
|
103
|
+
fullscreenButton: controls,
|
|
104
|
+
playbar: controls,
|
|
105
|
+
playbackRateControl: controls,
|
|
106
|
+
qualityControl: controls,
|
|
107
|
+
volumeControl: controls,
|
|
108
|
+
settingsControl: controls,
|
|
109
|
+
smallPlayButton: controls,
|
|
110
|
+
...config.options
|
|
111
|
+
},
|
|
112
|
+
onReady: (player) => {
|
|
113
|
+
this.player = player;
|
|
114
|
+
this.unbind();
|
|
115
|
+
this.player.bind("play", this.onPlay);
|
|
116
|
+
this.player.bind("pause", this.onPause);
|
|
117
|
+
this.player.bind("seek", this.onSeek);
|
|
118
|
+
this.player.bind("end", this.onEnded);
|
|
119
|
+
this.player.bind("playbackratechange", this.onPlaybackRateChange);
|
|
120
|
+
onReady();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}, onError);
|
|
124
|
+
}
|
|
125
|
+
unbind() {
|
|
126
|
+
this.player.unbind("play", this.onPlay);
|
|
127
|
+
this.player.unbind("pause", this.onPause);
|
|
128
|
+
this.player.unbind("seek", this.onSeek);
|
|
129
|
+
this.player.unbind("end", this.onEnded);
|
|
130
|
+
this.player.unbind("playbackratechange", this.onPlaybackRateChange);
|
|
131
|
+
}
|
|
132
|
+
play() {
|
|
133
|
+
this.callPlayer("play");
|
|
134
|
+
}
|
|
135
|
+
pause() {
|
|
136
|
+
this.callPlayer("pause");
|
|
137
|
+
}
|
|
138
|
+
stop() {
|
|
139
|
+
this.unbind();
|
|
140
|
+
this.callPlayer("remove");
|
|
141
|
+
}
|
|
142
|
+
seekTo(seconds, keepPlaying = true) {
|
|
143
|
+
this.callPlayer("time", seconds);
|
|
144
|
+
if (!keepPlaying) {
|
|
145
|
+
this.pause();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
setVolume(fraction) {
|
|
149
|
+
this.callPlayer("volume", fraction);
|
|
150
|
+
}
|
|
151
|
+
setPlaybackRate(rate) {
|
|
152
|
+
this.callPlayer("playbackRate", rate);
|
|
153
|
+
}
|
|
154
|
+
getDuration() {
|
|
155
|
+
return this.callPlayer("duration");
|
|
156
|
+
}
|
|
157
|
+
getCurrentTime() {
|
|
158
|
+
return this.callPlayer("time");
|
|
159
|
+
}
|
|
160
|
+
getSecondsLoaded() {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
const { url } = this.props;
|
|
165
|
+
const videoID = url && url.match(import_patterns.MATCH_URL_WISTIA)[1];
|
|
166
|
+
const className = `wistia_embed wistia_async_${videoID}`;
|
|
167
|
+
const style = {
|
|
168
|
+
width: "100%",
|
|
169
|
+
height: "100%"
|
|
170
|
+
};
|
|
171
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { id: this.playerID, key: videoID, className, style });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
__publicField(Wistia, "displayName", "Wistia");
|
|
175
|
+
__publicField(Wistia, "canPlay", import_patterns.canPlay.wistia);
|
|
176
|
+
__publicField(Wistia, "loopOnEnded", true);
|
|
177
|
+
return Wistia_1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
var WistiaExports = /*@__PURE__*/ requireWistia();
|
|
181
|
+
var Wistia = /*@__PURE__*/getDefaultExportFromCjs(WistiaExports);
|
|
182
|
+
|
|
183
|
+
var Wistia$1 = /*#__PURE__*/_mergeNamespaces({
|
|
184
|
+
__proto__: null,
|
|
185
|
+
default: Wistia
|
|
186
|
+
}, [WistiaExports]);
|
|
187
|
+
|
|
188
|
+
export { Wistia$1 as W };
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-wLnkslO9.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;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-wLnkslO9.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 YouTube_1;
|
|
22
|
+
var hasRequiredYouTube;
|
|
23
|
+
|
|
24
|
+
function requireYouTube () {
|
|
25
|
+
if (hasRequiredYouTube) return YouTube_1;
|
|
26
|
+
hasRequiredYouTube = 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 YouTube_exports = {};
|
|
60
|
+
__export(YouTube_exports, {
|
|
61
|
+
default: () => YouTube
|
|
62
|
+
});
|
|
63
|
+
YouTube_1 = __toCommonJS(YouTube_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://www.youtube.com/iframe_api";
|
|
68
|
+
const SDK_GLOBAL = "YT";
|
|
69
|
+
const SDK_GLOBAL_READY = "onYouTubeIframeAPIReady";
|
|
70
|
+
const MATCH_PLAYLIST = /[?&](?:list|channel)=([a-zA-Z0-9_-]+)/;
|
|
71
|
+
const MATCH_USER_UPLOADS = /user\/([a-zA-Z0-9_-]+)\/?/;
|
|
72
|
+
const MATCH_NOCOOKIE = /youtube-nocookie\.com/;
|
|
73
|
+
const NOCOOKIE_HOST = "https://www.youtube-nocookie.com";
|
|
74
|
+
class YouTube extends import_react.Component {
|
|
75
|
+
constructor() {
|
|
76
|
+
super(...arguments);
|
|
77
|
+
__publicField(this, "callPlayer", import_utils.callPlayer);
|
|
78
|
+
__publicField(this, "parsePlaylist", (url) => {
|
|
79
|
+
if (url instanceof Array) {
|
|
80
|
+
return {
|
|
81
|
+
listType: "playlist",
|
|
82
|
+
playlist: url.map(this.getID).join(",")
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (MATCH_PLAYLIST.test(url)) {
|
|
86
|
+
const [, playlistId] = url.match(MATCH_PLAYLIST);
|
|
87
|
+
return {
|
|
88
|
+
listType: "playlist",
|
|
89
|
+
list: playlistId.replace(/^UC/, "UU")
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (MATCH_USER_UPLOADS.test(url)) {
|
|
93
|
+
const [, username] = url.match(MATCH_USER_UPLOADS);
|
|
94
|
+
return {
|
|
95
|
+
listType: "user_uploads",
|
|
96
|
+
list: username
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
return {};
|
|
100
|
+
});
|
|
101
|
+
__publicField(this, "onStateChange", (event) => {
|
|
102
|
+
const { data } = event;
|
|
103
|
+
const { onPlay, onPause, onBuffer, onBufferEnd, onEnded, onReady, loop, config: { playerVars, onUnstarted } } = this.props;
|
|
104
|
+
const { UNSTARTED, PLAYING, PAUSED, BUFFERING, ENDED, CUED } = window[SDK_GLOBAL].PlayerState;
|
|
105
|
+
if (data === UNSTARTED)
|
|
106
|
+
onUnstarted();
|
|
107
|
+
if (data === PLAYING) {
|
|
108
|
+
onPlay();
|
|
109
|
+
onBufferEnd();
|
|
110
|
+
}
|
|
111
|
+
if (data === PAUSED)
|
|
112
|
+
onPause();
|
|
113
|
+
if (data === BUFFERING)
|
|
114
|
+
onBuffer();
|
|
115
|
+
if (data === ENDED) {
|
|
116
|
+
const isPlaylist = !!this.callPlayer("getPlaylist");
|
|
117
|
+
if (loop && !isPlaylist) {
|
|
118
|
+
if (playerVars.start) {
|
|
119
|
+
this.seekTo(playerVars.start);
|
|
120
|
+
} else {
|
|
121
|
+
this.play();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
onEnded();
|
|
125
|
+
}
|
|
126
|
+
if (data === CUED)
|
|
127
|
+
onReady();
|
|
128
|
+
});
|
|
129
|
+
__publicField(this, "mute", () => {
|
|
130
|
+
this.callPlayer("mute");
|
|
131
|
+
});
|
|
132
|
+
__publicField(this, "unmute", () => {
|
|
133
|
+
this.callPlayer("unMute");
|
|
134
|
+
});
|
|
135
|
+
__publicField(this, "ref", (container) => {
|
|
136
|
+
this.container = container;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
componentDidMount() {
|
|
140
|
+
this.props.onMount && this.props.onMount(this);
|
|
141
|
+
}
|
|
142
|
+
getID(url) {
|
|
143
|
+
if (!url || url instanceof Array || MATCH_PLAYLIST.test(url)) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return url.match(import_patterns.MATCH_URL_YOUTUBE)[1];
|
|
147
|
+
}
|
|
148
|
+
load(url, isReady) {
|
|
149
|
+
const { playing, muted, playsinline, controls, loop, config, onError } = this.props;
|
|
150
|
+
const { playerVars, embedOptions } = config;
|
|
151
|
+
const id = this.getID(url);
|
|
152
|
+
if (isReady) {
|
|
153
|
+
if (MATCH_PLAYLIST.test(url) || MATCH_USER_UPLOADS.test(url) || url instanceof Array) {
|
|
154
|
+
this.player.loadPlaylist(this.parsePlaylist(url));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
this.player.cueVideoById({
|
|
158
|
+
videoId: id,
|
|
159
|
+
startSeconds: (0, import_utils.parseStartTime)(url) || playerVars.start,
|
|
160
|
+
endSeconds: (0, import_utils.parseEndTime)(url) || playerVars.end
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, (YT) => YT.loaded).then((YT) => {
|
|
165
|
+
if (!this.container)
|
|
166
|
+
return;
|
|
167
|
+
this.player = new YT.Player(this.container, {
|
|
168
|
+
width: "100%",
|
|
169
|
+
height: "100%",
|
|
170
|
+
videoId: id,
|
|
171
|
+
playerVars: {
|
|
172
|
+
autoplay: playing ? 1 : 0,
|
|
173
|
+
mute: muted ? 1 : 0,
|
|
174
|
+
controls: controls ? 1 : 0,
|
|
175
|
+
start: (0, import_utils.parseStartTime)(url),
|
|
176
|
+
end: (0, import_utils.parseEndTime)(url),
|
|
177
|
+
origin: window.location.origin,
|
|
178
|
+
playsinline: playsinline ? 1 : 0,
|
|
179
|
+
...this.parsePlaylist(url),
|
|
180
|
+
...playerVars
|
|
181
|
+
},
|
|
182
|
+
events: {
|
|
183
|
+
onReady: () => {
|
|
184
|
+
if (loop) {
|
|
185
|
+
this.player.setLoop(true);
|
|
186
|
+
}
|
|
187
|
+
this.props.onReady();
|
|
188
|
+
},
|
|
189
|
+
onPlaybackRateChange: (event) => this.props.onPlaybackRateChange(event.data),
|
|
190
|
+
onPlaybackQualityChange: (event) => this.props.onPlaybackQualityChange(event),
|
|
191
|
+
onStateChange: this.onStateChange,
|
|
192
|
+
onError: (event) => onError(event.data)
|
|
193
|
+
},
|
|
194
|
+
host: MATCH_NOCOOKIE.test(url) ? NOCOOKIE_HOST : void 0,
|
|
195
|
+
...embedOptions
|
|
196
|
+
});
|
|
197
|
+
}, onError);
|
|
198
|
+
if (embedOptions.events) {
|
|
199
|
+
console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer\u2019s callback props instead, eg onReady, onPlay, onPause");
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
play() {
|
|
203
|
+
this.callPlayer("playVideo");
|
|
204
|
+
}
|
|
205
|
+
pause() {
|
|
206
|
+
this.callPlayer("pauseVideo");
|
|
207
|
+
}
|
|
208
|
+
stop() {
|
|
209
|
+
if (!document.body.contains(this.callPlayer("getIframe")))
|
|
210
|
+
return;
|
|
211
|
+
this.callPlayer("stopVideo");
|
|
212
|
+
}
|
|
213
|
+
seekTo(amount, keepPlaying = false) {
|
|
214
|
+
this.callPlayer("seekTo", amount);
|
|
215
|
+
if (!keepPlaying && !this.props.playing) {
|
|
216
|
+
this.pause();
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
setVolume(fraction) {
|
|
220
|
+
this.callPlayer("setVolume", fraction * 100);
|
|
221
|
+
}
|
|
222
|
+
setPlaybackRate(rate) {
|
|
223
|
+
this.callPlayer("setPlaybackRate", rate);
|
|
224
|
+
}
|
|
225
|
+
setLoop(loop) {
|
|
226
|
+
this.callPlayer("setLoop", loop);
|
|
227
|
+
}
|
|
228
|
+
getDuration() {
|
|
229
|
+
return this.callPlayer("getDuration");
|
|
230
|
+
}
|
|
231
|
+
getCurrentTime() {
|
|
232
|
+
return this.callPlayer("getCurrentTime");
|
|
233
|
+
}
|
|
234
|
+
getSecondsLoaded() {
|
|
235
|
+
return this.callPlayer("getVideoLoadedFraction") * this.getDuration();
|
|
236
|
+
}
|
|
237
|
+
render() {
|
|
238
|
+
const { display } = this.props;
|
|
239
|
+
const style = {
|
|
240
|
+
width: "100%",
|
|
241
|
+
height: "100%",
|
|
242
|
+
display
|
|
243
|
+
};
|
|
244
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style }, /* @__PURE__ */ import_react.default.createElement("div", { ref: this.ref }));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
__publicField(YouTube, "displayName", "YouTube");
|
|
248
|
+
__publicField(YouTube, "canPlay", import_patterns.canPlay.youtube);
|
|
249
|
+
return YouTube_1;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
var YouTubeExports = /*@__PURE__*/ requireYouTube();
|
|
253
|
+
var YouTube = /*@__PURE__*/index.getDefaultExportFromCjs(YouTubeExports);
|
|
254
|
+
|
|
255
|
+
var YouTube$1 = /*#__PURE__*/_mergeNamespaces({
|
|
256
|
+
__proto__: null,
|
|
257
|
+
default: YouTube
|
|
258
|
+
}, [YouTubeExports]);
|
|
259
|
+
|
|
260
|
+
exports.YouTube = YouTube$1;
|