xgplayer 3.0.25-rc.9 → 3.0.26

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.
Files changed (109) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/index.min.js.map +1 -1
  3. package/es/defaultConfig.d.ts +15 -15
  4. package/es/error.d.ts +12 -12
  5. package/es/events.d.ts +3 -3
  6. package/es/icons.d.ts +1 -1
  7. package/es/index.d.ts +19 -19
  8. package/es/index.umd.d.ts +17 -17
  9. package/es/instManager.d.ts +1 -1
  10. package/es/lang/br.d.ts +54 -54
  11. package/es/lang/de.d.ts +54 -54
  12. package/es/lang/en.d.ts +55 -55
  13. package/es/lang/es.d.ts +54 -54
  14. package/es/lang/fr.d.ts +54 -54
  15. package/es/lang/i18n.d.ts +7 -0
  16. package/es/lang/id.d.ts +54 -54
  17. package/es/lang/index.d.ts +1 -1
  18. package/es/lang/it.d.ts +54 -54
  19. package/es/lang/jp.d.ts +55 -55
  20. package/es/lang/kr.d.ts +54 -54
  21. package/es/lang/ms-my.d.ts +54 -54
  22. package/es/lang/ru.d.ts +54 -54
  23. package/es/lang/th.d.ts +54 -54
  24. package/es/lang/vn.d.ts +54 -54
  25. package/es/lang/zh-cn.d.ts +55 -55
  26. package/es/lang/zh-hk.d.ts +55 -55
  27. package/es/lang/zh-hk.js +1 -1
  28. package/es/mediaProxy.d.ts +42 -30
  29. package/es/mediaProxy.js +35 -21
  30. package/es/player.d.ts +51 -52
  31. package/es/player.js +3 -3
  32. package/es/plugin/basePlugin.d.ts +12 -12
  33. package/es/plugin/hooksDescriptor.d.ts +3 -3
  34. package/es/plugin/index.d.ts +12 -12
  35. package/es/plugin/plugin.d.ts +26 -23
  36. package/es/plugin/plugin.js +3 -1
  37. package/es/plugin/pluginsManager.d.ts +9 -71
  38. package/es/plugin/pluginsManager.js +22 -9
  39. package/es/plugin/resizeObserver.d.ts +1 -1
  40. package/es/plugins/common/iconPlugin.d.ts +1 -1
  41. package/es/plugins/common/optionList.d.ts +4 -4
  42. package/es/plugins/common/optionsIcon.d.ts +7 -7
  43. package/es/plugins/common/thumbnail.d.ts +4 -4
  44. package/es/plugins/controls/index.d.ts +8 -8
  45. package/es/plugins/cssFullScreen/index.d.ts +4 -4
  46. package/es/plugins/danmu/danmuIcon.d.ts +1 -1
  47. package/es/plugins/danmu/danmuPanel.d.ts +2 -2
  48. package/es/plugins/danmu/index.d.ts +3 -3
  49. package/es/plugins/definition/index.d.ts +2 -2
  50. package/es/plugins/download/index.d.ts +5 -5
  51. package/es/plugins/download/saveAs.d.ts +6 -6
  52. package/es/plugins/dynamicBg/index.d.ts +14 -15
  53. package/es/plugins/enter/index.d.ts +3 -3
  54. package/es/plugins/error/index.d.ts +3 -3
  55. package/es/plugins/fpsDetect/index.d.ts +5 -5
  56. package/es/plugins/fullscreen/backicon.d.ts +2 -2
  57. package/es/plugins/fullscreen/index.d.ts +4 -4
  58. package/es/plugins/gapJump/index.d.ts +6 -6
  59. package/es/plugins/heatmap/index.d.ts +3 -4
  60. package/es/plugins/keyboard/index.d.ts +5 -5
  61. package/es/plugins/keyboard/index.js +1 -1
  62. package/es/plugins/loading/index.d.ts +1 -1
  63. package/es/plugins/logger/index.d.ts +22 -22
  64. package/es/plugins/miniScreen/index.d.ts +8 -8
  65. package/es/plugins/miniScreen/miniScreenIcon.d.ts +1 -1
  66. package/es/plugins/mobile/index.d.ts +8 -8
  67. package/es/plugins/netAdaption/index.d.ts +2 -2
  68. package/es/plugins/pc/index.d.ts +2 -2
  69. package/es/plugins/pc/index.js +1 -1
  70. package/es/plugins/pip/index.d.ts +12 -12
  71. package/es/plugins/play/index.d.ts +2 -2
  72. package/es/plugins/playNext/index.d.ts +5 -5
  73. package/es/plugins/playbackRate/index.d.ts +5 -5
  74. package/es/plugins/poster/index.d.ts +3 -3
  75. package/es/plugins/progress/index.d.ts +15 -15
  76. package/es/plugins/progress/innerList.d.ts +6 -6
  77. package/es/plugins/progress/innerList.js +1 -1
  78. package/es/plugins/progress/miniProgress.d.ts +4 -4
  79. package/es/plugins/progressPreview/dotsApi.js +1 -1
  80. package/es/plugins/progressPreview/index.d.ts +17 -17
  81. package/es/plugins/prompt/index.d.ts +3 -3
  82. package/es/plugins/replay/index.d.ts +2 -2
  83. package/es/plugins/rotate/index.d.ts +5 -5
  84. package/es/plugins/screenShot/index.d.ts +6 -6
  85. package/es/plugins/start/index.d.ts +5 -5
  86. package/es/plugins/stats/index.d.ts +7 -7
  87. package/es/plugins/stats/index.js +1 -1
  88. package/es/plugins/testspeed/index.d.ts +6 -6
  89. package/es/plugins/time/index.d.ts +8 -9
  90. package/es/plugins/time/timesegments.d.ts +3 -3
  91. package/es/plugins/time/timesegments.js +1 -1
  92. package/es/plugins/track/index.d.ts +14 -15
  93. package/es/plugins/track/nativeSubTitle.d.ts +2 -1
  94. package/es/plugins/volume/index.d.ts +9 -9
  95. package/es/plugins/waitingTimeoutJump/index.d.ts +4 -4
  96. package/es/presets/default-en.d.ts +27 -27
  97. package/es/presets/default.d.ts +28 -28
  98. package/es/presets/live.d.ts +14 -14
  99. package/es/presets/mobile.d.ts +23 -23
  100. package/es/state.d.ts +8 -8
  101. package/es/stateClassMap.d.ts +29 -29
  102. package/es/utils/database.d.ts +11 -4
  103. package/es/utils/debug.d.ts +1 -1
  104. package/es/utils/draggabilly.d.ts +3 -2
  105. package/es/utils/sniffer.d.ts +2 -2
  106. package/es/utils/util.d.ts +61 -59
  107. package/es/utils/util.js +2 -0
  108. package/es/version.js +1 -1
  109. package/package.json +3 -3
@@ -1,30 +1,18 @@
1
1
  export default pluginsManager;
2
2
  declare namespace pluginsManager {
3
- const pluginGroup: {};
4
- function init(player: any): void;
3
+ let pluginGroup: {};
5
4
  function init(player: any): void;
6
5
  function formatPluginInfo(plugin: any, config: any): {
7
6
  PLUFGIN: any;
8
7
  options: any;
9
8
  };
10
- function formatPluginInfo(plugin: any, config: any): {
11
- PLUFGIN: any;
12
- options: any;
13
- };
14
- /**
15
- * check the plugin if exits in plugins
16
- * @param {string} pluginName
17
- * @param { Array <any> } plugins
18
- * @returns boolean
19
- */
20
- function checkPluginIfExits(pluginName: string, plugins: any[]): boolean;
21
9
  /**
22
10
  * check the plugin if exits in plugins
23
11
  * @param {string} pluginName
24
12
  * @param { Array <any> } plugins
25
13
  * @returns boolean
26
14
  */
27
- function checkPluginIfExits(pluginName: string, plugins: any[]): boolean;
15
+ function checkPluginIfExits(pluginName: string, plugins: Array<any>): boolean;
28
16
  /**
29
17
  * get plugin Config from playerConfig
30
18
  * @param { string } pluginName
@@ -36,24 +24,6 @@ declare namespace pluginsManager {
36
24
  }): {
37
25
  [propName: string]: any;
38
26
  };
39
- /**
40
- * get plugin Config from playerConfig
41
- * @param { string } pluginName
42
- * @param { {[propName: string]: any;} } playerConfig
43
- * @return { {[propName: string]: any;} } pluginConfig
44
- */
45
- function getRootByConfig(pluginName: string, playerConfig: {
46
- [propName: string]: any;
47
- }): {
48
- [propName: string]: any;
49
- };
50
- /**
51
- * register a lazy plugin
52
- * @param { any } player instance
53
- * @param { any } lazyPlugin config
54
- *
55
- */
56
- function lazyRegister(player: any, lazyPlugin: any): Promise<any>;
57
27
  /**
58
28
  * register a lazy plugin
59
29
  * @param { any } player instance
@@ -62,20 +32,12 @@ declare namespace pluginsManager {
62
32
  */
63
33
  function lazyRegister(player: any, lazyPlugin: any): Promise<any>;
64
34
  /**
65
- * register a Plugin
66
- * @param { any } player the plugins register
67
- * @param { any } plugin the plugin contructor
68
- * @param { any } options the plugin configuration
69
- * @return { any } Plugin the plugin instance
70
- **/
71
- function register(player: any, plugin: any, options?: any): any;
72
- /**
73
- * register a Plugin
74
- * @param { any } player the plugins register
75
- * @param { any } plugin the plugin contructor
76
- * @param { any } options the plugin configuration
77
- * @return { any } Plugin the plugin instance
78
- **/
35
+ * register a Plugin
36
+ * @param { any } player the plugins register
37
+ * @param { any } plugin the plugin contructor
38
+ * @param { any } options the plugin configuration
39
+ * @return { any } Plugin the plugin instance
40
+ **/
79
41
  function register(player: any, plugin: any, options?: any): any;
80
42
  /**
81
43
  * Unregister a plugin from player instance
@@ -83,46 +45,22 @@ declare namespace pluginsManager {
83
45
  * @param { string } name
84
46
  */
85
47
  function unRegister(cgid: string, name: string): void;
86
- /**
87
- * Unregister a plugin from player instance
88
- * @param { string } cgid
89
- * @param { string } name
90
- */
91
- function unRegister(cgid: string, name: string): void;
92
48
  /**
93
49
  * remove a plugin instance from the player plugin list
94
50
  * @param { any } player
95
51
  * @param { string } name
96
52
  */
97
53
  function deletePlugin(player: any, name: string): void;
98
- /**
99
- * remove a plugin instance from the player plugin list
100
- * @param { any } player
101
- * @param { string } name
102
- */
103
- function deletePlugin(player: any, name: string): void;
104
- /**
105
- * get all plugin instance of player
106
- * @param { any } player
107
- */
108
- function getPlugins(player: any): any;
109
54
  /**
110
55
  * get all plugin instance of player
111
56
  * @param { any } player
112
57
  */
113
58
  function getPlugins(player: any): any;
114
- function findPlugin(player: any, name: any): any;
115
- function findPlugin(player: any, name: any): any;
59
+ function findPlugin(player: any, condition: any): any;
116
60
  function beforeInit(player: any): Promise<any>;
117
- function beforeInit(player: any): Promise<any>;
118
- function afterInit(player: any): void;
119
61
  function afterInit(player: any): void;
120
62
  function setLang(lang: any, player: any): void;
121
- function setLang(lang: any, player: any): void;
122
63
  function reRender(player: any): void;
123
- function reRender(player: any): void;
124
- function onPluginsReady(player: any): void;
125
64
  function onPluginsReady(player: any): void;
126
65
  function destroy(player: any): void;
127
- function destroy(player: any): void;
128
66
  }
@@ -1,5 +1,5 @@
1
- import { addObserver, unObserver } from "./resizeObserver.js";
2
1
  import util from "../utils/util.js";
2
+ import { addObserver, unObserver } from "./resizeObserver.js";
3
3
  var pluginsManager = {
4
4
  pluginGroup: {},
5
5
  init: function init(player) {
@@ -64,13 +64,13 @@ var pluginsManager = {
64
64
  var timeout = lazyPlugin.timeout || 1500;
65
65
  return Promise.race([lazyPlugin.loader().then(function(plugin) {
66
66
  var result;
67
- if (plugin && plugin.__esModule) {
67
+ if (plugin !== null && plugin !== void 0 && plugin.__esModule) {
68
68
  result = plugin.default;
69
69
  } else {
70
70
  result = plugin;
71
71
  }
72
72
  _this.register(player, result, plugin.options);
73
- }), new Promise(function(resolve, reject) {
73
+ }), new Promise(function(_, reject) {
74
74
  setTimeout(function() {
75
75
  reject(new Error("timeout"));
76
76
  }, timeout);
@@ -169,13 +169,23 @@ var pluginsManager = {
169
169
  var cgid = player._pluginInfoId;
170
170
  return cgid && this.pluginGroup[cgid] ? this.pluginGroup[cgid]._plugins : {};
171
171
  },
172
- findPlugin: function findPlugin(player, name) {
172
+ findPlugin: function findPlugin(player, condition) {
173
173
  var cgid = player._pluginInfoId;
174
174
  if (!cgid || !this.pluginGroup[cgid]) {
175
175
  return null;
176
176
  }
177
- var cName = name.toLowerCase();
178
- return this.pluginGroup[cgid]._plugins[cName];
177
+ if (typeof condition === "string") {
178
+ var cName = condition.toLowerCase();
179
+ return this.pluginGroup[cgid]._plugins[cName] || null;
180
+ } else if (typeof condition === "function") {
181
+ var plugins = this.pluginGroup[cgid]._plugins;
182
+ for (var key in plugins) {
183
+ if (condition(plugins[key])) {
184
+ return plugins[key] || null;
185
+ }
186
+ }
187
+ }
188
+ return null;
179
189
  },
180
190
  beforeInit: function beforeInit(player) {
181
191
  var _this2 = this;
@@ -189,11 +199,12 @@ var pluginsManager = {
189
199
  }
190
200
  }
191
201
  return new Promise(function(resolve) {
202
+ var _player$_loadingPlugi;
192
203
  if (!_this2.pluginGroup) {
193
204
  return;
194
205
  }
195
206
  var prevTask;
196
- if (player._loadingPlugins && player._loadingPlugins.length) {
207
+ if ((_player$_loadingPlugi = player._loadingPlugins) !== null && _player$_loadingPlugi !== void 0 && _player$_loadingPlugi.length) {
197
208
  prevTask = Promise.all(player._loadingPlugins);
198
209
  } else {
199
210
  prevTask = Promise.resolve();
@@ -207,7 +218,8 @@ var pluginsManager = {
207
218
  var plugins = _this2.pluginGroup[cgid]._plugins;
208
219
  var pluginsRet = [];
209
220
  Object.keys(plugins).forEach(function(pName) {
210
- if (plugins[pName] && plugins[pName].beforePlayerInit) {
221
+ var _plugins$pName;
222
+ if ((_plugins$pName = plugins[pName]) !== null && _plugins$pName !== void 0 && _plugins$pName.beforePlayerInit) {
211
223
  try {
212
224
  var ret = plugins[pName].beforePlayerInit();
213
225
  pluginsRet.push(retPromise(ret));
@@ -233,7 +245,8 @@ var pluginsManager = {
233
245
  }
234
246
  var plugins = this.pluginGroup[cgid]._plugins;
235
247
  Object.keys(plugins).forEach(function(pName) {
236
- if (plugins[pName] && plugins[pName].afterPlayerInit) {
248
+ var _plugins$pName2;
249
+ if ((_plugins$pName2 = plugins[pName]) !== null && _plugins$pName2 !== void 0 && _plugins$pName2.afterPlayerInit) {
237
250
  plugins[pName].afterPlayerInit();
238
251
  }
239
252
  });
@@ -7,7 +7,7 @@ export function destroyObserver(target: any, handler: any): void;
7
7
  declare class ResizeObserver {
8
8
  __handlers: any[];
9
9
  timeStamp: number;
10
- observer: globalThis.ResizeObserver;
10
+ observer: globalThis.ResizeObserver | null;
11
11
  addObserver(target: any, handler: any): void;
12
12
  unObserver(target: any): void;
13
13
  destroyObserver(): void;
@@ -2,4 +2,4 @@ export default class Icon extends Plugin {
2
2
  _onMouseenter: (e: any) => void;
3
3
  _onMouseLeave: (e: any) => void;
4
4
  }
5
- import Plugin from "../../plugin";
5
+ import Plugin from '../../plugin';
@@ -2,11 +2,11 @@ export default class OptionList {
2
2
  constructor(args: any);
3
3
  config: any;
4
4
  parent: any;
5
- root: HTMLElement;
6
- onItemClick(e: any): boolean;
7
- _delegates: any;
5
+ root: HTMLElement | null;
6
+ onItemClick(e: any): false | undefined;
7
+ _delegates: any[];
8
8
  renderItemList(data: any): void;
9
- attrKeys: string[];
9
+ attrKeys: string[] | undefined;
10
10
  getAttrObj(dom: any, keys: any): {};
11
11
  show(): void;
12
12
  hide(): void;
@@ -8,7 +8,7 @@ export default class OptionsIcon extends Plugin {
8
8
  isActive: boolean;
9
9
  curValue: any;
10
10
  curIndex: number;
11
- activeEvent: string;
11
+ activeEvent: string | undefined;
12
12
  initIcons(): void;
13
13
  /**
14
14
  * @param {string} [value]
@@ -20,7 +20,7 @@ export default class OptionsIcon extends Plugin {
20
20
  switchActiveState: (e: any) => void;
21
21
  onLeave: (e: any) => void;
22
22
  onListEnter: (e: any) => void;
23
- enterType: number;
23
+ enterType: number | undefined;
24
24
  onListLeave: (e: any) => void;
25
25
  toggle(isActive: any): void;
26
26
  onItemClick(e: any, data: any): void;
@@ -28,17 +28,17 @@ export default class OptionsIcon extends Plugin {
28
28
  onIconClick(e: any): void;
29
29
  changeCurrentText(): void;
30
30
  renderItemList(itemList: any, curIndex: any): void;
31
- optionsList: OptionList;
31
+ optionsList: OptionList | null | undefined;
32
32
  _resizeList(): void;
33
- render(): string;
33
+ render(): string | undefined;
34
34
  }
35
35
  export type IOptionsIconConfig = {
36
- [propName: string]: any;
37
36
  isShow?: boolean;
38
37
  index?: number;
39
38
  list?: Array<any>;
40
39
  listType?: string;
41
40
  hidePortrait?: boolean;
41
+ [propName: string]: any;
42
42
  };
43
- import Plugin from "../../plugin";
44
- import OptionList from "./optionList";
43
+ import Plugin from '../../plugin';
44
+ import OptionList from './optionList';
@@ -23,7 +23,7 @@ export default class Thumbnail extends BasePlugin {
23
23
  interval: any;
24
24
  _preloadMark: {};
25
25
  setConfig(config: any): void;
26
- get usable(): boolean;
26
+ get usable(): any;
27
27
  initThumbnail(): void;
28
28
  getUrlByIndex(index: any): any;
29
29
  preload(index: any): void;
@@ -44,10 +44,9 @@ export default class Thumbnail extends BasePlugin {
44
44
  };
45
45
  update(dom: any, now: any, containerWidth?: number, containerHeight?: number, customStyle?: string): void;
46
46
  changeConfig(newConfig?: {}): void;
47
- createThumbnail(root: any, className: any): HTMLElement;
47
+ createThumbnail(root: any, className: any): HTMLElement | null;
48
48
  }
49
49
  export type IThumbnailConfig = {
50
- [propName: string]: any;
51
50
  isShow?: boolean;
52
51
  urls?: Array<string>;
53
52
  pic_num?: number;
@@ -58,5 +57,6 @@ export type IThumbnailConfig = {
58
57
  scale?: number;
59
58
  className?: string;
60
59
  hidePortrait?: boolean;
60
+ [propName: string]: any;
61
61
  };
62
- import BasePlugin from "../../plugin";
62
+ import BasePlugin from '../../plugin';
@@ -1,10 +1,10 @@
1
1
  export default Controls;
2
2
  export type IControlsConfig = {
3
- [propName: string]: any;
4
3
  disable?: boolean;
5
4
  autoHide?: boolean;
6
5
  mode?: "flex" | "normal" | "bottom";
7
6
  initShow?: boolean;
7
+ [propName: string]: any;
8
8
  };
9
9
  /**
10
10
  * @typedef {{
@@ -25,22 +25,22 @@ declare class Controls extends Plugin {
25
25
  * @type { HTMLElement}
26
26
  * @readonly
27
27
  */
28
- readonly left: HTMLElement;
28
+ readonly left: HTMLElement | undefined;
29
29
  /**
30
30
  * @type { HTMLElement}
31
31
  * @readonly
32
32
  */
33
- readonly center: HTMLElement;
33
+ readonly center: HTMLElement | undefined;
34
34
  /**
35
35
  * @type { HTMLElement}
36
36
  * @readonly
37
37
  */
38
- readonly right: HTMLElement;
38
+ readonly right: HTMLElement | undefined;
39
39
  /**
40
40
  * @type { HTMLElement}
41
41
  * @readonly
42
42
  */
43
- readonly innerRoot: HTMLElement;
43
+ readonly innerRoot: HTMLElement | undefined;
44
44
  onMouseEnter: (e: any) => void;
45
45
  onMouseLeave: (e: any) => void;
46
46
  focus(): void;
@@ -71,7 +71,7 @@ declare class Controls extends Plugin {
71
71
  position?: string;
72
72
  root?: HTMLElement;
73
73
  pluginName?: string;
74
- }, name: string): any;
75
- render(): string;
74
+ } | undefined, name: string): any;
75
+ render(): string | undefined;
76
76
  }
77
- import Plugin from "../../plugin";
77
+ import Plugin from '../../plugin';
@@ -14,7 +14,7 @@ export default class CssFullScreen extends IconPlugin {
14
14
  static get defaultConfig(): ICssConfig;
15
15
  beforeCreate(args: any): void;
16
16
  btnClick(e: any): void;
17
- handleCssFullscreen: any;
17
+ handleCssFullscreen: ((...args: any[]) => void) | undefined;
18
18
  initIcons(): void;
19
19
  animate(isFullScreen: any): void;
20
20
  switchTips(isFullScreen: any): void;
@@ -28,13 +28,13 @@ export default class CssFullScreen extends IconPlugin {
28
28
  class: string;
29
29
  };
30
30
  };
31
- render(): string;
31
+ render(): string | undefined;
32
32
  }
33
33
  export type ICssConfig = {
34
- [propName: string]: any;
35
34
  position: string;
36
35
  index: number;
37
36
  disable: boolean;
38
37
  target: null | HTMLElement;
38
+ [propName: string]: any;
39
39
  };
40
- import IconPlugin from "../common/iconPlugin";
40
+ import IconPlugin from '../common/iconPlugin';
@@ -21,4 +21,4 @@ declare class DanmuIcon extends Plugin {
21
21
  switchTips(isOpen: any): void;
22
22
  render(): string;
23
23
  }
24
- import Plugin from "../../plugin";
24
+ import Plugin from '../../plugin';
@@ -31,9 +31,9 @@ declare class DanmuPanel extends Plugin {
31
31
  opacity: number;
32
32
  fonSize: string;
33
33
  };
34
- activeEvent: string;
34
+ activeEvent: string | undefined;
35
35
  onStateChange(e: any): void;
36
36
  onToggle(e: any): void;
37
37
  render(): string;
38
38
  }
39
- import Plugin from "../../plugin";
39
+ import Plugin from '../../plugin';
@@ -91,7 +91,7 @@ declare class Danmu extends Plugin {
91
91
  showIcon(): void;
92
92
  render(): string;
93
93
  }
94
- import DanmuIcon from "./danmuIcon";
95
- import DanmuPanel from "./danmuPanel";
96
- import Plugin from "../../plugin";
94
+ import DanmuIcon from './danmuIcon';
95
+ import DanmuPanel from './danmuPanel';
96
+ import Plugin from '../../plugin';
97
97
  export { Danmu as default, DanmuIcon, DanmuPanel };
@@ -25,7 +25,7 @@ export default class DefinitionIcon extends OptionsIcon {
25
25
  changeDefinition(to: any, from: any): void;
26
26
  onItemClick(e: any, data: any, ...args: any[]): void;
27
27
  }
28
- export type IDefinition = import('../../defaultConfig').IDefinition;
28
+ export type IDefinition = import("../../defaultConfig").IDefinition;
29
29
  export type IDefinitionConfig = {
30
30
  position?: string;
31
31
  index?: number;
@@ -35,4 +35,4 @@ export type IDefinitionConfig = {
35
35
  hidePortrait?: boolean;
36
36
  className?: string;
37
37
  };
38
- import OptionsIcon from "../common/optionsIcon";
38
+ import OptionsIcon from '../common/optionsIcon';
@@ -15,19 +15,19 @@ export default class Download extends IconPlugin {
15
15
  constructor(args: any);
16
16
  timer: any;
17
17
  isLock: boolean;
18
- _handler: any;
18
+ _handler: ((...args: any[]) => void) | undefined;
19
19
  registerIcons(): {
20
20
  download: any;
21
21
  };
22
22
  download: (e: any) => void;
23
23
  getAbsoluteURL(url: any): any;
24
- render(): string;
24
+ render(): string | undefined;
25
25
  }
26
26
  export type IDownloadConfig = {
27
- [propName: string]: any;
28
27
  position: string;
29
28
  index: number;
30
29
  disable: boolean;
31
- saveAsOptions: import('./saveAs').SaveAsOptions;
30
+ saveAsOptions: import("./saveAs").SaveAsOptions;
31
+ [propName: string]: any;
32
32
  };
33
- import IconPlugin from "../common/iconPlugin";
33
+ import IconPlugin from '../common/iconPlugin';
@@ -20,25 +20,25 @@ export type SaveAsOptions = {
20
20
  /**
21
21
  * - The name of the file to save
22
22
  */
23
- fileName?: string;
23
+ fileName?: string | undefined;
24
24
  /**
25
25
  * - The MIME type of the file
26
26
  */
27
- mimeType?: string;
27
+ mimeType?: string | undefined;
28
28
  /**
29
29
  * - Custom headers for the request
30
30
  */
31
- headers?: any;
31
+ headers?: Object | undefined;
32
32
  /**
33
33
  * - Whether to send cookies with the request
34
34
  */
35
- withCredentials?: boolean;
35
+ withCredentials?: boolean | undefined;
36
36
  /**
37
37
  * - Request timeout in milliseconds
38
38
  */
39
- timeout?: number;
39
+ timeout?: number | undefined;
40
40
  /**
41
41
  * - Function to call before the request is made
42
42
  */
43
- beforeRequest?: Function;
43
+ beforeRequest?: Function | undefined;
44
44
  };
@@ -1,6 +1,5 @@
1
1
  export default DynamicBg;
2
2
  export type IDynamicBgConfig = {
3
- [propName: string]: any;
4
3
  disable?: boolean;
5
4
  mode?: "realtime" | "firstframe" | "framerate";
6
5
  frameRate?: number;
@@ -8,6 +7,7 @@ export type IDynamicBgConfig = {
8
7
  addMask?: boolean;
9
8
  maskBg?: string;
10
9
  multiple?: number;
10
+ [propName: string]: any;
11
11
  };
12
12
  declare class DynamicBg extends Plugin {
13
13
  /**
@@ -27,30 +27,30 @@ declare class DynamicBg extends Plugin {
27
27
  /**
28
28
  * @readonly
29
29
  */
30
- readonly isStart: boolean;
31
- _isLoaded: boolean;
30
+ readonly isStart: boolean | undefined;
31
+ _isLoaded: boolean | undefined;
32
32
  /**
33
33
  * @readonly
34
34
  */
35
- readonly videoPI: number;
35
+ readonly videoPI: number | undefined;
36
36
  /**
37
37
  * @readonly
38
38
  */
39
- readonly preTime: number;
39
+ readonly preTime: number | undefined;
40
40
  /**
41
41
  * @readonly
42
42
  */
43
- readonly interval: number;
43
+ readonly interval: number | undefined;
44
44
  /**
45
45
  * @readonly
46
46
  */
47
- readonly canvas: HTMLElement;
47
+ readonly canvas: HTMLElement | null | undefined;
48
48
  /**
49
49
  * @readonly
50
50
  */
51
51
  readonly canvasCtx: any;
52
52
  _frameCount: any;
53
- _loopType: string;
53
+ _loopType: string | undefined;
54
54
  setConfig(config: any): void;
55
55
  onLoadedData: (e: any) => void;
56
56
  onVisibilitychange: (e: any) => void;
@@ -59,29 +59,28 @@ declare class DynamicBg extends Plugin {
59
59
  * 初始化 canvas对象并使用海报图先渲染首帧w11
60
60
  */
61
61
  private init;
62
- canvasFilter: boolean;
63
- root: HTMLElement;
64
- mask: HTMLElement;
62
+ canvasFilter: boolean | undefined;
63
+ mask: HTMLElement | null | undefined;
65
64
  reRender(root: any): void;
66
65
  /**
67
66
  * Check whether the current video object supports screenshots
68
67
  * @param { Object } video
69
68
  * @returns { DomElement | null }
70
69
  */
71
- checkVideoIsSupport(video: any): DomElement | null;
70
+ checkVideoIsSupport(video: Object): DomElement | null;
72
71
  renderByPoster(): void;
73
72
  renderOnTimeupdate: (e: any) => void;
74
- _checkIfCanStart(): boolean;
73
+ _checkIfCanStart(): boolean | undefined;
75
74
  /**
76
75
  * just render once
77
76
  * @returns
78
77
  */
79
78
  renderOnce(): void;
80
79
  start: (time: any, interval: any) => void;
81
- frameId: any;
80
+ frameId: number | null | undefined;
82
81
  stop: () => void;
83
82
  updateImg(url: any): void;
84
83
  update(video: any, sourcePI: any): void;
85
84
  render(): string;
86
85
  }
87
- import Plugin from "../../plugin";
86
+ import Plugin from '../../plugin';
@@ -1,7 +1,7 @@
1
1
  export default Enter;
2
2
  export type IEnterConfig = {
3
- [propName: string]: any;
4
3
  innerHtml?: string;
4
+ [propName: string]: any;
5
5
  };
6
6
  /**
7
7
  * @typedef { {
@@ -14,6 +14,6 @@ declare class Enter extends Plugin {
14
14
  * @type IEnterConfig
15
15
  */
16
16
  static get defaultConfig(): IEnterConfig;
17
- render(): HTMLElement;
17
+ render(): HTMLElement | null;
18
18
  }
19
- import Plugin from "../../plugin";
19
+ import Plugin from '../../plugin';
@@ -1,8 +1,8 @@
1
1
  export default class ErrorPlugin extends Plugin {
2
- clickHandler: any;
3
- onError: any;
2
+ clickHandler: ((...args: any[]) => void) | undefined;
3
+ onError: ((...args: any[]) => void) | undefined;
4
4
  errorRetry(e: any): void;
5
5
  handleError(error?: {}): void;
6
6
  render(): string;
7
7
  }
8
- import Plugin from "../../plugin";
8
+ import Plugin from '../../plugin';
@@ -15,11 +15,11 @@ export default class FpsDetect extends BasePlugin {
15
15
  };
16
16
  timer: any;
17
17
  _lastDecodedFrames: any;
18
- _currentStuckCount: number;
19
- _lastCheckPoint: number;
20
- _payload: any[];
18
+ _currentStuckCount: number | undefined;
19
+ _lastCheckPoint: number | null | undefined;
20
+ _payload: any[] | undefined;
21
21
  _startTick(): void;
22
- _timer: NodeJS.Timeout;
22
+ _timer: number | null | undefined;
23
23
  _stopTick(): void;
24
24
  _checkBuffer(curTime: any, buffered: any): {
25
25
  enoughBuffer: boolean;
@@ -38,4 +38,4 @@ export type IFullscreenConfig = {
38
38
  disable?: boolean;
39
39
  reportFrame?: number;
40
40
  };
41
- import BasePlugin from "../../plugin";
41
+ import BasePlugin from '../../plugin';
@@ -3,7 +3,7 @@ export default class TopBackIcon extends Plugin {
3
3
  position: string;
4
4
  index: number;
5
5
  };
6
- onClick: (e: any) => void;
6
+ onClick: ((e: any) => void) | undefined;
7
7
  registerIcons(): {
8
8
  screenBack: {
9
9
  icon: any;
@@ -14,4 +14,4 @@ export default class TopBackIcon extends Plugin {
14
14
  show(): void;
15
15
  render(): string;
16
16
  }
17
- import Plugin from "../../plugin";
17
+ import Plugin from '../../plugin';