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,164 @@
|
|
|
1
|
+
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass, objectSpread2 as _objectSpread2, get as _get, getPrototypeOf as _getPrototypeOf } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import util from "../../utils/util.js";
|
|
3
|
+
import { DEFINITION_CHANGE } from "../../events.js";
|
|
4
|
+
import "../../utils/debug.js";
|
|
5
|
+
import { POSITIONS } from "../../plugin/plugin.js";
|
|
6
|
+
import OptionsIcon from "../common/optionsIcon.js";
|
|
7
|
+
var DefinitionIcon = /* @__PURE__ */ function(_OptionsIcon) {
|
|
8
|
+
_inherits(DefinitionIcon2, _OptionsIcon);
|
|
9
|
+
var _super = _createSuper(DefinitionIcon2);
|
|
10
|
+
function DefinitionIcon2(args) {
|
|
11
|
+
var _this;
|
|
12
|
+
_classCallCheck(this, DefinitionIcon2);
|
|
13
|
+
_this = _super.call(this, args);
|
|
14
|
+
_this.curTime = 0;
|
|
15
|
+
_this.isPaused = true;
|
|
16
|
+
return _this;
|
|
17
|
+
}
|
|
18
|
+
_createClass(DefinitionIcon2, [{
|
|
19
|
+
key: "beforeCreate",
|
|
20
|
+
value: function beforeCreate(args) {
|
|
21
|
+
var list = args.config.list;
|
|
22
|
+
if (Array.isArray(list) && list.length > 0) {
|
|
23
|
+
args.config.list = list.map(function(item) {
|
|
24
|
+
if (!item.text && item.name) {
|
|
25
|
+
item.text = item.name;
|
|
26
|
+
}
|
|
27
|
+
if (!item.text) {
|
|
28
|
+
item.text = item.definition;
|
|
29
|
+
}
|
|
30
|
+
return item;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "afterCreate",
|
|
36
|
+
value: function afterCreate() {
|
|
37
|
+
var _this2 = this;
|
|
38
|
+
_get(_getPrototypeOf(DefinitionIcon2.prototype), "afterCreate", this).call(this);
|
|
39
|
+
this.on("resourceReady", function(list) {
|
|
40
|
+
_this2.changeDefinitionList(list);
|
|
41
|
+
});
|
|
42
|
+
this.on(DEFINITION_CHANGE, function(data) {
|
|
43
|
+
_this2.renderItemList(_this2.config.list, data.to);
|
|
44
|
+
});
|
|
45
|
+
if (this.player.definitionList.length < 2) {
|
|
46
|
+
this.hide();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, {
|
|
50
|
+
key: "show",
|
|
51
|
+
value: function show() {
|
|
52
|
+
if (!this.config.list || this.config.list.length < 2) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
util.addClass(this.root, "show");
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "initDefinition",
|
|
59
|
+
value: function initDefinition() {
|
|
60
|
+
var _this$config = this.config, list = _this$config.list, defaultDefinition = _this$config.defaultDefinition;
|
|
61
|
+
if (list.length > 0) {
|
|
62
|
+
var to = null;
|
|
63
|
+
list.map(function(item) {
|
|
64
|
+
if (item.definition === defaultDefinition) {
|
|
65
|
+
to = item;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
if (!to) {
|
|
69
|
+
to = list[0];
|
|
70
|
+
}
|
|
71
|
+
this.changeDefinition(to);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "renderItemList",
|
|
76
|
+
value: function renderItemList() {
|
|
77
|
+
var _this3 = this;
|
|
78
|
+
var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.config.list || [];
|
|
79
|
+
var to = arguments.length > 1 ? arguments[1] : void 0;
|
|
80
|
+
var targetDef = to && to.definition ? to.definition : this.config.defaultDefinition;
|
|
81
|
+
if (to) {
|
|
82
|
+
list.forEach(function(item) {
|
|
83
|
+
item.selected = false;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var curIndex = 0;
|
|
87
|
+
var items = list.map(function(item, index) {
|
|
88
|
+
var showItem = _objectSpread2(_objectSpread2({}, item), {}, {
|
|
89
|
+
showText: _this3.getTextByLang(item) || item.definition,
|
|
90
|
+
selected: false
|
|
91
|
+
});
|
|
92
|
+
if (item.selected || item.definition && item.definition == targetDef) {
|
|
93
|
+
showItem.selected = true;
|
|
94
|
+
curIndex = index;
|
|
95
|
+
}
|
|
96
|
+
return showItem;
|
|
97
|
+
});
|
|
98
|
+
_get(_getPrototypeOf(DefinitionIcon2.prototype), "renderItemList", this).call(this, items, curIndex);
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "changeDefinitionList",
|
|
102
|
+
value: function changeDefinitionList(list) {
|
|
103
|
+
if (!Array.isArray(list)) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this.config.list = list.map(function(item) {
|
|
107
|
+
if (!item.text && item.name) {
|
|
108
|
+
item.text = item.name;
|
|
109
|
+
}
|
|
110
|
+
if (!item.text) {
|
|
111
|
+
item.text = item.definition;
|
|
112
|
+
}
|
|
113
|
+
return item;
|
|
114
|
+
});
|
|
115
|
+
this.renderItemList();
|
|
116
|
+
this.config.list.length < 2 ? this.hide() : this.show();
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "changeDefinition",
|
|
120
|
+
value: function changeDefinition(to, from) {
|
|
121
|
+
this.player.changeDefinition(to, from);
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "onItemClick",
|
|
125
|
+
value: function onItemClick(e, data) {
|
|
126
|
+
var definitionList = this.player.definitionList;
|
|
127
|
+
_get(_getPrototypeOf(DefinitionIcon2.prototype), "onItemClick", this).apply(this, arguments);
|
|
128
|
+
this.emitUserAction(e, "change_definition", {
|
|
129
|
+
from: data.from,
|
|
130
|
+
to: data.to
|
|
131
|
+
});
|
|
132
|
+
for (var i = 0; i < definitionList.length; i++) {
|
|
133
|
+
if (data.to && definitionList[i].definition === data.to.definition) {
|
|
134
|
+
data.to.url = definitionList[i].url;
|
|
135
|
+
}
|
|
136
|
+
if (data.from && definitionList[i].definition === data.from.definition) {
|
|
137
|
+
data.from.url = definitionList[i].url;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
this.player.changeDefinition(data.to, data.from);
|
|
141
|
+
}
|
|
142
|
+
}], [{
|
|
143
|
+
key: "pluginName",
|
|
144
|
+
get: function get() {
|
|
145
|
+
return "definition";
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "defaultConfig",
|
|
149
|
+
get: function get() {
|
|
150
|
+
return _objectSpread2(_objectSpread2({}, OptionsIcon.defaultConfig), {}, {
|
|
151
|
+
position: POSITIONS.CONTROLS_RIGHT,
|
|
152
|
+
index: 3,
|
|
153
|
+
list: [],
|
|
154
|
+
defaultDefinition: "",
|
|
155
|
+
disable: false,
|
|
156
|
+
hidePortrait: false,
|
|
157
|
+
className: "xgplayer-definition",
|
|
158
|
+
isShowIcon: true
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}]);
|
|
162
|
+
return DefinitionIcon2;
|
|
163
|
+
}(OptionsIcon);
|
|
164
|
+
export { DefinitionIcon as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { {
|
|
3
|
+
* position: string,
|
|
4
|
+
* index: number,
|
|
5
|
+
* disable: boolean,
|
|
6
|
+
* [propName: string]: any
|
|
7
|
+
* } } IDownloadConfig
|
|
8
|
+
*/
|
|
9
|
+
export default class Download extends IconPlugin {
|
|
10
|
+
/**
|
|
11
|
+
* @type IDownloadConfig
|
|
12
|
+
*/
|
|
13
|
+
static get defaultConfig(): IDownloadConfig;
|
|
14
|
+
constructor(args: any);
|
|
15
|
+
timer: any;
|
|
16
|
+
isLock: boolean;
|
|
17
|
+
_handler: any;
|
|
18
|
+
registerIcons(): {
|
|
19
|
+
download: any;
|
|
20
|
+
};
|
|
21
|
+
download: (e: any) => void;
|
|
22
|
+
getAbsoluteURL(url: any): any;
|
|
23
|
+
render(): string;
|
|
24
|
+
}
|
|
25
|
+
export type IDownloadConfig = {
|
|
26
|
+
[propName: string]: any;
|
|
27
|
+
position: string;
|
|
28
|
+
index: number;
|
|
29
|
+
disable: boolean;
|
|
30
|
+
};
|
|
31
|
+
import IconPlugin from "../common/iconPlugin";
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass, get as _get, getPrototypeOf as _getPrototypeOf } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import downloadUtil from "downloadjs";
|
|
3
|
+
import util from "../../utils/util.js";
|
|
4
|
+
import "../../utils/debug.js";
|
|
5
|
+
import { POSITIONS } from "../../plugin/plugin.js";
|
|
6
|
+
import { xgIconTips } from "../common/iconTools.js";
|
|
7
|
+
import Icon from "../common/iconPlugin.js";
|
|
8
|
+
import DownloadSvg from "../assets/download.js";
|
|
9
|
+
var Download = /* @__PURE__ */ function(_IconPlugin) {
|
|
10
|
+
_inherits(Download2, _IconPlugin);
|
|
11
|
+
var _super = _createSuper(Download2);
|
|
12
|
+
function Download2(args) {
|
|
13
|
+
var _this;
|
|
14
|
+
_classCallCheck(this, Download2);
|
|
15
|
+
_this = _super.call(this, args);
|
|
16
|
+
_defineProperty(_assertThisInitialized(_this), "download", function(e) {
|
|
17
|
+
if (_this.isLock) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
_this.emitUserAction(e, "download");
|
|
21
|
+
var url = _this.playerConfig.url;
|
|
22
|
+
var dUrl = "";
|
|
23
|
+
if (util.typeOf(url) === "String") {
|
|
24
|
+
dUrl = url;
|
|
25
|
+
} else if (util.typeOf(url) === "Array" && url.length > 0) {
|
|
26
|
+
dUrl = url[0].src;
|
|
27
|
+
}
|
|
28
|
+
var newUrl = _this.getAbsoluteURL(dUrl);
|
|
29
|
+
downloadUtil(newUrl);
|
|
30
|
+
_this.isLock = true;
|
|
31
|
+
_this.timer = window.setTimeout(function() {
|
|
32
|
+
_this.isLock = false;
|
|
33
|
+
window.clearTimeout(_this.timer);
|
|
34
|
+
_this.timer = null;
|
|
35
|
+
}, 300);
|
|
36
|
+
});
|
|
37
|
+
_this.timer = null;
|
|
38
|
+
_this.isLock = false;
|
|
39
|
+
return _this;
|
|
40
|
+
}
|
|
41
|
+
_createClass(Download2, [{
|
|
42
|
+
key: "afterCreate",
|
|
43
|
+
value: function afterCreate() {
|
|
44
|
+
_get(_getPrototypeOf(Download2.prototype), "afterCreate", this).call(this);
|
|
45
|
+
if (this.config.disable) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.appendChild(".xgplayer-icon", this.icons.download);
|
|
49
|
+
this._handler = this.hook("click", this.download, {
|
|
50
|
+
pre: function pre(e) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.bind(["click", "touchend"], this._handler);
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "registerIcons",
|
|
59
|
+
value: function registerIcons() {
|
|
60
|
+
return {
|
|
61
|
+
download: DownloadSvg
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "getAbsoluteURL",
|
|
66
|
+
value: function getAbsoluteURL(url) {
|
|
67
|
+
if (!url.match(/^https?:\/\//)) {
|
|
68
|
+
var div = document.createElement("div");
|
|
69
|
+
div.innerHTML = '<a href="'.concat(url, '">x</a>');
|
|
70
|
+
url = div.firstChild.href;
|
|
71
|
+
}
|
|
72
|
+
return url;
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "destroy",
|
|
76
|
+
value: function destroy() {
|
|
77
|
+
_get(_getPrototypeOf(Download2.prototype), "destroy", this).call(this);
|
|
78
|
+
this.unbind(["click", "touchend"], this.download);
|
|
79
|
+
window.clearTimeout(this.timer);
|
|
80
|
+
this.timer = null;
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "render",
|
|
84
|
+
value: function render() {
|
|
85
|
+
if (this.config.disable) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
return '<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this, "DOWNLOAD_TIPS", this.playerConfig.isHideTips), "\n </xg-icon>");
|
|
89
|
+
}
|
|
90
|
+
}], [{
|
|
91
|
+
key: "pluginName",
|
|
92
|
+
get: function get() {
|
|
93
|
+
return "download";
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "defaultConfig",
|
|
97
|
+
get: function get() {
|
|
98
|
+
return {
|
|
99
|
+
position: POSITIONS.CONTROLS_RIGHT,
|
|
100
|
+
index: 3,
|
|
101
|
+
disable: true
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}]);
|
|
105
|
+
return Download2;
|
|
106
|
+
}(Icon);
|
|
107
|
+
export { Download as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.xgplayer {
|
|
2
|
+
.xgplayer-download {
|
|
3
|
+
position: relative;
|
|
4
|
+
// order: 9;
|
|
5
|
+
display: block;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
.lang-is-en {
|
|
10
|
+
.xgplayer-download {
|
|
11
|
+
.xgplayer-tips {
|
|
12
|
+
margin-left: -32px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
.lang-is-jp {
|
|
17
|
+
.xgplayer-download {
|
|
18
|
+
.xgplayer-tips {
|
|
19
|
+
margin-left: -40px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.xgplayer-dynamic-bg, .xgplayer-dynamic-bg canvas, .xgplayer-dynamic-bg xgmask, .xgplayer-dynamic-bg xgfilter {
|
|
2
|
+
display: block;
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: 0;
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.xgplayer-dynamic-bg canvas {
|
|
12
|
+
transform: translateZ(0);
|
|
13
|
+
}
|
|
14
|
+
.xgplayer-dynamic-bg xgmask {
|
|
15
|
+
background: rgba(0, 0, 0, 0.7);
|
|
16
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export default DynamicBg;
|
|
2
|
+
export type IDynamicBgConfig = {
|
|
3
|
+
[propName: string]: any;
|
|
4
|
+
disable?: boolean;
|
|
5
|
+
mode?: "realtime" | "firstframe" | "framerate";
|
|
6
|
+
frameRate?: number;
|
|
7
|
+
filter?: string;
|
|
8
|
+
addMask?: boolean;
|
|
9
|
+
maskBg?: string;
|
|
10
|
+
multiple?: number;
|
|
11
|
+
};
|
|
12
|
+
declare class DynamicBg extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @type IDynamicBgConfig
|
|
15
|
+
*/
|
|
16
|
+
static get defaultConfig(): IDynamicBgConfig;
|
|
17
|
+
/**
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @description Does the current environment support Canvas
|
|
20
|
+
*/
|
|
21
|
+
static get isSupport(): boolean;
|
|
22
|
+
static supportCanvasFilter(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
private _pos;
|
|
27
|
+
/**
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
readonly isStart: boolean;
|
|
31
|
+
_isLoaded: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @readonly
|
|
34
|
+
*/
|
|
35
|
+
readonly videoPI: number;
|
|
36
|
+
/**
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
readonly preTime: number;
|
|
40
|
+
/**
|
|
41
|
+
* @readonly
|
|
42
|
+
*/
|
|
43
|
+
readonly interval: number;
|
|
44
|
+
/**
|
|
45
|
+
* @readonly
|
|
46
|
+
*/
|
|
47
|
+
readonly canvas: HTMLElement;
|
|
48
|
+
/**
|
|
49
|
+
* @readonly
|
|
50
|
+
*/
|
|
51
|
+
readonly canvasCtx: any;
|
|
52
|
+
_frameCount: any;
|
|
53
|
+
onLoadedData: (e: any) => void;
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
* 初始化 canvas对象并使用海报图先渲染首帧w11
|
|
57
|
+
*/
|
|
58
|
+
private init;
|
|
59
|
+
canvasFilter: boolean;
|
|
60
|
+
root: HTMLElement;
|
|
61
|
+
mask: HTMLElement;
|
|
62
|
+
/**
|
|
63
|
+
* Check whether the current video object supports screenshots
|
|
64
|
+
* @param { Object } video
|
|
65
|
+
* @returns { DomElement | null }
|
|
66
|
+
*/
|
|
67
|
+
checkVideoIsSupport(video: any): DomElement | null;
|
|
68
|
+
renderByPoster(): void;
|
|
69
|
+
renderOnTimeupdate: (e: any) => void;
|
|
70
|
+
_checkIfCanStart(): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* just render once
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
renderOnce(): void;
|
|
76
|
+
start: () => void;
|
|
77
|
+
frameId: any;
|
|
78
|
+
stop: () => void;
|
|
79
|
+
updateImg(url: any): void;
|
|
80
|
+
update(video: any, sourcePI: any): void;
|
|
81
|
+
render(): string;
|
|
82
|
+
}
|
|
83
|
+
import Plugin from "../../plugin";
|