xgplayer 3.0.12-rc.0 → 3.0.13
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/CHANGELOG.md +5 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +1 -0
- package/es/index.umd.d.ts +2 -0
- package/es/index.umd.js +2 -0
- package/es/instManager.d.ts +58 -0
- package/es/instManager.js +151 -0
- package/es/lang/br.d.ts +91 -0
- package/es/lang/de.d.ts +91 -0
- package/es/lang/es.d.ts +91 -0
- package/es/lang/fr.d.ts +91 -0
- package/es/lang/id.d.ts +91 -0
- package/es/lang/it.d.ts +91 -0
- package/es/lang/kr.d.ts +91 -0
- package/es/lang/ms-my.d.ts +91 -0
- package/es/lang/ru.d.ts +91 -0
- package/es/lang/th.d.ts +91 -0
- package/es/lang/vn.d.ts +91 -0
- package/es/mediaProxy.d.ts +5 -0
- package/es/player.d.ts +28 -8
- package/es/player.js +45 -23
- package/es/plugin/basePlugin.d.ts +2 -2
- package/es/plugin/plugin.d.ts +6 -7
- package/es/plugin/plugin.js +1 -1
- package/es/plugin/pluginsManager.d.ts +0 -34
- package/es/plugin/pluginsManager.js +1 -49
- package/es/plugins/common/optionsIcon.d.ts +0 -1
- package/es/plugins/common/optionsIcon.js +1 -1
- package/es/plugins/controls/index.d.ts +0 -1
- package/es/plugins/controls/index.js +1 -1
- package/es/plugins/danmu/index.d.ts +1 -0
- package/es/plugins/definition/index.js +1 -1
- package/es/plugins/fpsDetect/index.d.ts +4 -1
- package/es/plugins/fullscreen/index.d.ts +11 -7
- package/es/plugins/fullscreen/index.js +0 -10
- package/es/plugins/heatmap/index.d.ts +4 -2
- package/es/plugins/heatmap/index.js +81 -28
- package/es/plugins/mobile/index.d.ts +6 -5
- package/es/plugins/mobile/touch.d.ts +8 -2
- package/es/plugins/netAdaption/index.d.ts +4 -1
- package/es/plugins/pip/index.d.ts +0 -1
- package/es/plugins/pip/index.js +9 -7
- package/es/plugins/playbackRate/index.js +1 -1
- package/es/plugins/poster/index.d.ts +0 -1
- package/es/plugins/poster/index.js +1 -1
- package/es/plugins/progress/index.d.ts +6 -7
- package/es/plugins/progress/index.js +2 -1
- package/es/plugins/progressPreview/index.d.ts +0 -1
- package/es/plugins/progressPreview/index.js +1 -1
- package/es/plugins/prompt/index.d.ts +5 -2
- package/es/plugins/prompt/index.js +3 -3
- package/es/plugins/replay/index.d.ts +0 -1
- package/es/plugins/replay/index.js +1 -1
- package/es/plugins/start/index.d.ts +0 -1
- package/es/plugins/start/index.js +1 -1
- package/es/plugins/testspeed/index.d.ts +4 -1
- package/es/plugins/time/index.d.ts +1 -2
- package/es/plugins/time/index.js +1 -1
- package/es/plugins/time/timesegments.d.ts +1 -1
- package/es/plugins/track/index.js +1 -1
- package/es/plugins/waitingTimeoutJump/index.d.ts +4 -1
- package/es/presets/default-en.d.ts +1 -2
- package/es/presets/default.d.ts +1 -2
- package/es/presets/mobile.d.ts +1 -2
- package/es/style/common/animation.scss +0 -0
- package/es/style/common/svg-url.scss +0 -0
- package/es/style/index.scss +0 -0
- package/es/style/variable.scss +0 -0
- package/es/utils/util.d.ts +3 -3
- package/es/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inherits as _inherits, createSuper as _createSuper, createClass as _createClass, classCallCheck as _classCallCheck, objectSpread2 as _objectSpread2 } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
2
|
import util from "../../utils/util.js";
|
|
3
|
-
import { VIDEO_RESIZE } from "../../events.js";
|
|
3
|
+
import { VIDEO_RESIZE, DURATION_CHANGE } from "../../events.js";
|
|
4
4
|
import "../../utils/debug.js";
|
|
5
5
|
import Plugin from "../../plugin/plugin.js";
|
|
6
6
|
var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
@@ -18,23 +18,30 @@ var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
|
18
18
|
_this.xData = [];
|
|
19
19
|
_this.yData = [];
|
|
20
20
|
_this.yMax = 0;
|
|
21
|
+
_this._duration = 0;
|
|
21
22
|
_this.curData = [];
|
|
22
23
|
return _this;
|
|
23
24
|
}
|
|
24
25
|
_createClass(HeatMap2, [{
|
|
25
26
|
key: "afterPlayerInit",
|
|
26
27
|
value: function afterPlayerInit() {
|
|
27
|
-
var _this2 = this;
|
|
28
28
|
if (this.root) {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
this.createRoot();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
this.reset();
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "afterCreate",
|
|
36
|
+
value: function afterCreate() {
|
|
37
|
+
var _this2 = this;
|
|
35
38
|
this.on(VIDEO_RESIZE, function() {
|
|
36
39
|
_this2.resize();
|
|
37
40
|
});
|
|
41
|
+
this.on(DURATION_CHANGE, function() {
|
|
42
|
+
_this2._duration = _this2.player.duration;
|
|
43
|
+
_this2.reset();
|
|
44
|
+
});
|
|
38
45
|
}
|
|
39
46
|
}, {
|
|
40
47
|
key: "setConfig",
|
|
@@ -43,8 +50,14 @@ var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
|
43
50
|
Object.keys(config).forEach(function(key) {
|
|
44
51
|
_this3.config[key] = config[key];
|
|
45
52
|
});
|
|
46
|
-
this.
|
|
47
|
-
|
|
53
|
+
this.reset();
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "reset",
|
|
57
|
+
value: function reset() {
|
|
58
|
+
var data = this.config.data;
|
|
59
|
+
this.setData(data);
|
|
60
|
+
this.resize();
|
|
48
61
|
}
|
|
49
62
|
}, {
|
|
50
63
|
key: "createRoot",
|
|
@@ -85,24 +98,57 @@ var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
|
85
98
|
}
|
|
86
99
|
}, {
|
|
87
100
|
key: "formatData",
|
|
88
|
-
value: function formatData(data) {
|
|
101
|
+
value: function formatData(data, duration, minValue) {
|
|
89
102
|
var nData = [];
|
|
90
103
|
if (data.length < 1) {
|
|
91
104
|
return nData;
|
|
92
105
|
}
|
|
93
|
-
var totalDur = parseInt(
|
|
106
|
+
var totalDur = parseInt(duration * 1e3, 10);
|
|
94
107
|
if (util.typeOf(data[0]) === "Object" && data[0].time !== void 0) {
|
|
108
|
+
if (!totalDur) {
|
|
109
|
+
return nData;
|
|
110
|
+
}
|
|
111
|
+
var step = 1;
|
|
112
|
+
var lastTime = 0;
|
|
95
113
|
data.forEach(function(item) {
|
|
96
114
|
var dur = parseInt(item.time * 1e3, 10);
|
|
115
|
+
if (lastTime && (step < 0 || item.time - lastTime < step)) {
|
|
116
|
+
step = item.time - lastTime;
|
|
117
|
+
}
|
|
118
|
+
lastTime = item.time;
|
|
97
119
|
nData.push(_objectSpread2(_objectSpread2({}, item), {}, {
|
|
98
|
-
dur,
|
|
99
120
|
percent: dur / totalDur
|
|
100
121
|
}));
|
|
101
122
|
});
|
|
102
|
-
|
|
123
|
+
var fTime = nData[0].time;
|
|
124
|
+
if (fTime > 0) {
|
|
125
|
+
var arr = fTime - step > 0 ? [fTime - step, 0] : [0];
|
|
126
|
+
arr.forEach(function(time) {
|
|
127
|
+
var dur = parseInt(time * 1e3, 10);
|
|
128
|
+
nData.unshift({
|
|
129
|
+
time,
|
|
130
|
+
score: minValue,
|
|
131
|
+
percent: dur / totalDur
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
var last = nData[nData.length - 1];
|
|
136
|
+
if (duration - last.time > step) {
|
|
137
|
+
[last.time + step, duration].forEach(function(item) {
|
|
138
|
+
var dur = parseInt(item * 1e3, 10);
|
|
139
|
+
nData.push({
|
|
140
|
+
time: item,
|
|
141
|
+
score: minValue,
|
|
142
|
+
percent: dur / totalDur
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}
|
|
103
146
|
} else {
|
|
104
|
-
|
|
147
|
+
data.forEach(function(item) {
|
|
148
|
+
nData.push(item);
|
|
149
|
+
});
|
|
105
150
|
}
|
|
151
|
+
return nData;
|
|
106
152
|
}
|
|
107
153
|
}, {
|
|
108
154
|
key: "_getX",
|
|
@@ -113,18 +159,33 @@ var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
|
113
159
|
return this.fixFloat((index - 1) * stepX, this.dataFloatLen);
|
|
114
160
|
}
|
|
115
161
|
}
|
|
162
|
+
}, {
|
|
163
|
+
key: "_getY",
|
|
164
|
+
value: function _getY(item, stepY, maxY) {
|
|
165
|
+
var _this$config = this.config, maxValue = _this$config.maxValue, minValue = _this$config.minValue;
|
|
166
|
+
var y = minValue;
|
|
167
|
+
y = item.score !== void 0 ? item.score : item;
|
|
168
|
+
y = Math.min(y, maxValue);
|
|
169
|
+
y = Math.max(y, minValue);
|
|
170
|
+
y = y / stepY;
|
|
171
|
+
y = 1 - y;
|
|
172
|
+
y = this.fixFloat(y * maxY, this.dataFloatLen);
|
|
173
|
+
return y;
|
|
174
|
+
}
|
|
116
175
|
}, {
|
|
117
176
|
key: "setData",
|
|
118
177
|
value: function setData(data) {
|
|
178
|
+
var _this$config2 = this.config, maxValue = _this$config2.maxValue, minValue = _this$config2.minValue, maxLength = _this$config2.maxLength;
|
|
119
179
|
if (data && data.length) {
|
|
120
|
-
this.curData = this.formatData(data);
|
|
180
|
+
this.curData = this.formatData(data, this._duration, minValue);
|
|
121
181
|
}
|
|
122
182
|
data = this.curData;
|
|
183
|
+
if (data.length < 1) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
123
186
|
this.xData = [];
|
|
124
|
-
this.xData2 = [];
|
|
125
187
|
this.yData = [];
|
|
126
188
|
this.yMax = 0;
|
|
127
|
-
var _this$config = this.config, maxValue = _this$config.maxValue, minValue = _this$config.minValue, maxLength = _this$config.maxLength;
|
|
128
189
|
var max = maxValue;
|
|
129
190
|
var min = minValue;
|
|
130
191
|
var step_V = max - min;
|
|
@@ -137,30 +198,22 @@ var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
|
137
198
|
if (Number.isNaN(step_X)) {
|
|
138
199
|
return;
|
|
139
200
|
}
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var j = 1;
|
|
201
|
+
var i = parseInt(this.fixFloat(step_D - 1, 0));
|
|
202
|
+
var j = 0;
|
|
143
203
|
while (j < curDataLength) {
|
|
144
204
|
var x = this._getX(j, step_X, data[i], this.canvasWidth);
|
|
145
205
|
this.xData.push(x);
|
|
146
|
-
y = data[i]
|
|
147
|
-
y = Math.min(y, max);
|
|
148
|
-
y = Math.max(y, min);
|
|
149
|
-
y = y / step_V;
|
|
150
|
-
y = 1 - y;
|
|
151
|
-
y = this.fixFloat(y * step_Y, this.dataFloatLen);
|
|
206
|
+
var y = this._getY(data[i], step_V, step_Y);
|
|
152
207
|
this.yMax = Math.max(this.yMax, step_Y - y);
|
|
153
208
|
this.yData.push(y);
|
|
154
209
|
j++;
|
|
155
210
|
i = parseInt(this.fixFloat(j * step_D, 0));
|
|
156
211
|
}
|
|
157
|
-
this.xData.push(this.canvasWidth);
|
|
158
|
-
this.yData.push(y);
|
|
159
212
|
}
|
|
160
213
|
}, {
|
|
161
214
|
key: "_getFillStyle",
|
|
162
215
|
value: function _getFillStyle(ctx) {
|
|
163
|
-
var _this$
|
|
216
|
+
var _this$config3 = this.config, gradient = _this$config3.gradient, gradientColors = _this$config3.gradientColors, fillStyle = _this$config3.fillStyle;
|
|
164
217
|
var fStyle = fillStyle;
|
|
165
218
|
if (gradient && gradient.length === 4) {
|
|
166
219
|
var gradientStyle = ctx.createLinearGradient(gradient[0], gradient[1], gradient[2], gradient[3]);
|
|
@@ -183,7 +236,7 @@ var HeatMap = /* @__PURE__ */ function(_Plugin) {
|
|
|
183
236
|
var xData = this.xData, yData = this.yData;
|
|
184
237
|
var x, y;
|
|
185
238
|
var i = 0;
|
|
186
|
-
var _this$
|
|
239
|
+
var _this$config4 = this.config, lineWidth = _this$config4.lineWidth, alpha = _this$config4.alpha, strokeStyle = _this$config4.strokeStyle;
|
|
187
240
|
var fillStyle = this._getFillStyle(ctx);
|
|
188
241
|
ctx.beginPath();
|
|
189
242
|
ctx.lineWidth = lineWidth;
|
|
@@ -57,11 +57,12 @@ declare class MobilePlugin extends Plugin {
|
|
|
57
57
|
private timer;
|
|
58
58
|
get duration(): number;
|
|
59
59
|
get timeOffset(): number;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
registerIcons(): {
|
|
61
|
+
seekTipIcon: {
|
|
62
|
+
icon: any;
|
|
63
|
+
class: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
65
66
|
xgMask: HTMLElement;
|
|
66
67
|
touch: Touche;
|
|
67
68
|
registerThumbnail(): void;
|
|
@@ -24,8 +24,14 @@ declare class Touche {
|
|
|
24
24
|
move: string;
|
|
25
25
|
cancel: string;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @type { null | number}
|
|
29
|
+
*/
|
|
30
|
+
pressIntrvalId: null | number;
|
|
31
|
+
/**
|
|
32
|
+
* @type { null | number}
|
|
33
|
+
*/
|
|
34
|
+
dbIntrvalId: null | number;
|
|
29
35
|
__handlers: {};
|
|
30
36
|
_initEvent(): void;
|
|
31
37
|
__setPress(e: any): void;
|
|
@@ -27,7 +27,6 @@ declare class PIP extends IconPlugin {
|
|
|
27
27
|
initPipEvents(): void;
|
|
28
28
|
leavePIPCallback: () => void;
|
|
29
29
|
pipWindow: any;
|
|
30
|
-
docPiPWindow: any;
|
|
31
30
|
enterPIPCallback: (e: any) => void;
|
|
32
31
|
onWebkitpresentationmodechanged: (e: any) => void;
|
|
33
32
|
switchPIP: (e: any) => boolean;
|
package/es/plugins/pip/index.js
CHANGED
|
@@ -108,7 +108,6 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
108
108
|
!paused && player.mediaPlay();
|
|
109
109
|
_this3.setAttr("data-state", "normal");
|
|
110
110
|
_this3.pipWindow = null;
|
|
111
|
-
_this3.docPiPWindow = null;
|
|
112
111
|
player.emit(PIP_CHANGE, false);
|
|
113
112
|
};
|
|
114
113
|
this.enterPIPCallback = function(e) {
|
|
@@ -183,7 +182,6 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
183
182
|
}
|
|
184
183
|
documentPictureInPicture.requestWindow(pipOptions).then(function(pipWin) {
|
|
185
184
|
var docPiPNode = config.docPiPNode, docPiPStyle = config.docPiPStyle;
|
|
186
|
-
_this4.docPiPWindow = pipWin;
|
|
187
185
|
_this4.enterPIPCallback();
|
|
188
186
|
var pipRoot = docPiPNode || player.root;
|
|
189
187
|
var parentNode = pipRoot.parentElement;
|
|
@@ -240,10 +238,13 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
240
238
|
var player = this.player;
|
|
241
239
|
try {
|
|
242
240
|
if (this.isPIPAvailable() && this.isPip) {
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
var _documentPictureInPic;
|
|
242
|
+
if (this.isDocPIPAvailable() && (_documentPictureInPic = documentPictureInPicture) !== null && _documentPictureInPic !== void 0 && _documentPictureInPic.window) {
|
|
243
|
+
documentPictureInPicture.window.close();
|
|
244
|
+
} else if (PIP2.checkWebkitSetPresentationMode(player.media)) {
|
|
245
|
+
player.media.webkitSetPresentationMode("inline");
|
|
245
246
|
} else {
|
|
246
|
-
|
|
247
|
+
document.exitPictureInPicture();
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
250
|
return true;
|
|
@@ -255,8 +256,9 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
255
256
|
}, {
|
|
256
257
|
key: "isPip",
|
|
257
258
|
get: function get() {
|
|
258
|
-
var
|
|
259
|
-
|
|
259
|
+
var _documentPictureInPic2;
|
|
260
|
+
var player = this.player;
|
|
261
|
+
return !!(this.isDocPIPAvailable() && (_documentPictureInPic2 = documentPictureInPicture) !== null && _documentPictureInPic2 !== void 0 && _documentPictureInPic2.window) || document.pictureInPictureElement && document.pictureInPictureElement === player.media || player.media.webkitPresentationMode === PresentationMode.PIP;
|
|
260
262
|
}
|
|
261
263
|
}, {
|
|
262
264
|
key: "isPIPAvailable",
|
|
@@ -48,9 +48,8 @@ declare class Progress extends Plugin {
|
|
|
48
48
|
get offsetDuration(): number;
|
|
49
49
|
get duration(): number;
|
|
50
50
|
get timeOffset(): number;
|
|
51
|
-
get currentTime():
|
|
51
|
+
get currentTime(): number;
|
|
52
52
|
changeState(useable?: boolean): void;
|
|
53
|
-
show(): void;
|
|
54
53
|
/**
|
|
55
54
|
* @description 创建内部进度条,并挂载到xg-outer上,
|
|
56
55
|
* 并把一些对外API绑定在progress上供外部调用
|
|
@@ -127,12 +126,12 @@ declare class Progress extends Plugin {
|
|
|
127
126
|
onVideoResize: () => void;
|
|
128
127
|
/**
|
|
129
128
|
* @description 根据currenTime和占用百分比更新进度条
|
|
130
|
-
* @param {
|
|
131
|
-
* @param {
|
|
132
|
-
* @param {
|
|
133
|
-
* @param {
|
|
129
|
+
* @param {number} currentTime 需要更新到的时间
|
|
130
|
+
* @param {number} seekTime 实际seek的时间
|
|
131
|
+
* @param {number} percent 更新时间占比
|
|
132
|
+
* @param {number} type 触发类型 0-down 1-move 2-up
|
|
134
133
|
*/
|
|
135
|
-
updateWidth(currentTime: number, seekTime: number, percent: number, type:
|
|
134
|
+
updateWidth(currentTime: number, seekTime: number, percent: number, type: number): void;
|
|
136
135
|
computeTime(e: any, x: any): {
|
|
137
136
|
percent: number;
|
|
138
137
|
currentTime: number;
|
|
@@ -242,7 +242,7 @@ var Progress = /* @__PURE__ */ function(_Plugin) {
|
|
|
242
242
|
}
|
|
243
243
|
}, {
|
|
244
244
|
key: "show",
|
|
245
|
-
value: function show() {
|
|
245
|
+
value: function show(value) {
|
|
246
246
|
this.root && (this.root.style.display = "flex");
|
|
247
247
|
}
|
|
248
248
|
}, {
|
|
@@ -408,6 +408,7 @@ var Progress = /* @__PURE__ */ function(_Plugin) {
|
|
|
408
408
|
value: function unlock() {
|
|
409
409
|
var player = this.player, pos = this.pos;
|
|
410
410
|
pos.isEnter = false;
|
|
411
|
+
pos.isLocked = false;
|
|
411
412
|
if (player.isMini) {
|
|
412
413
|
return;
|
|
413
414
|
}
|
|
@@ -14,10 +14,13 @@ declare class Prompt extends Plugin {
|
|
|
14
14
|
};
|
|
15
15
|
onClick: () => void;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
intervalId: number;
|
|
18
21
|
customConfig: any;
|
|
19
22
|
setStyle(style: any): void;
|
|
20
|
-
|
|
23
|
+
showPrompt(detail: any, config?: {}, onClick?: () => void): void;
|
|
21
24
|
customOnClick: () => void;
|
|
22
25
|
render(): string;
|
|
23
26
|
}
|
|
@@ -24,7 +24,7 @@ var Prompt = /* @__PURE__ */ function(_Plugin) {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
this.player.showPrompt = function() {
|
|
27
|
-
_this.
|
|
27
|
+
_this.showPrompt.apply(_this, arguments);
|
|
28
28
|
};
|
|
29
29
|
this.player.hidePrompt = function() {
|
|
30
30
|
_this.hide();
|
|
@@ -39,8 +39,8 @@ var Prompt = /* @__PURE__ */ function(_Plugin) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}, {
|
|
42
|
-
key: "
|
|
43
|
-
value: function
|
|
42
|
+
key: "showPrompt",
|
|
43
|
+
value: function showPrompt(detail) {
|
|
44
44
|
var _this3 = this;
|
|
45
45
|
var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
46
46
|
var onClick = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
|
|
@@ -9,7 +9,10 @@ export default class TestSpeed extends BasePlugin {
|
|
|
9
9
|
addSpeedTypeList: any[];
|
|
10
10
|
};
|
|
11
11
|
getSpeed: (type?: string) => number;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @type {null || number }
|
|
14
|
+
*/
|
|
15
|
+
timer: any;
|
|
13
16
|
cnt: number;
|
|
14
17
|
xhr: XMLHttpRequest;
|
|
15
18
|
startTimer: () => void;
|
|
@@ -8,12 +8,11 @@ declare class Time extends Plugin {
|
|
|
8
8
|
constructor(args: any);
|
|
9
9
|
isActiving: boolean;
|
|
10
10
|
get duration(): number;
|
|
11
|
-
get currentTime():
|
|
11
|
+
get currentTime(): number;
|
|
12
12
|
get timeOffset(): number;
|
|
13
13
|
mode: string;
|
|
14
14
|
durationDom: HTMLElement;
|
|
15
15
|
timeDom: HTMLElement;
|
|
16
|
-
show(): void;
|
|
17
16
|
onTimeUpdate(isEnded: any): void;
|
|
18
17
|
onReset(): void;
|
|
19
18
|
createCenterTime(): void;
|
package/es/plugins/time/index.js
CHANGED
|
@@ -60,7 +60,7 @@ var Time = /* @__PURE__ */ function(_Plugin) {
|
|
|
60
60
|
}
|
|
61
61
|
}, {
|
|
62
62
|
key: "show",
|
|
63
|
-
value: function show() {
|
|
63
|
+
value: function show(value) {
|
|
64
64
|
if (this.mode === "flex") {
|
|
65
65
|
this.centerCurDom && (this.centerCurDom.style.display = "block");
|
|
66
66
|
this.centerDurDom && (this.centerDurDom.style.display = "block");
|
|
@@ -8,7 +8,7 @@ export default class TimeSegmentsControls extends BasePlugin {
|
|
|
8
8
|
};
|
|
9
9
|
curIndex: any;
|
|
10
10
|
curPos: any;
|
|
11
|
-
lastCurrentTime:
|
|
11
|
+
lastCurrentTime: number;
|
|
12
12
|
setConfig(newConfig: any): void;
|
|
13
13
|
updateSegments(): void;
|
|
14
14
|
formatTimeSegments(timeSegments: any, duration: any): any[];
|
|
@@ -7,7 +7,10 @@ export default class WaitingTimeoutJump extends BasePlugin {
|
|
|
7
7
|
};
|
|
8
8
|
hasPlayed: boolean;
|
|
9
9
|
jumpCnt: number;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @type {null | number}
|
|
12
|
+
*/
|
|
13
|
+
timer: null | number;
|
|
11
14
|
jumpSize: any;
|
|
12
15
|
onWaiting: () => void;
|
|
13
16
|
onJump: () => void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export default class DefaultPreset {
|
|
2
2
|
constructor(options: any, playerConfig: any);
|
|
3
|
-
plugins: (typeof Xglogger | typeof Replay | typeof
|
|
3
|
+
plugins: (typeof Xglogger | typeof Replay | typeof Start | typeof Enter | typeof Miniscreen | typeof Loading | typeof Progress | typeof PlayIcon | typeof FullScreen | typeof TimeIcon | typeof Volume | typeof RotateIcon | typeof PIPIcon | typeof PlayNextIcon | typeof DownLoadIcon | typeof ScreenShotIcon | typeof DefinitionIcon | typeof PlaybackRateIcon | typeof Error | typeof Prompt | typeof ProgressPreview | typeof Thumbnail | typeof MiniProgress | typeof Stats | typeof GapJump | typeof WaitingTimeoutJump)[];
|
|
4
4
|
ignores: any[];
|
|
5
5
|
i18n: any[];
|
|
6
6
|
}
|
|
7
7
|
import Xglogger from "../plugins/logger";
|
|
8
8
|
import Replay from "../plugins/replay";
|
|
9
|
-
import Poster from "../plugins/poster";
|
|
10
9
|
import Start from "../plugins/start";
|
|
11
10
|
import Enter from "../plugins/enter";
|
|
12
11
|
import Miniscreen from "../plugins/miniScreen";
|
package/es/presets/default.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export default class DefaultPreset {
|
|
2
2
|
constructor(options: any, playerConfig: any);
|
|
3
|
-
plugins: (typeof Xglogger | typeof Replay | typeof
|
|
3
|
+
plugins: (typeof Xglogger | typeof Replay | typeof Start | typeof Enter | typeof Miniscreen | typeof Loading | typeof Progress | typeof PlayIcon | typeof FullScreen | typeof TimeIcon | typeof TimeSegments | typeof Volume | typeof RotateIcon | typeof PIPIcon | typeof PlayNextIcon | typeof DownLoadIcon | typeof ScreenShotIcon | typeof DefinitionIcon | typeof PlaybackRateIcon | typeof Error | typeof Prompt | typeof ProgressPreview | typeof Thumbnail | typeof MiniProgress | typeof Stats | typeof GapJump | typeof WaitingTimeoutJump)[];
|
|
4
4
|
ignores: any[];
|
|
5
5
|
i18n: any[];
|
|
6
6
|
}
|
|
7
7
|
import Xglogger from "../plugins/logger";
|
|
8
8
|
import Replay from "../plugins/replay";
|
|
9
|
-
import Poster from "../plugins/poster";
|
|
10
9
|
import Start from "../plugins/start";
|
|
11
10
|
import Enter from "../plugins/enter";
|
|
12
11
|
import Miniscreen from "../plugins/miniScreen";
|
package/es/presets/mobile.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default class DefaultPreset {
|
|
2
|
-
plugins: (typeof Xglogger | typeof Replay | typeof
|
|
2
|
+
plugins: (typeof Xglogger | typeof Replay | typeof Start | typeof Enter | typeof Mobile | typeof Loading | typeof Progress | typeof PlayIcon | typeof FullScreen | typeof TimeIcon | typeof Volume | typeof RotateIcon | typeof PIPIcon | typeof PlayNextIcon | typeof DownLoadIcon | typeof ScreenShotIcon | typeof DefinitionIcon | typeof PlaybackRateIcon | typeof Error | typeof Prompt | typeof Thumbnail | typeof MiniProgress)[];
|
|
3
3
|
ignores: any[];
|
|
4
4
|
i18n: {
|
|
5
5
|
LANG: string;
|
|
@@ -80,7 +80,6 @@ export default class DefaultPreset {
|
|
|
80
80
|
}
|
|
81
81
|
import Xglogger from "../plugins/logger";
|
|
82
82
|
import Replay from "../plugins/replay";
|
|
83
|
-
import Poster from "../plugins/poster";
|
|
84
83
|
import Start from "../plugins/start";
|
|
85
84
|
import Enter from "../plugins/enter";
|
|
86
85
|
import Mobile from "../plugins/mobile";
|
|
File without changes
|
|
File without changes
|
package/es/style/index.scss
CHANGED
|
File without changes
|
package/es/style/variable.scss
CHANGED
|
File without changes
|
package/es/utils/util.d.ts
CHANGED
|
@@ -223,11 +223,11 @@ declare namespace util {
|
|
|
223
223
|
/**
|
|
224
224
|
* @description css中有zoom的时候,位移会等比缩放,但是元素的宽高不会等比缩放,所以通过该api做统一
|
|
225
225
|
* https://bugs.chromium.org/p/chromium/issues/detail?id=429140#c8
|
|
226
|
-
* @param {
|
|
226
|
+
* @param {Event} e
|
|
227
227
|
* @param {number} zoom
|
|
228
228
|
* @returns
|
|
229
229
|
*/
|
|
230
|
-
function getEventPos(e:
|
|
230
|
+
function getEventPos(e: Event, zoom?: number): {
|
|
231
231
|
x: number;
|
|
232
232
|
y: number;
|
|
233
233
|
clientX: number;
|
|
@@ -243,7 +243,7 @@ declare namespace util {
|
|
|
243
243
|
/**
|
|
244
244
|
* @desc Check whether it is MediaSource start
|
|
245
245
|
* @param { HTMLVideoElement | HTMLAudioElement | HTMLElement } video
|
|
246
|
-
* @returns {
|
|
246
|
+
* @returns { boolean }
|
|
247
247
|
*/
|
|
248
248
|
function isMSE(video: HTMLElement | HTMLVideoElement | HTMLAudioElement): boolean;
|
|
249
249
|
function isBlob(url: any): boolean;
|
package/es/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var version = "3.0.
|
|
1
|
+
var version = "3.0.13";
|
|
2
2
|
export { version as default };
|