xgplayer 3.1.0-alpha.0 → 3.1.0-alpha.2
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 +11 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/constant.d.ts +0 -4
- package/es/constant.js +4 -1
- package/es/defaultConfig.js +2 -0
- package/es/error.js +2 -2
- package/es/index.d.ts +2 -1
- package/es/index.js +4 -3
- package/es/index.umd.d.ts +60 -1
- package/es/index.umd.js +29 -1
- package/es/lang/i18n.js +4 -4
- package/es/mediaProxy.d.ts +8 -0
- package/es/mediaProxy.js +13 -8
- package/es/player.d.ts +119 -14
- package/es/player.js +669 -163
- package/es/plugin/basePlugin.d.ts +6 -3
- package/es/plugin/basePlugin.js +6 -5
- package/es/plugin/index.d.ts +2 -1
- package/es/plugin/plugin.d.ts +0 -1
- package/es/plugin/plugin.js +11 -11
- package/es/plugin/pluginsManager.d.ts +14 -0
- package/es/plugin/pluginsManager.js +32 -16
- package/es/plugin/resizeObserver.js +1 -1
- package/es/plugins/common/iconPlugin.js +1 -0
- package/es/plugins/common/optionList.js +10 -10
- package/es/plugins/common/optionsIcon.js +13 -9
- package/es/plugins/common/thumbnail.d.ts +0 -1
- package/es/plugins/common/thumbnail.js +3 -24
- package/es/plugins/controls/index.css +132 -0
- package/es/plugins/controls/index.js +189 -0
- package/es/plugins/cssFullScreen/index.js +2 -1
- package/es/plugins/danmu/danmuIcon.js +1 -0
- package/es/plugins/danmu/danmuPanel.js +2 -2
- package/es/plugins/danmu/index.js +4 -4
- package/es/plugins/definition/index.js +2 -2
- package/es/plugins/download/index.js +3 -3
- package/es/plugins/dynamicBg/index.js +5 -5
- package/es/plugins/enter/index.js +2 -2
- package/es/plugins/error/index.js +2 -1
- package/es/plugins/fpsDetect/index.js +2 -1
- package/es/plugins/fullscreen/backicon.js +3 -3
- package/es/plugins/fullscreen/index.js +2 -2
- package/es/plugins/gapJump/index.js +2 -1
- package/es/plugins/heatmap/index.css +25 -0
- package/es/plugins/heatmap/index.d.ts +70 -0
- package/es/plugins/heatmap/index.js +306 -0
- package/es/plugins/heatmap/index.scss +28 -0
- package/es/plugins/keyboard/index.js +3 -3
- package/es/plugins/logger/index.js +11 -11
- package/es/plugins/miniScreen/index.js +6 -6
- package/es/plugins/miniScreen/miniScreenIcon.js +1 -0
- package/es/plugins/mobile/index.js +14 -14
- package/es/plugins/pc/index.js +3 -3
- package/es/plugins/pip/index.d.ts +11 -1
- package/es/plugins/pip/index.js +112 -13
- package/es/plugins/play/index.js +2 -1
- package/es/plugins/playNext/index.js +2 -1
- package/es/plugins/playbackRate/index.js +2 -1
- package/es/plugins/poster/index.css +4 -0
- package/es/plugins/poster/index.js +12 -10
- package/es/plugins/poster/index.scss +4 -0
- package/es/plugins/progress/index.js +35 -33
- package/es/plugins/progress/innerList.js +11 -9
- package/es/plugins/progress/miniProgress.js +1 -0
- package/es/plugins/progressPreview/dotsApi.js +5 -5
- package/es/plugins/progressPreview/index.d.ts +2 -2
- package/es/plugins/progressPreview/index.js +29 -29
- package/es/plugins/prompt/index.js +5 -5
- package/es/plugins/replay/index.js +3 -3
- package/es/plugins/rotate/index.js +2 -2
- package/es/plugins/screenShot/index.d.ts +1 -0
- package/es/plugins/screenShot/index.js +8 -3
- package/es/plugins/start/index.js +13 -13
- package/es/plugins/stats/index.js +1 -1
- package/es/plugins/testspeed/index.js +2 -2
- package/es/plugins/time/index.js +34 -31
- package/es/plugins/time/timesegments.js +7 -7
- package/es/plugins/track/index.js +6 -6
- package/es/plugins/volume/index.js +15 -15
- package/es/plugins/waitingTimeoutJump/index.js +2 -1
- package/es/presets/default-en.d.ts +2 -1
- package/es/presets/default-en.js +6 -4
- package/es/presets/default.d.ts +3 -2
- package/es/presets/default.js +6 -4
- package/es/stateClassMap.d.ts +1 -0
- package/es/stateClassMap.js +1 -0
- package/es/utils/database.js +107 -0
- package/es/utils/util.d.ts +300 -282
- package/es/utils/util.js +352 -145
- package/es/utils/xgplayerTimeRange.d.ts +7 -0
- package/es/utils/xgplayerTimeRange.js +25 -0
- package/es/version.js +1 -1
- package/package.json +3 -10
- package/es/simple.umd.d.ts +0 -2
- package/es/utils/throttle.d.ts +0 -12
- package/es/utils/throttle.js +0 -132
package/es/utils/util.d.ts
CHANGED
|
@@ -1,288 +1,306 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
1
|
+
declare namespace util {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param { string } el
|
|
5
|
+
* @param { string } [tpl=]
|
|
6
|
+
* @param { {[propName: string]: any }} [attrs={}]
|
|
7
|
+
* @param { string } [cname='']
|
|
8
|
+
* @returns { HTMLElement | null }
|
|
9
|
+
*/
|
|
10
|
+
function createDom(el?: string, tpl?: string, attrs?: {
|
|
11
|
+
[propName: string]: any;
|
|
12
|
+
}, cname?: string): HTMLElement;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param { string } html
|
|
16
|
+
* @param { {[propName: string]: any} } [attrs={}]
|
|
17
|
+
* @param { string } [classname=""]
|
|
18
|
+
* @returns { HTMLElement | null }
|
|
19
|
+
*/
|
|
20
|
+
function createDomFromHtml(html: string, attrs?: {
|
|
21
|
+
[propName: string]: any;
|
|
22
|
+
}, classname?: string): HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param { HTMLElement } el
|
|
26
|
+
* @param { string } className
|
|
27
|
+
* @returns { boolean }
|
|
28
|
+
*/
|
|
29
|
+
function hasClass(el: HTMLElement, className: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param { HTMLElement } el
|
|
33
|
+
* @param { string } className
|
|
34
|
+
* @returns { void }
|
|
35
|
+
*/
|
|
36
|
+
function addClass(el: HTMLElement, className: string): void;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param { HTMLElement } el
|
|
40
|
+
* @param { string } className
|
|
41
|
+
* @returns { void }
|
|
42
|
+
*/
|
|
43
|
+
function removeClass(el: HTMLElement, className: string): void;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param { HTMLElement } el
|
|
47
|
+
* @param { string } className
|
|
48
|
+
* @returns { void }
|
|
49
|
+
*/
|
|
50
|
+
function toggleClass(el: HTMLElement, className: string): void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param { string | Object } args0
|
|
54
|
+
* @param { string } [className]
|
|
55
|
+
* @returns { string }
|
|
56
|
+
*/
|
|
57
|
+
function classNames(...args: any[]): string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param { HTMLElement } el
|
|
61
|
+
* @param { string } sel
|
|
62
|
+
* @returns { HTMLElement }
|
|
63
|
+
*/
|
|
64
|
+
function findDom(el: HTMLElement, sel: string): HTMLElement;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @param { HTMLElement } dom
|
|
68
|
+
* @param { string } key
|
|
69
|
+
* @returns { any }
|
|
70
|
+
*/
|
|
71
|
+
function getCss(dom: HTMLElement, key: string): any;
|
|
72
|
+
function padStart(str: any, length: any, pad: any): string;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param { number } time
|
|
76
|
+
* @returns { string }
|
|
77
|
+
*/
|
|
78
|
+
function format(time: number): string;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @param { Object } e
|
|
82
|
+
* @returns { Object }
|
|
83
|
+
*/
|
|
84
|
+
function event(e: any): any;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param { any } obj
|
|
88
|
+
* @returns { string }
|
|
89
|
+
*/
|
|
90
|
+
function typeOf(obj: any): string;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @param { any } dst
|
|
94
|
+
* @param { any } src
|
|
95
|
+
* @returns { any }
|
|
96
|
+
*/
|
|
97
|
+
function deepCopy(dst: any, src: any): any;
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @param { any } dst
|
|
101
|
+
* @param { any } src
|
|
102
|
+
* @returns { any }
|
|
103
|
+
*/
|
|
104
|
+
function deepMerge(dst: any, src: any): any;
|
|
105
|
+
function getBgImage(el: any): string;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @param { HTMLElement } dom
|
|
109
|
+
* @returns { HTMLElement | null }
|
|
110
|
+
*/
|
|
111
|
+
function copyDom(dom: HTMLElement): HTMLElement;
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param { any } context
|
|
115
|
+
* @param { string } eventName
|
|
116
|
+
* @param { function } intervalFunc
|
|
117
|
+
* @param { number } frequency
|
|
118
|
+
*/
|
|
119
|
+
function setInterval(context: any, eventName: string, intervalFunc: Function, frequency: number): void;
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* @param { any } context
|
|
123
|
+
* @param { string } eventName
|
|
124
|
+
* @returns { void }
|
|
125
|
+
*/
|
|
126
|
+
function clearInterval(context: any, eventName: string): void;
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @param { any } context
|
|
130
|
+
* @param { function } fun
|
|
131
|
+
* @param { number } time
|
|
132
|
+
* @returns { number }
|
|
133
|
+
*/
|
|
134
|
+
function setTimeout(context: any, fun: Function, time: number): number;
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @param { any } context
|
|
138
|
+
* @param { number } id
|
|
139
|
+
*/
|
|
140
|
+
function clearTimeout(context: any, id: number): void;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param { any } context
|
|
144
|
+
*/
|
|
145
|
+
function clearAllTimers(context: any): void;
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
* @param { string } name
|
|
149
|
+
* @param { string } imgUrl
|
|
150
|
+
* @param { number } [width]
|
|
151
|
+
* @param { number } [height]
|
|
152
|
+
* @returns { HTMLElement }
|
|
153
|
+
*/
|
|
154
|
+
function createImgBtn(name: string, imgUrl: string, width?: number, height?: number): HTMLElement;
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
* @param { string } hex
|
|
158
|
+
* @param { string | number } alpha
|
|
159
|
+
* @returns { string }
|
|
160
|
+
*/
|
|
161
|
+
function Hex2RGBA(hex: string, alpha: string | number): string;
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @returns { HTMLElement | null }
|
|
165
|
+
*/
|
|
166
|
+
function getFullScreenEl(): HTMLElement;
|
|
167
|
+
/**
|
|
168
|
+
* @param { any }
|
|
169
|
+
* @returns { boolean }
|
|
170
|
+
*/
|
|
171
|
+
function checkIsFunction(fun: any): boolean;
|
|
172
|
+
/**
|
|
173
|
+
* @param { any }
|
|
174
|
+
* @returns { boolean }
|
|
175
|
+
*/
|
|
176
|
+
function checkIsObject(obj: any): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* @param { HTMLElement }
|
|
179
|
+
*/
|
|
180
|
+
function hide(dom: any): void;
|
|
181
|
+
/**
|
|
182
|
+
* @param { HTMLElement }
|
|
183
|
+
* @param { block | flex | inline-block | inline-flex } [display]
|
|
184
|
+
*/
|
|
185
|
+
function show(dom: any, display: any): void;
|
|
186
|
+
/**
|
|
187
|
+
*
|
|
188
|
+
* @param { any } val
|
|
189
|
+
* @returns { boolean }
|
|
190
|
+
*/
|
|
191
|
+
function isUndefined(val: any): boolean;
|
|
192
|
+
function isNotNull(val: any): boolean;
|
|
193
|
+
/**
|
|
194
|
+
*
|
|
195
|
+
* @param { HTMLElement } dom
|
|
196
|
+
* @param { string } [text]
|
|
197
|
+
* @returns
|
|
198
|
+
*/
|
|
199
|
+
function setStyleFromCsstext(dom: HTMLElement, text?: string): void;
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
* @param { HTMLElement } dom
|
|
203
|
+
* @param { Array<string> } [list] attribute names to filter
|
|
204
|
+
* @returns { {} | {[propName: string]: any;} }
|
|
205
|
+
*/
|
|
206
|
+
function filterStyleFromText(dom: HTMLElement, list?: string[]): {} | {
|
|
207
|
+
[propName: string]: any;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* @param { HTMLElement } dom
|
|
212
|
+
* @returns { {} | {[propName: string]: any;} }
|
|
213
|
+
*/
|
|
214
|
+
function getStyleFromCsstext(dom: HTMLElement): {} | {
|
|
215
|
+
[propName: string]: any;
|
|
216
|
+
};
|
|
217
|
+
function preloadImg(url: any, onload?: () => void, onerror?: () => void): void;
|
|
218
|
+
function stopPropagation(e: any): void;
|
|
219
|
+
function scrollTop(): number;
|
|
220
|
+
function scrollLeft(): number;
|
|
221
|
+
function checkTouchSupport(): boolean;
|
|
222
|
+
function getBuffered2(vbuffered: any, maxHoleDuration?: number): XgplayerTimeRange;
|
|
223
|
+
/**
|
|
224
|
+
* @description css中有zoom的时候,位移会等比缩放,但是元素的宽高不会等比缩放,所以通过该api做统一
|
|
225
|
+
* https://bugs.chromium.org/p/chromium/issues/detail?id=429140#c8
|
|
226
|
+
* @param {Events} e
|
|
227
|
+
* @param {number} zoom
|
|
228
|
+
* @returns
|
|
229
|
+
*/
|
|
230
|
+
function getEventPos(e: Events, zoom?: number): {
|
|
231
|
+
x: number;
|
|
232
|
+
y: number;
|
|
233
|
+
clientX: number;
|
|
234
|
+
clientY: number;
|
|
235
|
+
offsetX: number;
|
|
236
|
+
offsetY: number;
|
|
237
|
+
pageX: number;
|
|
238
|
+
pageY: number;
|
|
239
|
+
};
|
|
240
|
+
function requestAnimationFrame(callback: any): any;
|
|
241
|
+
function getHostFromUrl(url: any): string;
|
|
242
|
+
function cancelAnimationFrame(frameId: any): void;
|
|
243
|
+
/**
|
|
244
|
+
* @desc Check whether it is MediaSource start
|
|
245
|
+
* @param { HTMLVideoElement | HTMLAudioElement | HTMLElement } video
|
|
246
|
+
* @returns { Boolean }
|
|
247
|
+
*/
|
|
248
|
+
function isMSE(video: HTMLElement | HTMLVideoElement | HTMLAudioElement): boolean;
|
|
249
|
+
function isBlob(url: any): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* @param { number } did
|
|
252
|
+
* @returns { string }
|
|
253
|
+
*/
|
|
254
|
+
function generateSessionId(did?: number): string;
|
|
255
|
+
function createEvent(eventName: any): Event;
|
|
256
|
+
/**
|
|
257
|
+
* @description Adjust currentTime according to duration, when ended is true and currentTime is less than duration, or
|
|
258
|
+
* currentTime is greater than duration, return duration
|
|
259
|
+
* @param { number } time
|
|
260
|
+
* @param { number } duration
|
|
261
|
+
* @param { boolean } isEnded
|
|
262
|
+
* @returns { number } Adjusted time
|
|
263
|
+
*/
|
|
264
|
+
function adjustTimeByDuration(time: number, duration: number, isEnded: boolean): number;
|
|
265
|
+
function createPositionBar(className: any, root: any): HTMLElement;
|
|
266
|
+
function getTransformStyle(pos?: {
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
scale: number;
|
|
270
|
+
rotate: number;
|
|
271
|
+
}, transformValue?: string): string;
|
|
272
|
+
/**
|
|
273
|
+
* @description 角度换算
|
|
274
|
+
* @param {number} val
|
|
275
|
+
* @returns {number}
|
|
276
|
+
*/
|
|
277
|
+
function convertDeg(val: number): number;
|
|
278
|
+
function getIndexByTime(time: any, segments: any): number;
|
|
279
|
+
function getOffsetCurrentTime(currentTime: any, segments: any, index?: number): any;
|
|
280
|
+
/**
|
|
281
|
+
*
|
|
282
|
+
* @param {*} offsetTime
|
|
283
|
+
* @param {*} segments
|
|
284
|
+
* @returns
|
|
285
|
+
*/
|
|
286
|
+
function getCurrentTimeByOffset(offsetTime: any, segments: any): any;
|
|
287
|
+
}
|
|
288
|
+
export function checkIsCurrentVideo(element: any, playerId: any, key: any): boolean;
|
|
289
|
+
export function debounce(func: any, wait: any, options: any): {
|
|
290
|
+
(...args: any[]): any;
|
|
291
|
+
cancel: () => void;
|
|
292
|
+
flush: () => any;
|
|
293
|
+
pending: () => boolean;
|
|
215
294
|
};
|
|
216
|
-
export function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
* @description css中有zoom的时候,位移会等比缩放,但是元素的宽高不会等比缩放,所以通过该api做统一
|
|
222
|
-
* https://bugs.chromium.org/p/chromium/issues/detail?id=429140#c8
|
|
223
|
-
* @param {Events} e
|
|
224
|
-
* @param {number} zoom
|
|
225
|
-
* @returns
|
|
226
|
-
*/
|
|
227
|
-
export function getEventPos(e: Events, zoom?: number): {
|
|
228
|
-
x: number;
|
|
229
|
-
y: number;
|
|
230
|
-
clientX: number;
|
|
231
|
-
clientY: number;
|
|
232
|
-
offsetX: number;
|
|
233
|
-
offsetY: number;
|
|
234
|
-
pageX: number;
|
|
235
|
-
pageY: number;
|
|
295
|
+
export function throttle(func: any, wait: any, options: any): {
|
|
296
|
+
(...args: any[]): any;
|
|
297
|
+
cancel: () => void;
|
|
298
|
+
flush: () => any;
|
|
299
|
+
pending: () => boolean;
|
|
236
300
|
};
|
|
237
|
-
export function requestAnimationFrame(callback: any): any;
|
|
238
|
-
export function getHostFromUrl(url: any): string;
|
|
239
|
-
export function cancelAnimationFrame(frameId: any): void;
|
|
240
|
-
/**
|
|
241
|
-
* @desc Check whether it is MediaSource start
|
|
242
|
-
* @param { HTMLVideoElement | HTMLAudioElement | HTMLElement } video
|
|
243
|
-
* @returns { Boolean }
|
|
244
|
-
*/
|
|
245
|
-
export function isMSE(video: HTMLVideoElement | HTMLAudioElement | HTMLElement): boolean;
|
|
246
|
-
export function isBlob(url: any): boolean;
|
|
247
|
-
/**
|
|
248
|
-
* @param { number } did
|
|
249
|
-
* @returns { string }
|
|
250
|
-
*/
|
|
251
|
-
export function generateSessionId(did?: number): string;
|
|
252
|
-
export function createEvent(eventName: any): Event;
|
|
253
|
-
/**
|
|
254
|
-
* @description Adjust currentTime according to duration, when ended is true and currentTime is less than duration, or
|
|
255
|
-
* currentTime is greater than duration, return duration
|
|
256
|
-
* @param { number } time
|
|
257
|
-
* @param { number } duration
|
|
258
|
-
* @param { boolean } isEnded
|
|
259
|
-
* @returns { number } Adjusted time
|
|
260
|
-
*/
|
|
261
|
-
export function adjustTimeByDuration(time: number, duration: number, isEnded: boolean): number;
|
|
262
|
-
export function createPositionBar(className: any, root: any): HTMLElement;
|
|
263
|
-
export function getTransformStyle(pos?: {
|
|
264
|
-
x: number;
|
|
265
|
-
y: number;
|
|
266
|
-
scale: number;
|
|
267
|
-
rotate: number;
|
|
268
|
-
}): string;
|
|
269
|
-
/**
|
|
270
|
-
* @description 角度换算
|
|
271
|
-
* @param {number} val
|
|
272
|
-
* @returns {number}
|
|
273
|
-
*/
|
|
274
|
-
export function convertDeg(val: number): number;
|
|
275
|
-
export function getIndexByTime(time: any, segments: any): number;
|
|
276
|
-
export function getOffsetCurrentTime(currentTime: any, segments: any, index?: number): any;
|
|
277
|
-
/**
|
|
278
|
-
*
|
|
279
|
-
* @param {*} offsetTime
|
|
280
|
-
* @param {*} segments
|
|
281
|
-
* @returns
|
|
282
|
-
*/
|
|
283
|
-
export function getCurrentTimeByOffset(offsetTime: any, segments: any): any;
|
|
284
301
|
/**
|
|
285
302
|
* @returns { string }
|
|
286
303
|
*/
|
|
287
304
|
export function getLang(): string;
|
|
288
|
-
|
|
305
|
+
import XgplayerTimeRange from "./xgplayerTimeRange";
|
|
306
|
+
export { util as default };
|