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.
Files changed (371) hide show
  1. package/browser/controls/airplay.js +1 -1
  2. package/browser/controls/cssFullscreen.js +1 -1
  3. package/browser/controls/danmu.js +3 -1
  4. package/browser/controls/definition.js +1 -1
  5. package/browser/controls/download.js +1 -1
  6. package/browser/controls/enter.js +1 -1
  7. package/browser/controls/error.js +1 -1
  8. package/browser/controls/errorRetry.js +1 -1
  9. package/browser/controls/flex.js +1 -1
  10. package/browser/controls/fullscreen.js +1 -1
  11. package/browser/controls/loading.js +1 -1
  12. package/browser/controls/memoryPlay.js +1 -1
  13. package/browser/controls/miniplayer.js +9 -7
  14. package/browser/controls/mobile.js +1 -1
  15. package/browser/controls/nativeTextTrack.js +1 -1
  16. package/browser/controls/pc.js +1 -1
  17. package/browser/controls/pip.js +1 -1
  18. package/browser/controls/play.js +1 -1
  19. package/browser/controls/playNext.js +1 -1
  20. package/browser/controls/playbackRate.js +1 -1
  21. package/browser/controls/poster.js +1 -1
  22. package/browser/controls/progress.js +1 -1
  23. package/browser/controls/reload.js +1 -1
  24. package/browser/controls/replay.js +1 -1
  25. package/browser/controls/rotate.js +1 -1
  26. package/browser/controls/screenShot.js +1 -1
  27. package/browser/controls/start.js +1 -1
  28. package/browser/controls/textTrack.js +1 -1
  29. package/browser/controls/time.js +1 -1
  30. package/browser/controls/volume.js +1 -1
  31. package/browser/core_player.js +1 -1
  32. package/browser/core_player.js.map +1 -1
  33. package/browser/index.js +11 -7
  34. package/browser/index.js.map +1 -1
  35. package/browser/simple_player.js +1 -1
  36. package/browser/simple_player.js.map +1 -1
  37. package/dist/controls/airplay.js +1 -1
  38. package/dist/controls/cssFullscreen.js +1 -1
  39. package/dist/controls/danmu.js +3 -1
  40. package/dist/controls/definition.js +1 -1
  41. package/dist/controls/download.js +1 -1
  42. package/dist/controls/enter.js +1 -1
  43. package/dist/controls/error.js +1 -1
  44. package/dist/controls/errorRetry.js +1 -1
  45. package/dist/controls/flex.js +1 -1
  46. package/dist/controls/fullscreen.js +1 -1
  47. package/dist/controls/loading.js +1 -1
  48. package/dist/controls/memoryPlay.js +1 -1
  49. package/dist/controls/miniplayer.js +9 -7
  50. package/dist/controls/mobile.js +1 -1
  51. package/dist/controls/nativeTextTrack.js +1 -1
  52. package/dist/controls/pc.js +1 -1
  53. package/dist/controls/pip.js +1 -1
  54. package/dist/controls/play.js +1 -1
  55. package/dist/controls/playNext.js +1 -1
  56. package/dist/controls/playbackRate.js +1 -1
  57. package/dist/controls/poster.js +1 -1
  58. package/dist/controls/progress.js +1 -1
  59. package/dist/controls/reload.js +1 -1
  60. package/dist/controls/replay.js +1 -1
  61. package/dist/controls/rotate.js +1 -1
  62. package/dist/controls/screenShot.js +1 -1
  63. package/dist/controls/start.js +1 -1
  64. package/dist/controls/textTrack.js +1 -1
  65. package/dist/controls/time.js +1 -1
  66. package/dist/controls/volume.js +1 -1
  67. package/dist/core_player.js +2960 -2889
  68. package/dist/core_player.js.map +1 -1
  69. package/dist/index.js +1938 -3321
  70. package/dist/index.js.map +1 -1
  71. package/dist/index.min.css +1 -0
  72. package/dist/index.min.js +2 -0
  73. package/dist/index.min.js.map +1 -0
  74. package/dist/simple_player.js +274 -281
  75. package/dist/simple_player.js.map +1 -1
  76. package/es/_virtual/_rollupPluginBabelHelpers.js +216 -0
  77. package/es/constant.d.ts +4 -0
  78. package/es/constant.js +5 -0
  79. package/es/controls/airplay.js +1 -1
  80. package/es/controls/cssFullscreen.js +1 -1
  81. package/es/controls/danmu.js +3 -1
  82. package/es/controls/definition.js +1 -1
  83. package/es/controls/download.js +1 -1
  84. package/es/controls/enter.js +1 -1
  85. package/es/controls/error.js +1 -1
  86. package/es/controls/errorRetry.js +1 -1
  87. package/es/controls/flex.js +1 -1
  88. package/es/controls/fullscreen.js +1 -1
  89. package/es/controls/i18n.js +1 -1
  90. package/es/controls/keyboard.js +1 -1
  91. package/es/controls/loading.js +1 -1
  92. package/es/controls/localPreview.js +1 -1
  93. package/es/controls/memoryPlay.js +1 -1
  94. package/es/controls/miniplayer.js +9 -7
  95. package/es/controls/mobile.js +1 -1
  96. package/es/controls/nativeTextTrack.js +1 -1
  97. package/es/controls/pc.js +1 -1
  98. package/es/controls/pip.js +1 -1
  99. package/es/controls/play.js +1 -1
  100. package/es/controls/playNext.js +1 -1
  101. package/es/controls/playbackRate.js +1 -1
  102. package/es/controls/poster.js +1 -1
  103. package/es/controls/progress.js +1 -1
  104. package/es/controls/reload.js +1 -1
  105. package/es/controls/replay.js +1 -1
  106. package/es/controls/rotate.js +1 -1
  107. package/es/controls/screenShot.js +1 -1
  108. package/es/controls/start.js +1 -1
  109. package/es/controls/textTrack.js +1 -1
  110. package/es/controls/time.js +1 -1
  111. package/es/controls/volume.js +1 -1
  112. package/es/core_player.js +1 -1
  113. package/es/core_player.js.map +1 -1
  114. package/es/defaultConfig.d.ts +243 -0
  115. package/es/defaultConfig.js +85 -0
  116. package/es/error.d.ts +114 -0
  117. package/es/error.js +75 -0
  118. package/es/events.d.ts +61 -0
  119. package/es/events.js +62 -0
  120. package/es/icons.d.ts +2 -0
  121. package/es/index.css +499 -0
  122. package/es/index.d.ts +25 -0
  123. package/es/index.js +11 -7
  124. package/es/index.js.map +1 -1
  125. package/es/index.scss +29 -0
  126. package/es/index.umd.d.ts +60 -0
  127. package/es/index.umd.js +30 -0
  128. package/es/lang/en.d.ts +91 -0
  129. package/es/lang/en.js +77 -0
  130. package/es/lang/i18n.d.ts +36 -0
  131. package/es/lang/i18n.js +122 -0
  132. package/es/lang/index.d.ts +2 -0
  133. package/es/lang/jp.d.ts +91 -0
  134. package/es/lang/jp.js +77 -0
  135. package/es/lang/zh-cn.d.ts +91 -0
  136. package/es/lang/zh-cn.js +77 -0
  137. package/es/lang/zh-hk.d.ts +91 -0
  138. package/es/lang/zh-hk.js +77 -0
  139. package/es/mediaProxy.d.ts +334 -0
  140. package/es/mediaProxy.js +623 -0
  141. package/es/player.d.ts +825 -0
  142. package/es/player.js +1945 -0
  143. package/es/plugin/basePlugin.d.ts +180 -0
  144. package/es/plugin/basePlugin.js +259 -0
  145. package/es/plugin/hooksDescriptor.d.ts +60 -0
  146. package/es/plugin/hooksDescriptor.js +149 -0
  147. package/es/plugin/index.d.ts +13 -0
  148. package/es/plugin/plugin.d.ts +207 -0
  149. package/es/plugin/plugin.js +542 -0
  150. package/es/plugin/pluginsManager.d.ts +162 -0
  151. package/es/plugin/pluginsManager.js +362 -0
  152. package/es/plugin/preset.d.ts +1 -0
  153. package/es/plugin/preset.js +28 -0
  154. package/es/plugin/resizeObserver.d.ts +3 -0
  155. package/es/plugin/resizeObserver.js +108 -0
  156. package/es/plugins/assets/back.js +4 -0
  157. package/es/plugins/assets/download.js +4 -0
  158. package/es/plugins/assets/exitCssFull.js +4 -0
  159. package/es/plugins/assets/exitFull.js +4 -0
  160. package/es/plugins/assets/loading.js +4 -0
  161. package/es/plugins/assets/panel.js +4 -0
  162. package/es/plugins/assets/pause.js +4 -0
  163. package/es/plugins/assets/pipIcon.js +4 -0
  164. package/es/plugins/assets/pipIconExit.js +4 -0
  165. package/es/plugins/assets/play.js +4 -0
  166. package/es/plugins/assets/playNext.js +4 -0
  167. package/es/plugins/assets/replay.js +4 -0
  168. package/es/plugins/assets/requestCssFull.js +7 -0
  169. package/es/plugins/assets/requestFull.js +4 -0
  170. package/es/plugins/assets/rotate.js +4 -0
  171. package/es/plugins/assets/seekicon.js +4 -0
  172. package/es/plugins/assets/volumeLarge.js +4 -0
  173. package/es/plugins/assets/volumeMuted.js +4 -0
  174. package/es/plugins/assets/volumeSmall.js +4 -0
  175. package/es/plugins/common/iconPlugin.d.ts +5 -0
  176. package/es/plugins/common/iconPlugin.js +42 -0
  177. package/es/plugins/common/iconTools.d.ts +1 -0
  178. package/es/plugins/common/iconTools.js +8 -0
  179. package/es/plugins/common/index.scss +2 -0
  180. package/es/plugins/common/optionList.d.ts +15 -0
  181. package/es/plugins/common/optionList.js +120 -0
  182. package/es/plugins/common/optionsIcon.d.ts +40 -0
  183. package/es/plugins/common/optionsIcon.js +304 -0
  184. package/es/plugins/common/optionsIcon.scss +154 -0
  185. package/es/plugins/common/thumbnail.d.ts +62 -0
  186. package/es/plugins/common/thumbnail.js +191 -0
  187. package/es/plugins/common/thumbnail.scss +27 -0
  188. package/es/plugins/controls/index.css +132 -0
  189. package/es/plugins/controls/index.d.ts +73 -0
  190. package/es/plugins/controls/index.js +189 -0
  191. package/es/plugins/controls/index.scss +204 -0
  192. package/es/plugins/cssFullScreen/index.css +12 -0
  193. package/es/plugins/cssFullScreen/index.d.ts +40 -0
  194. package/es/plugins/cssFullScreen/index.js +136 -0
  195. package/es/plugins/cssFullScreen/index.scss +19 -0
  196. package/es/plugins/danmu/danmuIcon.d.ts +24 -0
  197. package/es/plugins/danmu/danmuIcon.js +98 -0
  198. package/es/plugins/danmu/danmuPanel.d.ts +39 -0
  199. package/es/plugins/danmu/danmuPanel.js +81 -0
  200. package/es/plugins/danmu/index.css +603 -0
  201. package/es/plugins/danmu/index.d.ts +96 -0
  202. package/es/plugins/danmu/index.js +313 -0
  203. package/es/plugins/danmu/index.scss +356 -0
  204. package/es/plugins/definition/index.css +4 -0
  205. package/es/plugins/definition/index.d.ts +38 -0
  206. package/es/plugins/definition/index.js +164 -0
  207. package/es/plugins/definition/index.scss +4 -0
  208. package/es/plugins/download/index.css +13 -0
  209. package/es/plugins/download/index.d.ts +31 -0
  210. package/es/plugins/download/index.js +107 -0
  211. package/es/plugins/download/index.scss +22 -0
  212. package/es/plugins/dynamicBg/index.css +16 -0
  213. package/es/plugins/dynamicBg/index.d.ts +83 -0
  214. package/es/plugins/dynamicBg/index.js +316 -0
  215. package/es/plugins/dynamicBg/index.scss +19 -0
  216. package/es/plugins/enter/index.css +104 -0
  217. package/es/plugins/enter/index.d.ts +19 -0
  218. package/es/plugins/enter/index.js +46 -0
  219. package/es/plugins/enter/index.scss +78 -0
  220. package/es/plugins/error/index.css +29 -0
  221. package/es/plugins/error/index.d.ts +8 -0
  222. package/es/plugins/error/index.js +75 -0
  223. package/es/plugins/error/index.scss +34 -0
  224. package/es/plugins/fpsDetect/index.d.ts +34 -0
  225. package/es/plugins/fpsDetect/index.js +149 -0
  226. package/es/plugins/fullscreen/backicon.d.ts +17 -0
  227. package/es/plugins/fullscreen/backicon.js +72 -0
  228. package/es/plugins/fullscreen/index.css +23 -0
  229. package/es/plugins/fullscreen/index.d.ts +58 -0
  230. package/es/plugins/fullscreen/index.js +202 -0
  231. package/es/plugins/fullscreen/index.scss +35 -0
  232. package/es/plugins/gapJump/index.d.ts +21 -0
  233. package/es/plugins/gapJump/index.js +142 -0
  234. package/es/plugins/keyboard/index.d.ts +89 -0
  235. package/es/plugins/keyboard/index.js +421 -0
  236. package/es/plugins/loading/index.css +58 -0
  237. package/es/plugins/loading/index.d.ts +11 -0
  238. package/es/plugins/loading/index.js +43 -0
  239. package/es/plugins/loading/index.scss +70 -0
  240. package/es/plugins/logger/index.d.ts +54 -0
  241. package/es/plugins/logger/index.js +311 -0
  242. package/es/plugins/miniScreen/index.css +179 -0
  243. package/es/plugins/miniScreen/index.d.ts +68 -0
  244. package/es/plugins/miniScreen/index.js +212 -0
  245. package/es/plugins/miniScreen/index.scss +198 -0
  246. package/es/plugins/miniScreen/miniScreenIcon.d.ts +11 -0
  247. package/es/plugins/miniScreen/miniScreenIcon.js +56 -0
  248. package/es/plugins/mobile/index.css +181 -0
  249. package/es/plugins/mobile/index.d.ts +125 -0
  250. package/es/plugins/mobile/index.js +631 -0
  251. package/es/plugins/mobile/index.scss +180 -0
  252. package/es/plugins/mobile/touch.d.ts +43 -0
  253. package/es/plugins/mobile/touch.js +214 -0
  254. package/es/plugins/netAdaption/index.d.ts +5 -0
  255. package/es/plugins/pc/index.css +3 -0
  256. package/es/plugins/pc/index.d.ts +14 -0
  257. package/es/plugins/pc/index.js +199 -0
  258. package/es/plugins/pc/index.scss +5 -0
  259. package/es/plugins/pip/index.css +12 -0
  260. package/es/plugins/pip/index.d.ts +37 -0
  261. package/es/plugins/pip/index.js +222 -0
  262. package/es/plugins/pip/index.scss +21 -0
  263. package/es/plugins/play/index.css +12 -0
  264. package/es/plugins/play/index.d.ts +23 -0
  265. package/es/plugins/play/index.js +127 -0
  266. package/es/plugins/play/index.scss +18 -0
  267. package/es/plugins/playNext/index.css +22 -0
  268. package/es/plugins/playNext/index.d.ts +19 -0
  269. package/es/plugins/playNext/index.js +104 -0
  270. package/es/plugins/playNext/index.scss +35 -0
  271. package/es/plugins/playbackRate/index.css +4 -0
  272. package/es/plugins/playbackRate/index.d.ts +31 -0
  273. package/es/plugins/playbackRate/index.js +140 -0
  274. package/es/plugins/playbackRate/index.scss +6 -0
  275. package/es/plugins/poster/index.css +39 -0
  276. package/es/plugins/poster/index.d.ts +27 -0
  277. package/es/plugins/poster/index.js +109 -0
  278. package/es/plugins/poster/index.scss +56 -0
  279. package/es/plugins/progress/index.css +234 -0
  280. package/es/plugins/progress/index.d.ts +178 -0
  281. package/es/plugins/progress/index.js +687 -0
  282. package/es/plugins/progress/index.scss +288 -0
  283. package/es/plugins/progress/innerList.d.ts +49 -0
  284. package/es/plugins/progress/innerList.js +285 -0
  285. package/es/plugins/progress/miniProgress.d.ts +9 -0
  286. package/es/plugins/progress/miniProgress.js +55 -0
  287. package/es/plugins/progressPreview/dotsApi.d.ts +1 -0
  288. package/es/plugins/progressPreview/dotsApi.js +269 -0
  289. package/es/plugins/progressPreview/index.css +190 -0
  290. package/es/plugins/progressPreview/index.d.ts +87 -0
  291. package/es/plugins/progressPreview/index.js +475 -0
  292. package/es/plugins/progressPreview/index.scss +235 -0
  293. package/es/plugins/prompt/index.css +47 -0
  294. package/es/plugins/prompt/index.d.ts +24 -0
  295. package/es/plugins/prompt/index.js +110 -0
  296. package/es/plugins/prompt/index.scss +53 -0
  297. package/es/plugins/replay/index.css +33 -0
  298. package/es/plugins/replay/index.d.ts +16 -0
  299. package/es/plugins/replay/index.js +109 -0
  300. package/es/plugins/replay/index.scss +41 -0
  301. package/es/plugins/rotate/index.css +0 -0
  302. package/es/plugins/rotate/index.d.ts +22 -0
  303. package/es/plugins/rotate/index.js +148 -0
  304. package/es/plugins/rotate/index.scss +0 -0
  305. package/es/plugins/rotate/index2.js +2 -0
  306. package/es/plugins/screenShot/index.css +3 -0
  307. package/es/plugins/screenShot/index.d.ts +30 -0
  308. package/es/plugins/screenShot/index.js +178 -0
  309. package/es/plugins/screenShot/index.scss +5 -0
  310. package/es/plugins/start/index.css +91 -0
  311. package/es/plugins/start/index.d.ts +41 -0
  312. package/es/plugins/start/index.js +267 -0
  313. package/es/plugins/start/index.scss +115 -0
  314. package/es/plugins/stats/index.d.ts +38 -0
  315. package/es/plugins/stats/index.js +194 -0
  316. package/es/plugins/testspeed/index.d.ts +26 -0
  317. package/es/plugins/testspeed/index.js +207 -0
  318. package/es/plugins/time/index.css +46 -0
  319. package/es/plugins/time/index.d.ts +28 -0
  320. package/es/plugins/time/index.js +225 -0
  321. package/es/plugins/time/index.scss +57 -0
  322. package/es/plugins/time/timesegments.d.ts +24 -0
  323. package/es/plugins/time/timesegments.js +216 -0
  324. package/es/plugins/track/index.css +91 -0
  325. package/es/plugins/track/index.d.ts +132 -0
  326. package/es/plugins/track/index.js +463 -0
  327. package/es/plugins/track/index.scss +111 -0
  328. package/es/plugins/track/nativeSubTitle.d.ts +22 -0
  329. package/es/plugins/track/nativeSubTitle.js +94 -0
  330. package/es/plugins/volume/index.css +95 -0
  331. package/es/plugins/volume/index.d.ts +88 -0
  332. package/es/plugins/volume/index.js +319 -0
  333. package/es/plugins/volume/index.scss +124 -0
  334. package/es/plugins/waitingTimeoutJump/index.d.ts +15 -0
  335. package/es/plugins/waitingTimeoutJump/index.js +88 -0
  336. package/es/presets/default-en.d.ts +33 -0
  337. package/es/presets/default-en.js +63 -0
  338. package/es/presets/default.d.ts +34 -0
  339. package/es/presets/default.js +70 -0
  340. package/es/presets/index.d.ts +4 -0
  341. package/es/presets/live.d.ts +94 -0
  342. package/es/presets/live.js +39 -0
  343. package/es/presets/mobile.d.ts +103 -0
  344. package/es/presets/mobile.js +34 -0
  345. package/es/simple_player.js +1 -1
  346. package/es/simple_player.js.map +1 -1
  347. package/es/state.d.ts +11 -0
  348. package/es/state.js +12 -0
  349. package/es/stateClassMap.d.ts +32 -0
  350. package/es/stateClassMap.js +32 -0
  351. package/es/style/common/animation.scss +16 -0
  352. package/es/style/common/svg-url.scss +70 -0
  353. package/es/style/common.scss +457 -0
  354. package/es/style/index.scss +4 -0
  355. package/es/style/variable.scss +76 -0
  356. package/es/utils/database.d.ts +31 -0
  357. package/es/utils/database.js +107 -0
  358. package/es/utils/debug.d.ts +10 -0
  359. package/es/utils/debug.js +43 -0
  360. package/es/utils/draggabilly.d.ts +54 -0
  361. package/es/utils/draggabilly.js +410 -0
  362. package/es/utils/sniffer.d.ts +28 -0
  363. package/es/utils/sniffer.js +150 -0
  364. package/es/utils/url.d.ts +1 -0
  365. package/es/utils/util.d.ts +304 -0
  366. package/es/utils/util.js +827 -0
  367. package/es/utils/xgplayerTimeRange.d.ts +7 -0
  368. package/es/utils/xgplayerTimeRange.js +25 -0
  369. package/es/version.d.ts +2 -0
  370. package/es/version.js +2 -0
  371. package/package.json +2 -3
package/es/player.d.ts ADDED
@@ -0,0 +1,825 @@
1
+ export type IPlayerOptions = import('./defaultConfig').IPlayerOptions;
2
+ export type IDefinition = import('./defaultConfig').IDefinition;
3
+ export type IUrl = import('./defaultConfig').IUrl;
4
+ declare class Player extends MediaProxy {
5
+ /**
6
+ * @type {number}
7
+ * @description set debugger level
8
+ * 1 - only print error logs
9
+ * 2 - print warn logs and error logs
10
+ * 3 - print all debug logs and error stack logs
11
+ */
12
+ static set debugger(arg: number);
13
+ static get debugger(): number;
14
+ /**
15
+ * 获取当前处理激活态的实例id
16
+ * @returns { number | string | null }
17
+ */
18
+ static getCurrentUserActivePlayerId(): number | string | null;
19
+ /**
20
+ * 设置实例的用户行为激活状态
21
+ * @param { number | string } playerId
22
+ * @param { boolean } isActive
23
+ */
24
+ static setCurrentUserActive(playerId: number | string, isActive: boolean): void;
25
+ /**
26
+ * 当前浏览器是否支持hevc编码
27
+ * @returns {boolean}
28
+ */
29
+ static isHevcSupported(): boolean;
30
+ /**
31
+ * 检测编码参数是否被当前浏览器支持
32
+ * @doc https://developer.mozilla.org/en-US/docs/Web/API/MediaCapabilities/decodingInfo
33
+ * @param {MediaDecodingConfiguration} info
34
+ * @returns {MediaCapabilitiesDecodingInfo}
35
+ */
36
+ static probeConfigSupported(info: MediaDecodingConfiguration): MediaCapabilitiesDecodingInfo;
37
+ /**
38
+ * @deprecated
39
+ * 插件全部迁移完成再做删除
40
+ */
41
+ static install(name: any, descriptor: any): void;
42
+ /**
43
+ * @deprecated
44
+ * 插件全部迁移完成再做删除
45
+ */
46
+ static use(name: any, descriptor: any): void;
47
+ static defaultPreset: any;
48
+ /**
49
+ * @description 自定义media构造函数
50
+ */
51
+ static XgVideoProxy: any;
52
+ /**
53
+ * @param { IPlayerOptions } options
54
+ */
55
+ constructor(options: IPlayerOptions);
56
+ /**
57
+ * @type { IPlayerOptions }
58
+ * @description 当前播放器的配置信息
59
+ */
60
+ config: IPlayerOptions;
61
+ /**
62
+ * @type { string }
63
+ * @private
64
+ */
65
+ private _pluginInfoId;
66
+ userTimer: any;
67
+ /**
68
+ * @private
69
+ */
70
+ private waitTimer;
71
+ /**
72
+ * @private
73
+ */
74
+ private _state;
75
+ /**
76
+ * @public
77
+ * @readonly
78
+ * @type { boolean }
79
+ */
80
+ public readonly isError: boolean;
81
+ /**
82
+ * Whether the player is in the seeking state
83
+ * @type { boolean }
84
+ * @readonly
85
+ */
86
+ readonly isSeeking: boolean;
87
+ /**
88
+ * @type { boolean }
89
+ * @readonly
90
+ */
91
+ readonly isCanplay: boolean;
92
+ /**
93
+ * @private
94
+ * @readonly
95
+ */
96
+ private readonly _useAutoplay;
97
+ /**
98
+ * @type { number }
99
+ */
100
+ rotateDeg: number;
101
+ /**
102
+ * Whether the player is focus
103
+ * @type { boolean }
104
+ * @readonly
105
+ */
106
+ readonly isActive: boolean;
107
+ /**
108
+ * Whether player is currently in fullscreen
109
+ * @type { boolean }
110
+ * @readonly
111
+ */
112
+ readonly fullscreen: boolean;
113
+ /**
114
+ * @type { boolean }
115
+ * @readonly
116
+ */
117
+ readonly cssfullscreen: boolean;
118
+ /**
119
+ * @type { boolean }
120
+ * @readonly
121
+ */
122
+ readonly isRotateFullscreen: boolean;
123
+ /**
124
+ * fullscreenElement
125
+ * @type { HTMLElement | null }
126
+ * @readonly
127
+ */
128
+ readonly _fullscreenEl: HTMLElement | null;
129
+ timeSegments: any[];
130
+ /**
131
+ * cssfullscreen target Element
132
+ * @type { HTMLElement | null }
133
+ * @readonly
134
+ */
135
+ readonly _cssfullscreenEl: HTMLElement | null;
136
+ /**
137
+ * @type { IDefinition | null }
138
+ * @readonly
139
+ */
140
+ readonly curDefinition: IDefinition | null;
141
+ /**
142
+ * @private
143
+ * @type { string }
144
+ */
145
+ private _orgCss;
146
+ /**
147
+ * @readonly
148
+ * @type { number }
149
+ */
150
+ readonly _fullScreenOffset: number;
151
+ /**
152
+ * @private
153
+ * @type { number }
154
+ */
155
+ private _videoHeight;
156
+ /**
157
+ * @private
158
+ * @type { number }
159
+ */
160
+ private _videoWidth;
161
+ videoPos: {
162
+ pi: number;
163
+ scale: number;
164
+ rotate: number;
165
+ x: number;
166
+ y: number;
167
+ h: number;
168
+ w: number;
169
+ vy: number;
170
+ vx: number;
171
+ };
172
+ sizeInfo: {
173
+ width: number;
174
+ height: number;
175
+ left: number;
176
+ top: number;
177
+ };
178
+ /**
179
+ * @private
180
+ * @type { { t: number, acc:number, acc: number, loopAcc: number, [propName: string]: any;} }
181
+ */
182
+ private _accPlayed;
183
+ /**
184
+ * @description 播放器时长、播放时间偏移信息
185
+ */
186
+ _offsetInfo: {
187
+ currentTime: number;
188
+ duration: number;
189
+ };
190
+ /**
191
+ * @type { null | HTMLElement }
192
+ * @readonly
193
+ * @description 控制栏和video不同布局的时候内部容器
194
+ */
195
+ readonly innerContainer: null | HTMLElement;
196
+ /**
197
+ * @type { null | Object }
198
+ * @readonly
199
+ * @description 控制栏插件
200
+ */
201
+ readonly controls: null | any;
202
+ /**
203
+ * @type { null | HTMLElement }
204
+ * @readonly
205
+ */
206
+ readonly topBar: null | HTMLElement;
207
+ /**
208
+ * @type { null | HTMLElement }
209
+ * @readonly
210
+ * @description 当前播放器根节点
211
+ */
212
+ readonly root: null | HTMLElement;
213
+ __i18n: import("./lang/i18n").IXGI18n;
214
+ /**
215
+ * @readonly
216
+ * @type {any}
217
+ */
218
+ readonly database: any;
219
+ /**
220
+ * @readonly
221
+ * @type { boolean }
222
+ */
223
+ readonly isUserActive: boolean;
224
+ /**
225
+ * @private
226
+ * @description seek之后canplay回调函数定义
227
+ * @type { Function | null }
228
+ */
229
+ private _onceSeekCanplay;
230
+ /**
231
+ * @description 记录seek之前是否处于暂停状态
232
+ * @type { number }
233
+ * @private
234
+ */
235
+ private _isPauseBeforeSeek;
236
+ /**
237
+ * @description 内部状态记录
238
+ * @type { {
239
+ * isActiveLocked: boolean;
240
+ * } }
241
+ * @readonly
242
+ */
243
+ readonly innerStates: {
244
+ isActiveLocked: boolean;
245
+ };
246
+ /**
247
+ * init control domElement
248
+ * @private
249
+ */
250
+ private _initDOM;
251
+ /**
252
+ * @private
253
+ */
254
+ private _initBaseDoms;
255
+ /**
256
+ * @readonly
257
+ * @type { HTMLElement |null }
258
+ */
259
+ readonly leftBar: HTMLElement | null;
260
+ /**
261
+ * @readonly
262
+ * @type { HTMLElement | null }
263
+ */
264
+ readonly rightBar: HTMLElement | null;
265
+ /**
266
+ * @private
267
+ */
268
+ private _bindEvents;
269
+ playFunc: () => void;
270
+ /**
271
+ * @private
272
+ */
273
+ private _unbindEvents;
274
+ /**
275
+ *
276
+ * @param { any } url
277
+ * @returns
278
+ */
279
+ _startInit(url: any): void;
280
+ set hasStart(arg: boolean);
281
+ /**
282
+ * @type { boolean }
283
+ * @description 是否开始播放
284
+ */
285
+ get hasStart(): boolean;
286
+ /**
287
+ * @description 注册组件 组件列表config.plugins
288
+ * @param { {boolean} } [isInit] 是否是首次初始化
289
+ * @private
290
+ */
291
+ private _registerPlugins;
292
+ /**
293
+ * @private
294
+ */
295
+ private _loadingPlugins;
296
+ /**
297
+ * @private
298
+ */
299
+ private _registerPresets;
300
+ /**
301
+ * @private
302
+ * @param { string } position ]
303
+ */
304
+ private _getRootByPosition;
305
+ /**
306
+ *
307
+ * @param { {plugin: function, options:object} | function } plugin
308
+ * @param { {[propName: string]: any;} } [config]
309
+ * @returns { any } plugin
310
+ */
311
+ registerPlugin(plugin: Function | {
312
+ plugin: Function;
313
+ options: object;
314
+ }, config?: {
315
+ [propName: string]: any;
316
+ }): any;
317
+ /**
318
+ *
319
+ * @param { any } plugin
320
+ */
321
+ deregister(plugin: any): void;
322
+ /**
323
+ *
324
+ * @param { any } plugin
325
+ * @param { boolean } removedFromConfig
326
+ */
327
+ unRegisterPlugin(plugin: any, removedFromConfig?: boolean): void;
328
+ removePluginFromConfig(plugin: any): void;
329
+ /**
330
+ * 当前播放器挂载的插件实例列表
331
+ * @type { {[propName: string]: any | null } }
332
+ */
333
+ get plugins(): {
334
+ [propName: string]: any;
335
+ };
336
+ /**
337
+ * get a plugin instance
338
+ * @param { string } pluginName
339
+ * @return { null | any } plugin
340
+ */
341
+ getPlugin(pluginName: string): null | any;
342
+ /**
343
+ *
344
+ * @param { string } className
345
+ */
346
+ addClass(className: string): void;
347
+ /**
348
+ *
349
+ * @param { string } className
350
+ * @returns
351
+ */
352
+ removeClass(className: string): void;
353
+ /**
354
+ *
355
+ * @param { string } className
356
+ * @returns { boolean } has
357
+ */
358
+ hasClass(className: string): boolean;
359
+ /**
360
+ *
361
+ * @param { string } key
362
+ * @param { any } value
363
+ * @returns void
364
+ */
365
+ setAttribute(key: string, value: any): void;
366
+ /**
367
+ *
368
+ * @param { string } key
369
+ * @param { any } value
370
+ * @returns void
371
+ */
372
+ removeAttribute(key: string, value: any): void;
373
+ /**
374
+ *
375
+ * @param { any } url
376
+ * @returns { Promise<void> | void }
377
+ * @description 启动播放器,start一般都是播放器内部隐式调用,主要功能是将video添加到DOM
378
+ */
379
+ start(url: any): Promise<void> | void;
380
+ /**
381
+ * @param { string | object } url
382
+ * @param { boolean | {
383
+ * seamless?: boolean,
384
+ * currentTime?: number,
385
+ * bitrate?: number
386
+ * } } [options]
387
+ * @returns { Promise | null } 执行结果
388
+ */
389
+ switchURL(url: string | object, options?: boolean | {
390
+ seamless?: boolean;
391
+ currentTime?: number;
392
+ bitrate?: number;
393
+ }): Promise<any> | null;
394
+ currentTime: any;
395
+ /**
396
+ * @description call play without play hook
397
+ * @deprecated this api renamed to mediaPlay, you can call it as player.mediaPlay()
398
+ */
399
+ videoPlay(): void;
400
+ /**
401
+ * @description call play without play hook
402
+ */
403
+ mediaPlay(): Promise<void>;
404
+ /**
405
+ * @private
406
+ */
407
+ private _errorTimer;
408
+ /**
409
+ * @description call play without pause hook
410
+ */
411
+ mediaPause(): void;
412
+ /**
413
+ * @description call play without pause hook
414
+ * @deprecated this api renamed to mediaPause, you can call it as player.mediaPause()
415
+ */
416
+ videoPause(): void;
417
+ play(): any;
418
+ /**
419
+ *
420
+ * @param { number } time
421
+ * @param { 'play' | 'pause' | 'auto' } [status]
422
+ * @returns
423
+ */
424
+ seek(time: number, status?: 'play' | 'pause' | 'auto'): void;
425
+ getInitDefinition(): void;
426
+ /**
427
+ * @typedef { import('./defaultConfig').IDefinition } definition
428
+ */
429
+ /**
430
+ * @description change the definition of the current playback
431
+ * @param { definition } to
432
+ * @param { definition } [from]
433
+ */
434
+ changeDefinition(to: import("./defaultConfig").IDefinition, from?: import("./defaultConfig").IDefinition): void;
435
+ reload(): void;
436
+ /**
437
+ * @private
438
+ */
439
+ private reloadFunc;
440
+ resetState(): void;
441
+ /**
442
+ * 重置播放实例
443
+ * @param { Array<string> } unregisterPlugins 重置的时候需要卸载重新初始化的插件列表
444
+ * @param { boolean } [isResetConfig] 是否需要重置配置列表
445
+ * @returns
446
+ */
447
+ reset(unregisterPlugins?: Array<string>, isResetConfig?: boolean): void;
448
+ replay(): void;
449
+ retry(): void;
450
+ /**
451
+ *
452
+ * @param { HTMLElement } root
453
+ * @param { HTMLElement } [el]
454
+ * @param { string } [rootClass]
455
+ * @param { string } [pClassName]
456
+ */
457
+ changeFullStyle(root: HTMLElement, el?: HTMLElement, rootClass?: string, pClassName?: string): void;
458
+ /**
459
+ * @private
460
+ */
461
+ private _orgPCss;
462
+ /**
463
+ *
464
+ * @param { HTMLElement } root
465
+ * @param { HTMLElement } [el]
466
+ * @param { string } [rootClass]
467
+ * @param { string } [pClassName]
468
+ */
469
+ recoverFullStyle(root: HTMLElement, el?: HTMLElement, rootClass?: string, pClassName?: string): void;
470
+ /**
471
+ * @param { HTMLElement } [el]
472
+ * @returns { Promise<void> }
473
+ */
474
+ getFullscreen(el?: HTMLElement): Promise<void>;
475
+ /**
476
+ * @private
477
+ */
478
+ private _fullActionFrom;
479
+ /**
480
+ * @param { HTMLElement } [el]
481
+ * @returns { Promise<void> }
482
+ */
483
+ exitFullscreen(el?: HTMLElement): Promise<void>;
484
+ /**
485
+ * @param { HTMLElement } [el]
486
+ * @returns
487
+ */
488
+ getCssFullscreen(el?: HTMLElement): void;
489
+ /**
490
+ * @param { HTMLElement } [el]
491
+ * @returns
492
+ */
493
+ exitCssFullscreen(): void;
494
+ /**
495
+ * 进入旋转全屏
496
+ * @param { HTMLElement } [el]
497
+ */
498
+ getRotateFullscreen(el?: HTMLElement): void;
499
+ _rootStyle: string | boolean;
500
+ /**
501
+ * 退出旋转全屏
502
+ * @param { HTMLElement } [el]
503
+ */
504
+ exitRotateFullscreen(el?: HTMLElement): void;
505
+ setRotateDeg(deg: any): void;
506
+ /**
507
+ * @description 播放器焦点状态,控制栏显示
508
+ * @param { {
509
+ * autoHide?: boolean, // 是否可以自动隐藏
510
+ * delay?: number // 自动隐藏的延迟时间, ms, 不传默认使用3000ms
511
+ * isLock?: boolean // 是否锁定, 锁定之后自动呼出和blur调用都不生效, 默认值false
512
+ * } } [data]
513
+ */
514
+ focus(data?: {
515
+ autoHide?: boolean;
516
+ delay?: number;
517
+ isLock?: boolean;
518
+ }): void;
519
+ /**
520
+ * @description 取消播放器当前焦点状态
521
+ * @param { { ignorePaused?: boolean } } [data]
522
+ */
523
+ blur(data?: {
524
+ ignorePaused?: boolean;
525
+ }): void;
526
+ /**
527
+ * @protected
528
+ * @param { { autoHide?: boolean, delay?: number, isLock?: boolean } } [data]
529
+ * @returns
530
+ */
531
+ protected onFocus(data?: {
532
+ autoHide?: boolean;
533
+ delay?: number;
534
+ isLock?: boolean;
535
+ }): void;
536
+ /**
537
+ * @protected
538
+ * @param {{ ignorePaused?: boolean }} [data]
539
+ * @returns
540
+ */
541
+ protected onBlur({ ignorePaused }?: {
542
+ ignorePaused?: boolean;
543
+ }): void;
544
+ canPlayFunc: () => void;
545
+ /**
546
+ *
547
+ */
548
+ onFullscreenChange: (event: any, isFullScreen: any) => void;
549
+ _onWebkitbeginfullscreen: (e: any) => void;
550
+ _onWebkitendfullscreen: (e: any) => void;
551
+ onEmptied(): void;
552
+ /**
553
+ * @protected
554
+ */
555
+ protected onCanplay(): void;
556
+ onLoadeddata(): void;
557
+ onLoadstart(): void;
558
+ /**
559
+ * @protected
560
+ */
561
+ protected onPlay(): void;
562
+ /**
563
+ * @protected
564
+ */
565
+ protected onPause(): void;
566
+ /**
567
+ * @protected
568
+ */
569
+ protected onEnded(): void;
570
+ /**
571
+ * @protected
572
+ */
573
+ protected onError(): void;
574
+ /**
575
+ * @protected
576
+ */
577
+ protected onSeeking(): void;
578
+ /**
579
+ * @protected
580
+ */
581
+ protected onSeeked(): void;
582
+ /**
583
+ * @protected
584
+ */
585
+ protected onWaiting(): void;
586
+ /**
587
+ * @protected
588
+ */
589
+ protected onPlaying(): void;
590
+ /**
591
+ * @protected
592
+ */
593
+ protected onTimeupdate(): void;
594
+ onVolumechange(): void;
595
+ onRatechange(): void;
596
+ /**
597
+ * 触发用户行为事件,第一个参数是Dom事件
598
+ * @param { Event } event
599
+ * @param { string } action
600
+ * @param {[propName: string]: any; } [params]
601
+ * @returns
602
+ */
603
+ emitUserAction(event: Event, action: string, params: any): void;
604
+ updateAcc(endType: any): void;
605
+ /**
606
+ *
607
+ * @param { number } time
608
+ * @returns { boolean }
609
+ */
610
+ checkBuffer(time: number): boolean;
611
+ resizePosition(): void;
612
+ /**
613
+ * @description position video/audio according to height ratio and y coordinate
614
+ * @param { { h: number, y?: number, x?:number, w?:number} } pos
615
+ * @returns
616
+ */
617
+ position(pos?: {
618
+ h: number;
619
+ y?: number;
620
+ x?: number;
621
+ w?: number;
622
+ }): void;
623
+ /**
624
+ * @description Update configuration parameters
625
+ * @param { IPlayerOptions } config
626
+ */
627
+ setConfig(config: IPlayerOptions): void;
628
+ /**
629
+ * @description play another video resource
630
+ * @param { IPlayerOptions } config
631
+ */
632
+ playNext(config: IPlayerOptions): void;
633
+ resize(): void;
634
+ /**
635
+ *
636
+ * @param { number } left
637
+ * @param { number } top
638
+ * @returns
639
+ */
640
+ updateObjectPosition(left?: number, top?: number): void;
641
+ /**
642
+ * @protected
643
+ * @param { number } newState
644
+ */
645
+ protected setState(newState: number): void;
646
+ /**
647
+ * @description url preprocessing
648
+ * @param { IUrl } url
649
+ * @param { {[propName: string]: any} } [ext]
650
+ * @returns { url: IUrl, [propName: string]: any }
651
+ */
652
+ preProcessUrl(url: IUrl, ext?: {
653
+ [propName: string]: any;
654
+ }): import("./defaultConfig").IUrl;
655
+ /**
656
+ * @type { number }
657
+ */
658
+ get state(): number;
659
+ /**
660
+ * @type { boolean }
661
+ */
662
+ get isFullscreen(): boolean;
663
+ /**
664
+ * @type { boolean }
665
+ */
666
+ get isCssfullScreen(): boolean;
667
+ set isPlaying(arg: boolean);
668
+ /**
669
+ * @type { boolean }
670
+ * @description 是否已经进入起播状态
671
+ */
672
+ get isPlaying(): boolean;
673
+ /**
674
+ * @type { Array.<IDefinition> }
675
+ */
676
+ set definitionList(arg: import("./defaultConfig").IDefinition[]);
677
+ get definitionList(): import("./defaultConfig").IDefinition[];
678
+ /**
679
+ * @description VideoFrames infos
680
+ * @type { {
681
+ * total: number,
682
+ * dropped: number,
683
+ * corrupted: number,
684
+ * droppedRate: number,
685
+ * droppedDuration: number
686
+ * } }
687
+ */
688
+ get videoFrameInfo(): {
689
+ total: number;
690
+ dropped: number;
691
+ corrupted: number;
692
+ droppedRate: number;
693
+ droppedDuration: number;
694
+ };
695
+ /**
696
+ * @type { string }
697
+ */
698
+ set lang(arg: string);
699
+ get lang(): string;
700
+ get i18n(): import("./lang/i18n").IXGI18nText;
701
+ get i18nKeys(): {
702
+ [propName: string]: string;
703
+ };
704
+ /**
705
+ * @type { string }
706
+ */
707
+ get version(): string;
708
+ /**
709
+ * @type { number | string }
710
+ */
711
+ get playerId(): string | number;
712
+ /**
713
+ * @type { any }
714
+ */
715
+ set url(arg: any);
716
+ get url(): any;
717
+ /**
718
+ * @private
719
+ */
720
+ private __url;
721
+ /**
722
+ * @type { string }
723
+ */
724
+ set poster(arg: any);
725
+ get poster(): any;
726
+ get error(): any;
727
+ /**
728
+ * @type { boolean }
729
+ */
730
+ get fullscreenChanging(): boolean;
731
+ /**
732
+ * 累计观看时长
733
+ * @type number
734
+ */
735
+ get cumulateTime(): number;
736
+ /**
737
+ * @type { number }
738
+ */
739
+ set zoom(arg: number);
740
+ /**
741
+ * @type { number }
742
+ */
743
+ get zoom(): number;
744
+ /**
745
+ * @type {number}
746
+ * @description Media element rotation angle, Only multiples of 90 degrees are supported
747
+ */
748
+ set videoRotateDeg(arg: number);
749
+ get videoRotateDeg(): number;
750
+ /**
751
+ * @description 均衡下载速度,单位kb/s, 根据10条最新下载速度计算出来的加权值,如果没有测速能力则默认是0
752
+ * @type { number }
753
+ */
754
+ set avgSpeed(arg: number);
755
+ get avgSpeed(): number;
756
+ /**
757
+ * @type { number }
758
+ * 最新一次下载速度,单位kb/s, 如果没有测速能力则默认是0
759
+ */
760
+ set realTimeSpeed(arg: number);
761
+ get realTimeSpeed(): number;
762
+ set offsetCurrentTime(arg: number);
763
+ get offsetCurrentTime(): number;
764
+ set offsetDuration(arg: number);
765
+ get offsetDuration(): number;
766
+ /**
767
+ * @param { string } hookName
768
+ * @param { Function } handler
769
+ * @param { {pre: Function| null , next: Function | null} } preset
770
+ * @returns
771
+ */
772
+ hook(hookName: string, handler: Function, preset?: {
773
+ pre: Function | null;
774
+ next: Function | null;
775
+ }, ...args: any[]): any;
776
+ /**
777
+ * @param { string } hookName
778
+ * @param { (player: any, ...args) => boolean | Promise<any> } handler
779
+ * @param {...any} args
780
+ * @returns {boolean} isSuccess
781
+ */
782
+ useHooks(hookName: string, handler: (player: any, ...args: any[]) => boolean | Promise<any>, ...args: any[]): boolean;
783
+ /**
784
+ *
785
+ * @param { string } hookName
786
+ * @param { (player: any, ...args) => boolean | Promise<any> } handler
787
+ * @returns
788
+ */
789
+ removeHooks(hookName: string, handler: (player: any, ...args: any[]) => boolean | Promise<any>, ...args: any[]): any;
790
+ /**
791
+ *
792
+ * @param { string } pluginName
793
+ * @param { string } hookName
794
+ * @param { (plugin: any, ...args) => boolean | Promise<any> } handler
795
+ * @param {...any} args
796
+ * @returns { boolean } isSuccess
797
+ */
798
+ usePluginHooks(pluginName: string, hookName: string, handler: (plugin: any, ...args: any[]) => boolean | Promise<any>, ...args: any[]): boolean;
799
+ /**
800
+ *
801
+ * @param { string } pluginName
802
+ * @param { string } hookName
803
+ * @param { (plugin: any, ...args) => boolean | Promise<any> } handler
804
+ * @param {...any} args
805
+ * @returns { boolean } isSuccess
806
+ */
807
+ removePluginHooks(pluginName: string, hookName: string, handler: (plugin: any, ...args: any[]) => boolean | Promise<any>, ...args: any[]): boolean;
808
+ /**
809
+ * 设置当前实例的用户激活态
810
+ * @param { boolean } isActive
811
+ * @param { boolean } [isMuted]
812
+ */
813
+ setUserActive(isActive: boolean, isMuted?: boolean): void;
814
+ muted: any;
815
+ }
816
+ import Plugin from "./plugin/plugin";
817
+ import BasePlugin from "./plugin/basePlugin";
818
+ import * as Events from "./events";
819
+ import Errors from "./error";
820
+ import Sniffer from "./utils/sniffer";
821
+ import Util from "./utils/util";
822
+ import STATE_CLASS from "./stateClassMap";
823
+ import I18N from "./lang/i18n";
824
+ import MediaProxy from "./mediaProxy";
825
+ export { Player as default, Plugin, BasePlugin, Events, Errors, Sniffer, Util, STATE_CLASS, I18N };