Skip to content

Commit 66ddee2

Browse files
fix: build
1 parent c9f8096 commit 66ddee2

File tree

161 files changed

+348606
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+348606
-0
lines changed
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
import { g as getDefaultExportFromCjs, u as utils, p as patterns } from "./kk-adapt-export-9sEo3eKk.js";
2+
import React__default from "react";
3+
function _mergeNamespaces(n, m) {
4+
for (var i = 0; i < m.length; i++) {
5+
const e = m[i];
6+
if (typeof e !== "string" && !Array.isArray(e)) {
7+
for (const k in e) {
8+
if (k !== "default" && !(k in n)) {
9+
const d = Object.getOwnPropertyDescriptor(e, k);
10+
if (d) {
11+
Object.defineProperty(n, k, d.get ? d : {
12+
enumerable: true,
13+
get: () => e[k]
14+
});
15+
}
16+
}
17+
}
18+
}
19+
}
20+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
21+
}
22+
var __create = Object.create;
23+
var __defProp = Object.defineProperty;
24+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25+
var __getOwnPropNames = Object.getOwnPropertyNames;
26+
var __getProtoOf = Object.getPrototypeOf;
27+
var __hasOwnProp = Object.prototype.hasOwnProperty;
28+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
29+
var __export = (target, all) => {
30+
for (var name in all)
31+
__defProp(target, name, { get: all[name], enumerable: true });
32+
};
33+
var __copyProps = (to, from, except, desc) => {
34+
if (from && typeof from === "object" || typeof from === "function") {
35+
for (let key of __getOwnPropNames(from))
36+
if (!__hasOwnProp.call(to, key) && key !== except)
37+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
38+
}
39+
return to;
40+
};
41+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
42+
// If the importer is in node compatibility mode or this is not an ESM
43+
// file that has been converted to a CommonJS file using a Babel-
44+
// compatible transform (i.e. "__esModule" has not been set), then set
45+
// "default" to the CommonJS "module.exports" for node compatibility.
46+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
47+
mod
48+
));
49+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50+
var __publicField = (obj, key, value) => {
51+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
52+
return value;
53+
};
54+
var DailyMotion_exports = {};
55+
__export(DailyMotion_exports, {
56+
default: () => DailyMotion
57+
});
58+
var DailyMotion_1 = __toCommonJS(DailyMotion_exports);
59+
var import_react2 = __toESM(React__default);
60+
var import_utils = utils;
61+
var import_patterns = patterns;
62+
const SDK_URL = "https://api.dmcdn.net/all.js";
63+
const SDK_GLOBAL = "DM";
64+
const SDK_GLOBAL_READY = "dmAsyncInit";
65+
class DailyMotion extends import_react2.Component {
66+
constructor() {
67+
super(...arguments);
68+
__publicField(this, "callPlayer", import_utils.callPlayer);
69+
__publicField(this, "onDurationChange", () => {
70+
const duration = this.getDuration();
71+
this.props.onDuration(duration);
72+
});
73+
__publicField(this, "mute", () => {
74+
this.callPlayer("setMuted", true);
75+
});
76+
__publicField(this, "unmute", () => {
77+
this.callPlayer("setMuted", false);
78+
});
79+
__publicField(this, "ref", (container) => {
80+
this.container = container;
81+
});
82+
}
83+
componentDidMount() {
84+
this.props.onMount && this.props.onMount(this);
85+
}
86+
load(url) {
87+
const { controls, config, onError, playing } = this.props;
88+
const [, id] = url.match(import_patterns.MATCH_URL_DAILYMOTION);
89+
if (this.player) {
90+
this.player.load(id, {
91+
start: (0, import_utils.parseStartTime)(url),
92+
autoplay: playing
93+
});
94+
return;
95+
}
96+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, (DM) => DM.player).then((DM) => {
97+
if (!this.container)
98+
return;
99+
const Player = DM.player;
100+
this.player = new Player(this.container, {
101+
width: "100%",
102+
height: "100%",
103+
video: id,
104+
params: {
105+
controls,
106+
autoplay: this.props.playing,
107+
mute: this.props.muted,
108+
start: (0, import_utils.parseStartTime)(url),
109+
origin: window.location.origin,
110+
...config.params
111+
},
112+
events: {
113+
apiready: this.props.onReady,
114+
seeked: () => this.props.onSeek(this.player.currentTime),
115+
video_end: this.props.onEnded,
116+
durationchange: this.onDurationChange,
117+
pause: this.props.onPause,
118+
playing: this.props.onPlay,
119+
waiting: this.props.onBuffer,
120+
error: (event) => onError(event)
121+
}
122+
});
123+
}, onError);
124+
}
125+
play() {
126+
this.callPlayer("play");
127+
}
128+
pause() {
129+
this.callPlayer("pause");
130+
}
131+
stop() {
132+
}
133+
seekTo(seconds, keepPlaying = true) {
134+
this.callPlayer("seek", seconds);
135+
if (!keepPlaying) {
136+
this.pause();
137+
}
138+
}
139+
setVolume(fraction) {
140+
this.callPlayer("setVolume", fraction);
141+
}
142+
getDuration() {
143+
return this.player.duration || null;
144+
}
145+
getCurrentTime() {
146+
return this.player.currentTime;
147+
}
148+
getSecondsLoaded() {
149+
return this.player.bufferedTime;
150+
}
151+
render() {
152+
const { display } = this.props;
153+
const style = {
154+
width: "100%",
155+
height: "100%",
156+
display
157+
};
158+
return /* @__PURE__ */ import_react2.default.createElement("div", { style }, /* @__PURE__ */ import_react2.default.createElement("div", { ref: this.ref }));
159+
}
160+
}
161+
__publicField(DailyMotion, "displayName", "DailyMotion");
162+
__publicField(DailyMotion, "canPlay", import_patterns.canPlay.dailymotion);
163+
__publicField(DailyMotion, "loopOnEnded", true);
164+
const DailyMotion$1 = /* @__PURE__ */ getDefaultExportFromCjs(DailyMotion_1);
165+
const DailyMotion$2 = /* @__PURE__ */ _mergeNamespaces({
166+
__proto__: null,
167+
default: DailyMotion$1
168+
}, [DailyMotion_1]);
169+
export {
170+
DailyMotion$2 as D
171+
};
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
import { g as getDefaultExportFromCjs, u as utils, p as patterns } from "./kk-adapt-export-9sEo3eKk.js";
2+
import React__default from "react";
3+
function _mergeNamespaces(n, m) {
4+
for (var i = 0; i < m.length; i++) {
5+
const e = m[i];
6+
if (typeof e !== "string" && !Array.isArray(e)) {
7+
for (const k in e) {
8+
if (k !== "default" && !(k in n)) {
9+
const d = Object.getOwnPropertyDescriptor(e, k);
10+
if (d) {
11+
Object.defineProperty(n, k, d.get ? d : {
12+
enumerable: true,
13+
get: () => e[k]
14+
});
15+
}
16+
}
17+
}
18+
}
19+
}
20+
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
21+
}
22+
var __create = Object.create;
23+
var __defProp = Object.defineProperty;
24+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25+
var __getOwnPropNames = Object.getOwnPropertyNames;
26+
var __getProtoOf = Object.getPrototypeOf;
27+
var __hasOwnProp = Object.prototype.hasOwnProperty;
28+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
29+
var __export = (target, all) => {
30+
for (var name in all)
31+
__defProp(target, name, { get: all[name], enumerable: true });
32+
};
33+
var __copyProps = (to, from, except, desc) => {
34+
if (from && typeof from === "object" || typeof from === "function") {
35+
for (let key of __getOwnPropNames(from))
36+
if (!__hasOwnProp.call(to, key) && key !== except)
37+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
38+
}
39+
return to;
40+
};
41+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
42+
// If the importer is in node compatibility mode or this is not an ESM
43+
// file that has been converted to a CommonJS file using a Babel-
44+
// compatible transform (i.e. "__esModule" has not been set), then set
45+
// "default" to the CommonJS "module.exports" for node compatibility.
46+
!mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
47+
mod
48+
));
49+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50+
var __publicField = (obj, key, value) => {
51+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
52+
return value;
53+
};
54+
var Facebook_exports = {};
55+
__export(Facebook_exports, {
56+
default: () => Facebook
57+
});
58+
var Facebook_1 = __toCommonJS(Facebook_exports);
59+
var import_react2 = __toESM(React__default);
60+
var import_utils = utils;
61+
var import_patterns = patterns;
62+
const SDK_URL = "https://connect.facebook.net/en_US/sdk.js";
63+
const SDK_GLOBAL = "FB";
64+
const SDK_GLOBAL_READY = "fbAsyncInit";
65+
const PLAYER_ID_PREFIX = "facebook-player-";
66+
class Facebook extends import_react2.Component {
67+
constructor() {
68+
super(...arguments);
69+
__publicField(this, "callPlayer", import_utils.callPlayer);
70+
__publicField(this, "playerID", this.props.config.playerId || `${PLAYER_ID_PREFIX}${(0, import_utils.randomString)()}`);
71+
__publicField(this, "mute", () => {
72+
this.callPlayer("mute");
73+
});
74+
__publicField(this, "unmute", () => {
75+
this.callPlayer("unmute");
76+
});
77+
}
78+
componentDidMount() {
79+
this.props.onMount && this.props.onMount(this);
80+
}
81+
load(url, isReady) {
82+
if (isReady) {
83+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then((FB) => FB.XFBML.parse());
84+
return;
85+
}
86+
(0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then((FB) => {
87+
FB.init({
88+
appId: this.props.config.appId,
89+
xfbml: true,
90+
version: this.props.config.version
91+
});
92+
FB.Event.subscribe("xfbml.render", (msg) => {
93+
this.props.onLoaded();
94+
});
95+
FB.Event.subscribe("xfbml.ready", (msg) => {
96+
if (msg.type === "video" && msg.id === this.playerID) {
97+
this.player = msg.instance;
98+
this.player.subscribe("startedPlaying", this.props.onPlay);
99+
this.player.subscribe("paused", this.props.onPause);
100+
this.player.subscribe("finishedPlaying", this.props.onEnded);
101+
this.player.subscribe("startedBuffering", this.props.onBuffer);
102+
this.player.subscribe("finishedBuffering", this.props.onBufferEnd);
103+
this.player.subscribe("error", this.props.onError);
104+
if (this.props.muted) {
105+
this.callPlayer("mute");
106+
} else {
107+
this.callPlayer("unmute");
108+
}
109+
this.props.onReady();
110+
document.getElementById(this.playerID).querySelector("iframe").style.visibility = "visible";
111+
}
112+
});
113+
});
114+
}
115+
play() {
116+
this.callPlayer("play");
117+
}
118+
pause() {
119+
this.callPlayer("pause");
120+
}
121+
stop() {
122+
}
123+
seekTo(seconds, keepPlaying = true) {
124+
this.callPlayer("seek", seconds);
125+
if (!keepPlaying) {
126+
this.pause();
127+
}
128+
}
129+
setVolume(fraction) {
130+
this.callPlayer("setVolume", fraction);
131+
}
132+
getDuration() {
133+
return this.callPlayer("getDuration");
134+
}
135+
getCurrentTime() {
136+
return this.callPlayer("getCurrentPosition");
137+
}
138+
getSecondsLoaded() {
139+
return null;
140+
}
141+
render() {
142+
const { attributes } = this.props.config;
143+
const style = {
144+
width: "100%",
145+
height: "100%"
146+
};
147+
return /* @__PURE__ */ import_react2.default.createElement(
148+
"div",
149+
{
150+
style,
151+
id: this.playerID,
152+
className: "fb-video",
153+
"data-href": this.props.url,
154+
"data-autoplay": this.props.playing ? "true" : "false",
155+
"data-allowfullscreen": "true",
156+
"data-controls": this.props.controls ? "true" : "false",
157+
...attributes
158+
}
159+
);
160+
}
161+
}
162+
__publicField(Facebook, "displayName", "Facebook");
163+
__publicField(Facebook, "canPlay", import_patterns.canPlay.facebook);
164+
__publicField(Facebook, "loopOnEnded", true);
165+
const Facebook$1 = /* @__PURE__ */ getDefaultExportFromCjs(Facebook_1);
166+
const Facebook$2 = /* @__PURE__ */ _mergeNamespaces({
167+
__proto__: null,
168+
default: Facebook$1
169+
}, [Facebook_1]);
170+
export {
171+
Facebook$2 as F
172+
};

0 commit comments

Comments
 (0)