xgplayer 2.32.5 → 2.32.6
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/browser/controls/airplay.js +1 -1
- package/browser/controls/cssFullscreen.js +1 -1
- package/browser/controls/danmu.js +3 -1
- package/browser/controls/definition.js +1 -1
- package/browser/controls/download.js +1 -1
- package/browser/controls/enter.js +1 -1
- package/browser/controls/error.js +1 -1
- package/browser/controls/errorRetry.js +1 -1
- package/browser/controls/flex.js +1 -1
- package/browser/controls/fullscreen.js +1 -1
- package/browser/controls/loading.js +1 -1
- package/browser/controls/memoryPlay.js +1 -1
- package/browser/controls/miniplayer.js +9 -7
- package/browser/controls/mobile.js +1 -1
- package/browser/controls/nativeTextTrack.js +1 -1
- package/browser/controls/pc.js +1 -1
- package/browser/controls/pip.js +1 -1
- package/browser/controls/play.js +1 -1
- package/browser/controls/playNext.js +1 -1
- package/browser/controls/playbackRate.js +1 -1
- package/browser/controls/poster.js +1 -1
- package/browser/controls/progress.js +1 -1
- package/browser/controls/reload.js +1 -1
- package/browser/controls/replay.js +1 -1
- package/browser/controls/rotate.js +1 -1
- package/browser/controls/screenShot.js +1 -1
- package/browser/controls/start.js +1 -1
- package/browser/controls/textTrack.js +1 -1
- package/browser/controls/time.js +1 -1
- package/browser/controls/volume.js +1 -1
- package/browser/core_player.js +1 -1
- package/browser/core_player.js.map +1 -1
- package/browser/index.js +11 -7
- package/browser/index.js.map +1 -1
- package/browser/simple_player.js +1 -1
- package/browser/simple_player.js.map +1 -1
- package/dist/controls/airplay.js +1 -1
- package/dist/controls/cssFullscreen.js +1 -1
- package/dist/controls/danmu.js +3 -1
- package/dist/controls/definition.js +1 -1
- package/dist/controls/download.js +1 -1
- package/dist/controls/enter.js +1 -1
- package/dist/controls/error.js +1 -1
- package/dist/controls/errorRetry.js +1 -1
- package/dist/controls/flex.js +1 -1
- package/dist/controls/fullscreen.js +1 -1
- package/dist/controls/loading.js +1 -1
- package/dist/controls/memoryPlay.js +1 -1
- package/dist/controls/miniplayer.js +9 -7
- package/dist/controls/mobile.js +1 -1
- package/dist/controls/nativeTextTrack.js +1 -1
- package/dist/controls/pc.js +1 -1
- package/dist/controls/pip.js +1 -1
- package/dist/controls/play.js +1 -1
- package/dist/controls/playNext.js +1 -1
- package/dist/controls/playbackRate.js +1 -1
- package/dist/controls/poster.js +1 -1
- package/dist/controls/progress.js +1 -1
- package/dist/controls/reload.js +1 -1
- package/dist/controls/replay.js +1 -1
- package/dist/controls/rotate.js +1 -1
- package/dist/controls/screenShot.js +1 -1
- package/dist/controls/start.js +1 -1
- package/dist/controls/textTrack.js +1 -1
- package/dist/controls/time.js +1 -1
- package/dist/controls/volume.js +1 -1
- package/dist/core_player.js +2960 -2889
- package/dist/core_player.js.map +1 -1
- package/dist/index.js +1938 -3321
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/simple_player.js +274 -281
- package/dist/simple_player.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +216 -0
- package/es/constant.d.ts +4 -0
- package/es/constant.js +5 -0
- package/es/controls/airplay.js +1 -1
- package/es/controls/cssFullscreen.js +1 -1
- package/es/controls/danmu.js +3 -1
- package/es/controls/definition.js +1 -1
- package/es/controls/download.js +1 -1
- package/es/controls/enter.js +1 -1
- package/es/controls/error.js +1 -1
- package/es/controls/errorRetry.js +1 -1
- package/es/controls/flex.js +1 -1
- package/es/controls/fullscreen.js +1 -1
- package/es/controls/i18n.js +1 -1
- package/es/controls/keyboard.js +1 -1
- package/es/controls/loading.js +1 -1
- package/es/controls/localPreview.js +1 -1
- package/es/controls/memoryPlay.js +1 -1
- package/es/controls/miniplayer.js +9 -7
- package/es/controls/mobile.js +1 -1
- package/es/controls/nativeTextTrack.js +1 -1
- package/es/controls/pc.js +1 -1
- package/es/controls/pip.js +1 -1
- package/es/controls/play.js +1 -1
- package/es/controls/playNext.js +1 -1
- package/es/controls/playbackRate.js +1 -1
- package/es/controls/poster.js +1 -1
- package/es/controls/progress.js +1 -1
- package/es/controls/reload.js +1 -1
- package/es/controls/replay.js +1 -1
- package/es/controls/rotate.js +1 -1
- package/es/controls/screenShot.js +1 -1
- package/es/controls/start.js +1 -1
- package/es/controls/textTrack.js +1 -1
- package/es/controls/time.js +1 -1
- package/es/controls/volume.js +1 -1
- package/es/core_player.js +1 -1
- package/es/core_player.js.map +1 -1
- package/es/defaultConfig.d.ts +243 -0
- package/es/defaultConfig.js +85 -0
- package/es/error.d.ts +114 -0
- package/es/error.js +75 -0
- package/es/events.d.ts +61 -0
- package/es/events.js +62 -0
- package/es/icons.d.ts +2 -0
- package/es/index.css +499 -0
- package/es/index.d.ts +25 -0
- package/es/index.js +11 -7
- package/es/index.js.map +1 -1
- package/es/index.scss +29 -0
- package/es/index.umd.d.ts +60 -0
- package/es/index.umd.js +30 -0
- package/es/lang/en.d.ts +91 -0
- package/es/lang/en.js +77 -0
- package/es/lang/i18n.d.ts +36 -0
- package/es/lang/i18n.js +122 -0
- package/es/lang/index.d.ts +2 -0
- package/es/lang/jp.d.ts +91 -0
- package/es/lang/jp.js +77 -0
- package/es/lang/zh-cn.d.ts +91 -0
- package/es/lang/zh-cn.js +77 -0
- package/es/lang/zh-hk.d.ts +91 -0
- package/es/lang/zh-hk.js +77 -0
- package/es/mediaProxy.d.ts +334 -0
- package/es/mediaProxy.js +623 -0
- package/es/player.d.ts +825 -0
- package/es/player.js +1945 -0
- package/es/plugin/basePlugin.d.ts +180 -0
- package/es/plugin/basePlugin.js +259 -0
- package/es/plugin/hooksDescriptor.d.ts +60 -0
- package/es/plugin/hooksDescriptor.js +149 -0
- package/es/plugin/index.d.ts +13 -0
- package/es/plugin/plugin.d.ts +207 -0
- package/es/plugin/plugin.js +542 -0
- package/es/plugin/pluginsManager.d.ts +162 -0
- package/es/plugin/pluginsManager.js +362 -0
- package/es/plugin/preset.d.ts +1 -0
- package/es/plugin/preset.js +28 -0
- package/es/plugin/resizeObserver.d.ts +3 -0
- package/es/plugin/resizeObserver.js +108 -0
- package/es/plugins/assets/back.js +4 -0
- package/es/plugins/assets/download.js +4 -0
- package/es/plugins/assets/exitCssFull.js +4 -0
- package/es/plugins/assets/exitFull.js +4 -0
- package/es/plugins/assets/loading.js +4 -0
- package/es/plugins/assets/panel.js +4 -0
- package/es/plugins/assets/pause.js +4 -0
- package/es/plugins/assets/pipIcon.js +4 -0
- package/es/plugins/assets/pipIconExit.js +4 -0
- package/es/plugins/assets/play.js +4 -0
- package/es/plugins/assets/playNext.js +4 -0
- package/es/plugins/assets/replay.js +4 -0
- package/es/plugins/assets/requestCssFull.js +7 -0
- package/es/plugins/assets/requestFull.js +4 -0
- package/es/plugins/assets/rotate.js +4 -0
- package/es/plugins/assets/seekicon.js +4 -0
- package/es/plugins/assets/volumeLarge.js +4 -0
- package/es/plugins/assets/volumeMuted.js +4 -0
- package/es/plugins/assets/volumeSmall.js +4 -0
- package/es/plugins/common/iconPlugin.d.ts +5 -0
- package/es/plugins/common/iconPlugin.js +42 -0
- package/es/plugins/common/iconTools.d.ts +1 -0
- package/es/plugins/common/iconTools.js +8 -0
- package/es/plugins/common/index.scss +2 -0
- package/es/plugins/common/optionList.d.ts +15 -0
- package/es/plugins/common/optionList.js +120 -0
- package/es/plugins/common/optionsIcon.d.ts +40 -0
- package/es/plugins/common/optionsIcon.js +304 -0
- package/es/plugins/common/optionsIcon.scss +154 -0
- package/es/plugins/common/thumbnail.d.ts +62 -0
- package/es/plugins/common/thumbnail.js +191 -0
- package/es/plugins/common/thumbnail.scss +27 -0
- package/es/plugins/controls/index.css +132 -0
- package/es/plugins/controls/index.d.ts +73 -0
- package/es/plugins/controls/index.js +189 -0
- package/es/plugins/controls/index.scss +204 -0
- package/es/plugins/cssFullScreen/index.css +12 -0
- package/es/plugins/cssFullScreen/index.d.ts +40 -0
- package/es/plugins/cssFullScreen/index.js +136 -0
- package/es/plugins/cssFullScreen/index.scss +19 -0
- package/es/plugins/danmu/danmuIcon.d.ts +24 -0
- package/es/plugins/danmu/danmuIcon.js +98 -0
- package/es/plugins/danmu/danmuPanel.d.ts +39 -0
- package/es/plugins/danmu/danmuPanel.js +81 -0
- package/es/plugins/danmu/index.css +603 -0
- package/es/plugins/danmu/index.d.ts +96 -0
- package/es/plugins/danmu/index.js +313 -0
- package/es/plugins/danmu/index.scss +356 -0
- package/es/plugins/definition/index.css +4 -0
- package/es/plugins/definition/index.d.ts +38 -0
- package/es/plugins/definition/index.js +164 -0
- package/es/plugins/definition/index.scss +4 -0
- package/es/plugins/download/index.css +13 -0
- package/es/plugins/download/index.d.ts +31 -0
- package/es/plugins/download/index.js +107 -0
- package/es/plugins/download/index.scss +22 -0
- package/es/plugins/dynamicBg/index.css +16 -0
- package/es/plugins/dynamicBg/index.d.ts +83 -0
- package/es/plugins/dynamicBg/index.js +316 -0
- package/es/plugins/dynamicBg/index.scss +19 -0
- package/es/plugins/enter/index.css +104 -0
- package/es/plugins/enter/index.d.ts +19 -0
- package/es/plugins/enter/index.js +46 -0
- package/es/plugins/enter/index.scss +78 -0
- package/es/plugins/error/index.css +29 -0
- package/es/plugins/error/index.d.ts +8 -0
- package/es/plugins/error/index.js +75 -0
- package/es/plugins/error/index.scss +34 -0
- package/es/plugins/fpsDetect/index.d.ts +34 -0
- package/es/plugins/fpsDetect/index.js +149 -0
- package/es/plugins/fullscreen/backicon.d.ts +17 -0
- package/es/plugins/fullscreen/backicon.js +72 -0
- package/es/plugins/fullscreen/index.css +23 -0
- package/es/plugins/fullscreen/index.d.ts +58 -0
- package/es/plugins/fullscreen/index.js +202 -0
- package/es/plugins/fullscreen/index.scss +35 -0
- package/es/plugins/gapJump/index.d.ts +21 -0
- package/es/plugins/gapJump/index.js +142 -0
- package/es/plugins/keyboard/index.d.ts +89 -0
- package/es/plugins/keyboard/index.js +421 -0
- package/es/plugins/loading/index.css +58 -0
- package/es/plugins/loading/index.d.ts +11 -0
- package/es/plugins/loading/index.js +43 -0
- package/es/plugins/loading/index.scss +70 -0
- package/es/plugins/logger/index.d.ts +54 -0
- package/es/plugins/logger/index.js +311 -0
- package/es/plugins/miniScreen/index.css +179 -0
- package/es/plugins/miniScreen/index.d.ts +68 -0
- package/es/plugins/miniScreen/index.js +212 -0
- package/es/plugins/miniScreen/index.scss +198 -0
- package/es/plugins/miniScreen/miniScreenIcon.d.ts +11 -0
- package/es/plugins/miniScreen/miniScreenIcon.js +56 -0
- package/es/plugins/mobile/index.css +181 -0
- package/es/plugins/mobile/index.d.ts +125 -0
- package/es/plugins/mobile/index.js +631 -0
- package/es/plugins/mobile/index.scss +180 -0
- package/es/plugins/mobile/touch.d.ts +43 -0
- package/es/plugins/mobile/touch.js +214 -0
- package/es/plugins/netAdaption/index.d.ts +5 -0
- package/es/plugins/pc/index.css +3 -0
- package/es/plugins/pc/index.d.ts +14 -0
- package/es/plugins/pc/index.js +199 -0
- package/es/plugins/pc/index.scss +5 -0
- package/es/plugins/pip/index.css +12 -0
- package/es/plugins/pip/index.d.ts +37 -0
- package/es/plugins/pip/index.js +222 -0
- package/es/plugins/pip/index.scss +21 -0
- package/es/plugins/play/index.css +12 -0
- package/es/plugins/play/index.d.ts +23 -0
- package/es/plugins/play/index.js +127 -0
- package/es/plugins/play/index.scss +18 -0
- package/es/plugins/playNext/index.css +22 -0
- package/es/plugins/playNext/index.d.ts +19 -0
- package/es/plugins/playNext/index.js +104 -0
- package/es/plugins/playNext/index.scss +35 -0
- package/es/plugins/playbackRate/index.css +4 -0
- package/es/plugins/playbackRate/index.d.ts +31 -0
- package/es/plugins/playbackRate/index.js +140 -0
- package/es/plugins/playbackRate/index.scss +6 -0
- package/es/plugins/poster/index.css +39 -0
- package/es/plugins/poster/index.d.ts +27 -0
- package/es/plugins/poster/index.js +109 -0
- package/es/plugins/poster/index.scss +56 -0
- package/es/plugins/progress/index.css +234 -0
- package/es/plugins/progress/index.d.ts +178 -0
- package/es/plugins/progress/index.js +687 -0
- package/es/plugins/progress/index.scss +288 -0
- package/es/plugins/progress/innerList.d.ts +49 -0
- package/es/plugins/progress/innerList.js +285 -0
- package/es/plugins/progress/miniProgress.d.ts +9 -0
- package/es/plugins/progress/miniProgress.js +55 -0
- package/es/plugins/progressPreview/dotsApi.d.ts +1 -0
- package/es/plugins/progressPreview/dotsApi.js +269 -0
- package/es/plugins/progressPreview/index.css +190 -0
- package/es/plugins/progressPreview/index.d.ts +87 -0
- package/es/plugins/progressPreview/index.js +475 -0
- package/es/plugins/progressPreview/index.scss +235 -0
- package/es/plugins/prompt/index.css +47 -0
- package/es/plugins/prompt/index.d.ts +24 -0
- package/es/plugins/prompt/index.js +110 -0
- package/es/plugins/prompt/index.scss +53 -0
- package/es/plugins/replay/index.css +33 -0
- package/es/plugins/replay/index.d.ts +16 -0
- package/es/plugins/replay/index.js +109 -0
- package/es/plugins/replay/index.scss +41 -0
- package/es/plugins/rotate/index.css +0 -0
- package/es/plugins/rotate/index.d.ts +22 -0
- package/es/plugins/rotate/index.js +148 -0
- package/es/plugins/rotate/index.scss +0 -0
- package/es/plugins/rotate/index2.js +2 -0
- package/es/plugins/screenShot/index.css +3 -0
- package/es/plugins/screenShot/index.d.ts +30 -0
- package/es/plugins/screenShot/index.js +178 -0
- package/es/plugins/screenShot/index.scss +5 -0
- package/es/plugins/start/index.css +91 -0
- package/es/plugins/start/index.d.ts +41 -0
- package/es/plugins/start/index.js +267 -0
- package/es/plugins/start/index.scss +115 -0
- package/es/plugins/stats/index.d.ts +38 -0
- package/es/plugins/stats/index.js +194 -0
- package/es/plugins/testspeed/index.d.ts +26 -0
- package/es/plugins/testspeed/index.js +207 -0
- package/es/plugins/time/index.css +46 -0
- package/es/plugins/time/index.d.ts +28 -0
- package/es/plugins/time/index.js +225 -0
- package/es/plugins/time/index.scss +57 -0
- package/es/plugins/time/timesegments.d.ts +24 -0
- package/es/plugins/time/timesegments.js +216 -0
- package/es/plugins/track/index.css +91 -0
- package/es/plugins/track/index.d.ts +132 -0
- package/es/plugins/track/index.js +463 -0
- package/es/plugins/track/index.scss +111 -0
- package/es/plugins/track/nativeSubTitle.d.ts +22 -0
- package/es/plugins/track/nativeSubTitle.js +94 -0
- package/es/plugins/volume/index.css +95 -0
- package/es/plugins/volume/index.d.ts +88 -0
- package/es/plugins/volume/index.js +319 -0
- package/es/plugins/volume/index.scss +124 -0
- package/es/plugins/waitingTimeoutJump/index.d.ts +15 -0
- package/es/plugins/waitingTimeoutJump/index.js +88 -0
- package/es/presets/default-en.d.ts +33 -0
- package/es/presets/default-en.js +63 -0
- package/es/presets/default.d.ts +34 -0
- package/es/presets/default.js +70 -0
- package/es/presets/index.d.ts +4 -0
- package/es/presets/live.d.ts +94 -0
- package/es/presets/live.js +39 -0
- package/es/presets/mobile.d.ts +103 -0
- package/es/presets/mobile.js +34 -0
- package/es/simple_player.js +1 -1
- package/es/simple_player.js.map +1 -1
- package/es/state.d.ts +11 -0
- package/es/state.js +12 -0
- package/es/stateClassMap.d.ts +32 -0
- package/es/stateClassMap.js +32 -0
- package/es/style/common/animation.scss +16 -0
- package/es/style/common/svg-url.scss +70 -0
- package/es/style/common.scss +457 -0
- package/es/style/index.scss +4 -0
- package/es/style/variable.scss +76 -0
- package/es/utils/database.d.ts +31 -0
- package/es/utils/database.js +107 -0
- package/es/utils/debug.d.ts +10 -0
- package/es/utils/debug.js +43 -0
- package/es/utils/draggabilly.d.ts +54 -0
- package/es/utils/draggabilly.js +410 -0
- package/es/utils/sniffer.d.ts +28 -0
- package/es/utils/sniffer.js +150 -0
- package/es/utils/url.d.ts +1 -0
- package/es/utils/util.d.ts +304 -0
- package/es/utils/util.js +827 -0
- package/es/utils/xgplayerTimeRange.d.ts +7 -0
- package/es/utils/xgplayerTimeRange.js +25 -0
- package/es/version.d.ts +2 -0
- package/es/version.js +2 -0
- package/package.json +2 -3
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import { inherits as _inherits, createSuper as _createSuper, createClass as _createClass, classCallCheck as _classCallCheck, get as _get, getPrototypeOf as _getPrototypeOf, typeof as _typeof } from "../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import BasePlugin from "./basePlugin.js";
|
|
3
|
+
import _delegate from "delegate";
|
|
4
|
+
import XG_DEBUG from "../utils/debug.js";
|
|
5
|
+
import util from "../utils/util.js";
|
|
6
|
+
var ROOT_TYPES = {
|
|
7
|
+
CONTROLS: "controls",
|
|
8
|
+
ROOT: "root"
|
|
9
|
+
};
|
|
10
|
+
var POSITIONS = {
|
|
11
|
+
ROOT: "root",
|
|
12
|
+
ROOT_LEFT: "rootLeft",
|
|
13
|
+
ROOT_RIGHT: "rootRight",
|
|
14
|
+
ROOT_TOP: "rootTop",
|
|
15
|
+
CONTROLS_LEFT: "controlsLeft",
|
|
16
|
+
CONTROLS_RIGTH: "controlsRight",
|
|
17
|
+
CONTROLS_RIGHT: "controlsRight",
|
|
18
|
+
CONTROLS_CENTER: "controlsCenter",
|
|
19
|
+
CONTROLS: "controls"
|
|
20
|
+
};
|
|
21
|
+
function isUrl(str) {
|
|
22
|
+
if (!str) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return str.indexOf && /^(?:http|data:|\/)/.test(str);
|
|
26
|
+
}
|
|
27
|
+
function mergeIconClass(icon, classname) {
|
|
28
|
+
if (_typeof(icon) === "object" && icon.class && typeof icon.class === "string") {
|
|
29
|
+
return "".concat(classname, " ").concat(icon.class);
|
|
30
|
+
}
|
|
31
|
+
return classname;
|
|
32
|
+
}
|
|
33
|
+
function mergeIconAttr(icon, attr) {
|
|
34
|
+
if (_typeof(icon) === "object" && icon.attr && _typeof(icon.attr) === "object") {
|
|
35
|
+
Object.keys(icon.attr).map(function(key) {
|
|
36
|
+
attr[key] = icon.attr[key];
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return attr;
|
|
40
|
+
}
|
|
41
|
+
function createIcon(icon, key) {
|
|
42
|
+
var classname = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
43
|
+
var attr = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
44
|
+
var pluginName = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "";
|
|
45
|
+
var newIcon = null;
|
|
46
|
+
if (icon instanceof window.Element) {
|
|
47
|
+
util.addClass(icon, classname);
|
|
48
|
+
Object.keys(attr).map(function(key2) {
|
|
49
|
+
icon.setAttribute(key2, attr[key2]);
|
|
50
|
+
});
|
|
51
|
+
return icon;
|
|
52
|
+
}
|
|
53
|
+
if (isUrl(icon) || isUrl(icon.url)) {
|
|
54
|
+
attr.src = isUrl(icon) ? icon : icon.url || "";
|
|
55
|
+
newIcon = util.createDom(icon.tag || "img", "", attr, "xg-img ".concat(classname));
|
|
56
|
+
return newIcon;
|
|
57
|
+
}
|
|
58
|
+
if (typeof icon === "function") {
|
|
59
|
+
try {
|
|
60
|
+
newIcon = icon();
|
|
61
|
+
if (newIcon instanceof window.Element) {
|
|
62
|
+
util.addClass(newIcon, classname);
|
|
63
|
+
Object.keys(attr).map(function(key2) {
|
|
64
|
+
newIcon.setAttribute(key2, attr[key2]);
|
|
65
|
+
});
|
|
66
|
+
return newIcon;
|
|
67
|
+
} else {
|
|
68
|
+
XG_DEBUG.logWarn("warn>>icons.".concat(key, " in config of plugin named [").concat(pluginName, "] is a function mast return an Element Object"));
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
} catch (e) {
|
|
72
|
+
XG_DEBUG.logError("Plugin named [".concat(pluginName, "]:createIcon"), e);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (typeof icon === "string") {
|
|
77
|
+
return util.createDomFromHtml(icon, attr, classname);
|
|
78
|
+
}
|
|
79
|
+
XG_DEBUG.logWarn("warn>>icons.".concat(key, " in config of plugin named [").concat(pluginName, "] is invalid"));
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
function registerIconsObj(iconsConfig, plugin) {
|
|
83
|
+
var _icons = plugin.config.icons || plugin.playerConfig.icons;
|
|
84
|
+
Object.keys(iconsConfig).map(function(key) {
|
|
85
|
+
var orgIcon = iconsConfig[key];
|
|
86
|
+
var classname = orgIcon && orgIcon.class ? orgIcon.class : "";
|
|
87
|
+
var attr = orgIcon && orgIcon.attr ? orgIcon.attr : {};
|
|
88
|
+
var newIcon = null;
|
|
89
|
+
if (_icons && _icons[key]) {
|
|
90
|
+
classname = mergeIconClass(_icons[key], classname);
|
|
91
|
+
attr = mergeIconAttr(_icons[key], attr);
|
|
92
|
+
newIcon = createIcon(_icons[key], key, classname, attr, plugin.pluginName);
|
|
93
|
+
}
|
|
94
|
+
if (!newIcon && orgIcon) {
|
|
95
|
+
newIcon = createIcon(orgIcon.icon ? orgIcon.icon : orgIcon, attr, classname, {}, plugin.pluginName);
|
|
96
|
+
}
|
|
97
|
+
plugin.icons[key] = newIcon;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function registerTextObj(textConfig, plugin) {
|
|
101
|
+
Object.keys(textConfig).map(function(key) {
|
|
102
|
+
Object.defineProperty(plugin.langText, key, {
|
|
103
|
+
get: function get() {
|
|
104
|
+
var lang = plugin.lang, i18n = plugin.i18n;
|
|
105
|
+
if (i18n[key]) {
|
|
106
|
+
return i18n[key];
|
|
107
|
+
} else {
|
|
108
|
+
return textConfig[key] ? textConfig[key][lang] || "" : "";
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
var Plugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
115
|
+
_inherits(Plugin2, _BasePlugin);
|
|
116
|
+
var _super = _createSuper(Plugin2);
|
|
117
|
+
function Plugin2() {
|
|
118
|
+
var _this;
|
|
119
|
+
var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
120
|
+
_classCallCheck(this, Plugin2);
|
|
121
|
+
_this = _super.call(this, args);
|
|
122
|
+
_this.__delegates = [];
|
|
123
|
+
return _this;
|
|
124
|
+
}
|
|
125
|
+
_createClass(Plugin2, [{
|
|
126
|
+
key: "__init",
|
|
127
|
+
value: function __init(args) {
|
|
128
|
+
_get(_getPrototypeOf(Plugin2.prototype), "__init", this).call(this, args);
|
|
129
|
+
if (!args.root) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
var _parent = args.root;
|
|
133
|
+
var _el = null;
|
|
134
|
+
this.icons = {};
|
|
135
|
+
this.root = null;
|
|
136
|
+
this.parent = null;
|
|
137
|
+
var _orgicons = this.registerIcons() || {};
|
|
138
|
+
registerIconsObj(_orgicons, this);
|
|
139
|
+
this.langText = {};
|
|
140
|
+
var defaultTexConfig = this.registerLanguageTexts() || {};
|
|
141
|
+
registerTextObj(defaultTexConfig, this);
|
|
142
|
+
var renderStr = "";
|
|
143
|
+
try {
|
|
144
|
+
renderStr = this.render();
|
|
145
|
+
} catch (e) {
|
|
146
|
+
XG_DEBUG.logError("Plugin:".concat(this.pluginName, ":render"), e);
|
|
147
|
+
throw new Error("Plugin:".concat(this.pluginName, ":render:").concat(e.message));
|
|
148
|
+
}
|
|
149
|
+
if (renderStr) {
|
|
150
|
+
_el = Plugin2.insert(renderStr, _parent, args.index);
|
|
151
|
+
_el.setAttribute("data-index", args.index);
|
|
152
|
+
} else if (args.tag) {
|
|
153
|
+
_el = util.createDom(args.tag, "", args.attr, args.name);
|
|
154
|
+
_el.setAttribute("data-index", args.index);
|
|
155
|
+
_parent.appendChild(_el);
|
|
156
|
+
} else {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.root = _el;
|
|
160
|
+
this.parent = _parent;
|
|
161
|
+
var attr = this.config.attr || {};
|
|
162
|
+
var style = this.config.style || {};
|
|
163
|
+
this.setAttr(attr);
|
|
164
|
+
this.setStyle(style);
|
|
165
|
+
if (this.config.index) {
|
|
166
|
+
this.root.setAttribute("data-index", this.config.index);
|
|
167
|
+
}
|
|
168
|
+
this.__registerChildren();
|
|
169
|
+
}
|
|
170
|
+
}, {
|
|
171
|
+
key: "__registerChildren",
|
|
172
|
+
value: function __registerChildren() {
|
|
173
|
+
var _this2 = this;
|
|
174
|
+
if (!this.root) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
this._children = [];
|
|
178
|
+
var children = this.children();
|
|
179
|
+
if (children && _typeof(children) === "object") {
|
|
180
|
+
if (Object.keys(children).length > 0) {
|
|
181
|
+
Object.keys(children).map(function(item) {
|
|
182
|
+
var name = item;
|
|
183
|
+
var _plugin = children[name];
|
|
184
|
+
var options = {
|
|
185
|
+
root: _this2.root
|
|
186
|
+
};
|
|
187
|
+
var config, _Plugin;
|
|
188
|
+
if (typeof _plugin === "function") {
|
|
189
|
+
config = _this2.config[name] || {};
|
|
190
|
+
_Plugin = _plugin;
|
|
191
|
+
} else if (_typeof(_plugin) === "object" && typeof _plugin.plugin === "function") {
|
|
192
|
+
config = _plugin.options ? util.deepCopy(_this2.config[name] || {}, _plugin.options) : _this2.config[name] || {};
|
|
193
|
+
_Plugin = _plugin.plugin;
|
|
194
|
+
}
|
|
195
|
+
options.config = config;
|
|
196
|
+
config.index !== void 0 && (options.index = config.index);
|
|
197
|
+
config.root && (options.root = config.root);
|
|
198
|
+
_this2.registerPlugin(_Plugin, options, name);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
key: "updateLang",
|
|
205
|
+
value: function updateLang(lang) {
|
|
206
|
+
if (!lang) {
|
|
207
|
+
lang = this.lang;
|
|
208
|
+
}
|
|
209
|
+
function checkChildren(node, callback) {
|
|
210
|
+
for (var i = 0; i < node.children.length; i++) {
|
|
211
|
+
if (node.children[i].children.length > 0) {
|
|
212
|
+
checkChildren(node.children[i], callback);
|
|
213
|
+
} else {
|
|
214
|
+
callback(node.children[i]);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
var root = this.root, i18n = this.i18n, langText = this.langText;
|
|
219
|
+
if (root) {
|
|
220
|
+
checkChildren(root, function(node) {
|
|
221
|
+
var langKey = node.getAttribute && node.getAttribute("lang-key");
|
|
222
|
+
if (!langKey) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
var langTextShow = i18n[langKey.toUpperCase()] || langText[langKey];
|
|
226
|
+
if (langTextShow) {
|
|
227
|
+
node.innerHTML = typeof langTextShow === "function" ? langTextShow(lang) : langTextShow;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
key: "lang",
|
|
234
|
+
get: function get() {
|
|
235
|
+
return this.player.lang;
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "changeLangTextKey",
|
|
239
|
+
value: function changeLangTextKey(dom) {
|
|
240
|
+
var key = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
241
|
+
var i18n = this.i18n || {};
|
|
242
|
+
var langText = this.langText;
|
|
243
|
+
dom.setAttribute && dom.setAttribute("lang-key", key);
|
|
244
|
+
var text = i18n[key] || langText[key] || "";
|
|
245
|
+
if (text) {
|
|
246
|
+
dom.innerHTML = text;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}, {
|
|
250
|
+
key: "plugins",
|
|
251
|
+
value: function plugins() {
|
|
252
|
+
return this._children;
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
key: "children",
|
|
256
|
+
value: function children() {
|
|
257
|
+
return {};
|
|
258
|
+
}
|
|
259
|
+
}, {
|
|
260
|
+
key: "registerPlugin",
|
|
261
|
+
value: function registerPlugin(plugin) {
|
|
262
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
263
|
+
var name = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
264
|
+
options.root = options.root || this.root;
|
|
265
|
+
var _c = _get(_getPrototypeOf(Plugin2.prototype), "registerPlugin", this).call(this, plugin, options, name);
|
|
266
|
+
this._children.push(_c);
|
|
267
|
+
return _c;
|
|
268
|
+
}
|
|
269
|
+
}, {
|
|
270
|
+
key: "registerIcons",
|
|
271
|
+
value: function registerIcons() {
|
|
272
|
+
return {};
|
|
273
|
+
}
|
|
274
|
+
}, {
|
|
275
|
+
key: "registerLanguageTexts",
|
|
276
|
+
value: function registerLanguageTexts() {
|
|
277
|
+
return {};
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "find",
|
|
281
|
+
value: function find(qs) {
|
|
282
|
+
if (!this.root) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
return this.root.querySelector(qs);
|
|
286
|
+
}
|
|
287
|
+
}, {
|
|
288
|
+
key: "bind",
|
|
289
|
+
value: function bind(querySelector, eventType, callback) {
|
|
290
|
+
var _this3 = this;
|
|
291
|
+
if (arguments.length < 3 && typeof eventType === "function") {
|
|
292
|
+
if (Array.isArray(querySelector)) {
|
|
293
|
+
querySelector.forEach(function(item) {
|
|
294
|
+
_this3.bindEL(item, eventType);
|
|
295
|
+
});
|
|
296
|
+
} else {
|
|
297
|
+
this.bindEL(querySelector, eventType);
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
var ret = Plugin2.delegate.call(this, this.root, querySelector, eventType, callback);
|
|
301
|
+
this.__delegates = this.__delegates.concat(ret);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}, {
|
|
305
|
+
key: "unbind",
|
|
306
|
+
value: function unbind(querySelector, eventType) {
|
|
307
|
+
var _this4 = this;
|
|
308
|
+
if (arguments.length < 3 && typeof eventType === "function") {
|
|
309
|
+
if (Array.isArray(querySelector)) {
|
|
310
|
+
querySelector.forEach(function(item) {
|
|
311
|
+
_this4.unbindEL(item, eventType);
|
|
312
|
+
});
|
|
313
|
+
} else {
|
|
314
|
+
this.unbindEL(querySelector, eventType);
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
var key = "".concat(querySelector, "_").concat(eventType);
|
|
318
|
+
for (var i = 0; i < this.__delegates.length; i++) {
|
|
319
|
+
if (this.__delegates[i].key === key) {
|
|
320
|
+
this.__delegates[i].destroy();
|
|
321
|
+
this.__delegates.splice(i, 1);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}, {
|
|
328
|
+
key: "setStyle",
|
|
329
|
+
value: function setStyle(name, value) {
|
|
330
|
+
var _this5 = this;
|
|
331
|
+
if (!this.root) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (util.typeOf(name) === "String") {
|
|
335
|
+
return this.root.style[name] = value;
|
|
336
|
+
} else if (util.typeOf(name) === "Object") {
|
|
337
|
+
Object.keys(name).map(function(key) {
|
|
338
|
+
_this5.root.style[key] = name[key];
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}, {
|
|
343
|
+
key: "setAttr",
|
|
344
|
+
value: function setAttr(name, value) {
|
|
345
|
+
var _this6 = this;
|
|
346
|
+
if (!this.root) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (util.typeOf(name) === "String") {
|
|
350
|
+
return this.root.setAttribute(name, value);
|
|
351
|
+
} else if (util.typeOf(name) === "Object") {
|
|
352
|
+
Object.keys(name).map(function(key) {
|
|
353
|
+
_this6.root.setAttribute(key, name[key]);
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}, {
|
|
358
|
+
key: "setHtml",
|
|
359
|
+
value: function setHtml(htmlStr, callback) {
|
|
360
|
+
if (!this.root) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
this.root.innerHTML = htmlStr;
|
|
364
|
+
if (typeof callback === "function") {
|
|
365
|
+
callback();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}, {
|
|
369
|
+
key: "bindEL",
|
|
370
|
+
value: function bindEL(event, eventHandle) {
|
|
371
|
+
var isBubble = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
372
|
+
if (!this.root) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if ("on".concat(event) in this.root && typeof eventHandle === "function") {
|
|
376
|
+
this.root.addEventListener(event, eventHandle, isBubble);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "unbindEL",
|
|
381
|
+
value: function unbindEL(event, eventHandle) {
|
|
382
|
+
var isBubble = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
383
|
+
if (!this.root) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if ("on".concat(event) in this.root && typeof eventHandle === "function") {
|
|
387
|
+
this.root.removeEventListener(event, eventHandle, isBubble);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}, {
|
|
391
|
+
key: "show",
|
|
392
|
+
value: function show(value) {
|
|
393
|
+
if (!this.root) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
this.root.style.display = value !== void 0 ? value : "block";
|
|
397
|
+
var cs = window.getComputedStyle(this.root, null);
|
|
398
|
+
var cssDisplayValue = cs.getPropertyValue("display");
|
|
399
|
+
if (cssDisplayValue === "none") {
|
|
400
|
+
return this.root.style.display = "block";
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
key: "hide",
|
|
405
|
+
value: function hide() {
|
|
406
|
+
this.root && (this.root.style.display = "none");
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
key: "appendChild",
|
|
410
|
+
value: function appendChild(pdom, child) {
|
|
411
|
+
if (!this.root) {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
if (arguments.length < 2 && arguments[0] instanceof window.Element) {
|
|
415
|
+
return this.root.appendChild(arguments[0]);
|
|
416
|
+
}
|
|
417
|
+
if (!child || !(child instanceof window.Element)) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
try {
|
|
421
|
+
if (typeof pdom === "string") {
|
|
422
|
+
return this.find(pdom).appendChild(child);
|
|
423
|
+
} else {
|
|
424
|
+
return pdom.appendChild(child);
|
|
425
|
+
}
|
|
426
|
+
} catch (err) {
|
|
427
|
+
XG_DEBUG.logError("Plugin:appendChild", err);
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}, {
|
|
432
|
+
key: "render",
|
|
433
|
+
value: function render() {
|
|
434
|
+
return "";
|
|
435
|
+
}
|
|
436
|
+
}, {
|
|
437
|
+
key: "destroy",
|
|
438
|
+
value: function destroy() {
|
|
439
|
+
}
|
|
440
|
+
}, {
|
|
441
|
+
key: "__destroy",
|
|
442
|
+
value: function __destroy() {
|
|
443
|
+
var _this7 = this;
|
|
444
|
+
var player = this.player;
|
|
445
|
+
this.__delegates.map(function(item) {
|
|
446
|
+
item.destroy();
|
|
447
|
+
});
|
|
448
|
+
this.__delegates = [];
|
|
449
|
+
if (this._children instanceof Array) {
|
|
450
|
+
this._children.map(function(item) {
|
|
451
|
+
player.unRegisterPlugin(item.pluginName);
|
|
452
|
+
});
|
|
453
|
+
this._children = null;
|
|
454
|
+
}
|
|
455
|
+
if (this.root) {
|
|
456
|
+
if (this.root.hasOwnProperty("remove")) {
|
|
457
|
+
this.root.remove();
|
|
458
|
+
} else if (this.root.parentNode) {
|
|
459
|
+
this.root.parentNode.removeChild(this.root);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
_get(_getPrototypeOf(Plugin2.prototype), "__destroy", this).call(this);
|
|
463
|
+
this.icons = {};
|
|
464
|
+
["root", "parent"].map(function(item) {
|
|
465
|
+
_this7[item] = null;
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
}], [{
|
|
469
|
+
key: "insert",
|
|
470
|
+
value: function insert(html, parent) {
|
|
471
|
+
var index = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
472
|
+
var len = parent.children.length;
|
|
473
|
+
var insertIdx = Number(index);
|
|
474
|
+
var isDomElement = html instanceof window.Node;
|
|
475
|
+
if (len) {
|
|
476
|
+
var i = 0;
|
|
477
|
+
var coordinate = null;
|
|
478
|
+
var mode = "";
|
|
479
|
+
for (; i < len; i++) {
|
|
480
|
+
coordinate = parent.children[i];
|
|
481
|
+
var curIdx = Number(coordinate.getAttribute("data-index"));
|
|
482
|
+
if (curIdx >= insertIdx) {
|
|
483
|
+
mode = "beforebegin";
|
|
484
|
+
break;
|
|
485
|
+
} else if (curIdx < insertIdx) {
|
|
486
|
+
mode = "afterend";
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (isDomElement) {
|
|
490
|
+
if (mode === "afterend") {
|
|
491
|
+
parent.appendChild(html);
|
|
492
|
+
} else {
|
|
493
|
+
parent.insertBefore(html, coordinate);
|
|
494
|
+
}
|
|
495
|
+
} else {
|
|
496
|
+
coordinate.insertAdjacentHTML(mode, html);
|
|
497
|
+
}
|
|
498
|
+
return mode === "afterend" ? parent.children[parent.children.length - 1] : parent.children[i];
|
|
499
|
+
} else {
|
|
500
|
+
isDomElement ? parent.appendChild(html) : parent.insertAdjacentHTML("beforeend", html);
|
|
501
|
+
return parent.children[parent.children.length - 1];
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}, {
|
|
505
|
+
key: "defaultConfig",
|
|
506
|
+
get: function get() {
|
|
507
|
+
return {};
|
|
508
|
+
}
|
|
509
|
+
}, {
|
|
510
|
+
key: "delegate",
|
|
511
|
+
value: function delegate(root, querySelector, eventType, callback) {
|
|
512
|
+
var capture = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
|
|
513
|
+
var dels = [];
|
|
514
|
+
if (root instanceof window.Node && typeof callback === "function") {
|
|
515
|
+
if (Array.isArray(eventType)) {
|
|
516
|
+
eventType.forEach(function(item) {
|
|
517
|
+
var ret2 = _delegate(root, querySelector, item, callback, capture);
|
|
518
|
+
ret2.key = "".concat(querySelector, "_").concat(item);
|
|
519
|
+
dels.push(ret2);
|
|
520
|
+
});
|
|
521
|
+
} else {
|
|
522
|
+
var ret = _delegate(root, querySelector, eventType, callback, capture);
|
|
523
|
+
ret.key = "".concat(querySelector, "_").concat(eventType);
|
|
524
|
+
dels.push(ret);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
return dels;
|
|
528
|
+
}
|
|
529
|
+
}, {
|
|
530
|
+
key: "ROOT_TYPES",
|
|
531
|
+
get: function get() {
|
|
532
|
+
return ROOT_TYPES;
|
|
533
|
+
}
|
|
534
|
+
}, {
|
|
535
|
+
key: "POSITIONS",
|
|
536
|
+
get: function get() {
|
|
537
|
+
return POSITIONS;
|
|
538
|
+
}
|
|
539
|
+
}]);
|
|
540
|
+
return Plugin2;
|
|
541
|
+
}(BasePlugin);
|
|
542
|
+
export { POSITIONS, ROOT_TYPES, Plugin as default };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export default pluginsManager;
|
|
2
|
+
declare namespace pluginsManager {
|
|
3
|
+
const pluginGroup: {};
|
|
4
|
+
function init(player: any): void;
|
|
5
|
+
function init(player: any): void;
|
|
6
|
+
/**
|
|
7
|
+
* Check whether there is a player instance in the current dom
|
|
8
|
+
* @param {Element} root
|
|
9
|
+
*/
|
|
10
|
+
function checkPlayerRoot(root: Element): any;
|
|
11
|
+
/**
|
|
12
|
+
* Check whether there is a player instance in the current dom
|
|
13
|
+
* @param {Element} root
|
|
14
|
+
*/
|
|
15
|
+
function checkPlayerRoot(root: Element): any;
|
|
16
|
+
function formatPluginInfo(plugin: any, config: any): {
|
|
17
|
+
PLUFGIN: any;
|
|
18
|
+
options: any;
|
|
19
|
+
};
|
|
20
|
+
function formatPluginInfo(plugin: any, config: any): {
|
|
21
|
+
PLUFGIN: any;
|
|
22
|
+
options: any;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* check the plugin if exits in plugins
|
|
26
|
+
* @param {string} pluginName
|
|
27
|
+
* @param { Array <any> } plugins
|
|
28
|
+
* @returns boolean
|
|
29
|
+
*/
|
|
30
|
+
function checkPluginIfExits(pluginName: string, plugins: any[]): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* check the plugin if exits in plugins
|
|
33
|
+
* @param {string} pluginName
|
|
34
|
+
* @param { Array <any> } plugins
|
|
35
|
+
* @returns boolean
|
|
36
|
+
*/
|
|
37
|
+
function checkPluginIfExits(pluginName: string, plugins: any[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* get plugin Config from playerConfig
|
|
40
|
+
* @param { string } pluginName
|
|
41
|
+
* @param { {[propName: string]: any;} } playerConfig
|
|
42
|
+
* @return { {[propName: string]: any;} } pluginConfig
|
|
43
|
+
*/
|
|
44
|
+
function getRootByConfig(pluginName: string, playerConfig: {
|
|
45
|
+
[propName: string]: any;
|
|
46
|
+
}): {
|
|
47
|
+
[propName: string]: any;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* get plugin Config from playerConfig
|
|
51
|
+
* @param { string } pluginName
|
|
52
|
+
* @param { {[propName: string]: any;} } playerConfig
|
|
53
|
+
* @return { {[propName: string]: any;} } pluginConfig
|
|
54
|
+
*/
|
|
55
|
+
function getRootByConfig(pluginName: string, playerConfig: {
|
|
56
|
+
[propName: string]: any;
|
|
57
|
+
}): {
|
|
58
|
+
[propName: string]: any;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* register a lazy plugin
|
|
62
|
+
* @param { any } player instance
|
|
63
|
+
* @param { any } lazyPlugin config
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
function lazyRegister(player: any, lazyPlugin: any): Promise<any>;
|
|
67
|
+
/**
|
|
68
|
+
* register a lazy plugin
|
|
69
|
+
* @param { any } player instance
|
|
70
|
+
* @param { any } lazyPlugin config
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
function lazyRegister(player: any, lazyPlugin: any): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* register a Plugin
|
|
76
|
+
* @param { any } player the plugins register
|
|
77
|
+
* @param { any } plugin the plugin contructor
|
|
78
|
+
* @param { any } options the plugin configuration
|
|
79
|
+
* @return { any } Plugin the plugin instance
|
|
80
|
+
**/
|
|
81
|
+
function register(player: any, plugin: any, options?: any): any;
|
|
82
|
+
/**
|
|
83
|
+
* register a Plugin
|
|
84
|
+
* @param { any } player the plugins register
|
|
85
|
+
* @param { any } plugin the plugin contructor
|
|
86
|
+
* @param { any } options the plugin configuration
|
|
87
|
+
* @return { any } Plugin the plugin instance
|
|
88
|
+
**/
|
|
89
|
+
function register(player: any, plugin: any, options?: any): any;
|
|
90
|
+
/**
|
|
91
|
+
* Unregister a plugin from player instance
|
|
92
|
+
* @param { string } cgid
|
|
93
|
+
* @param { string } name
|
|
94
|
+
*/
|
|
95
|
+
function unRegister(cgid: string, name: string): void;
|
|
96
|
+
/**
|
|
97
|
+
* Unregister a plugin from player instance
|
|
98
|
+
* @param { string } cgid
|
|
99
|
+
* @param { string } name
|
|
100
|
+
*/
|
|
101
|
+
function unRegister(cgid: string, name: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* remove a plugin instance from the player plugin list
|
|
104
|
+
* @param { any } player
|
|
105
|
+
* @param { string } name
|
|
106
|
+
*/
|
|
107
|
+
function deletePlugin(player: any, name: string): void;
|
|
108
|
+
/**
|
|
109
|
+
* remove a plugin instance from the player plugin list
|
|
110
|
+
* @param { any } player
|
|
111
|
+
* @param { string } name
|
|
112
|
+
*/
|
|
113
|
+
function deletePlugin(player: any, name: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* get all plugin instance of player
|
|
116
|
+
* @param { any } player
|
|
117
|
+
*/
|
|
118
|
+
function getPlugins(player: any): any;
|
|
119
|
+
/**
|
|
120
|
+
* get all plugin instance of player
|
|
121
|
+
* @param { any } player
|
|
122
|
+
*/
|
|
123
|
+
function getPlugins(player: any): any;
|
|
124
|
+
function findPlugin(player: any, name: any): any;
|
|
125
|
+
function findPlugin(player: any, name: any): any;
|
|
126
|
+
function beforeInit(player: any): Promise<any>;
|
|
127
|
+
function beforeInit(player: any): Promise<any>;
|
|
128
|
+
function afterInit(player: any): void;
|
|
129
|
+
function afterInit(player: any): void;
|
|
130
|
+
function setLang(lang: any, player: any): void;
|
|
131
|
+
function setLang(lang: any, player: any): void;
|
|
132
|
+
function reRender(player: any): void;
|
|
133
|
+
function reRender(player: any): void;
|
|
134
|
+
function onPluginsReady(player: any): void;
|
|
135
|
+
function onPluginsReady(player: any): void;
|
|
136
|
+
/**
|
|
137
|
+
* 设置实例的用户行为激活状态
|
|
138
|
+
* @param { number | string } playerId
|
|
139
|
+
* @param { boolean } isActive
|
|
140
|
+
* @returns { number | null }
|
|
141
|
+
*/
|
|
142
|
+
function setCurrentUserActive(playerId: string | number, isActive: boolean): number;
|
|
143
|
+
/**
|
|
144
|
+
* 设置实例的用户行为激活状态
|
|
145
|
+
* @param { number | string } playerId
|
|
146
|
+
* @param { boolean } isActive
|
|
147
|
+
* @returns { number | null }
|
|
148
|
+
*/
|
|
149
|
+
function setCurrentUserActive(playerId: string | number, isActive: boolean): number;
|
|
150
|
+
/**
|
|
151
|
+
* 获取当前处理激活态的实例id
|
|
152
|
+
* @returns { number | null }
|
|
153
|
+
*/
|
|
154
|
+
function getCurrentUseActiveId(): number;
|
|
155
|
+
/**
|
|
156
|
+
* 获取当前处理激活态的实例id
|
|
157
|
+
* @returns { number | null }
|
|
158
|
+
*/
|
|
159
|
+
function getCurrentUseActiveId(): number;
|
|
160
|
+
function destroy(player: any): void;
|
|
161
|
+
function destroy(player: any): void;
|
|
162
|
+
}
|