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
@@ -0,0 +1,243 @@
1
+ /**
2
+ * @typedef { string | MediaStream | Array<{src: string, type?:string, [propName: string]: any}> } IUrl
3
+ */
4
+ /**
5
+ * @typedef {{
6
+ * url: IUrl,
7
+ * definition: any,
8
+ * bitrate?: number,
9
+ * bandwidth?: number,
10
+ * text?: string | { [propName: string]: any },
11
+ * iconText?: string | { [propName: string]: any },
12
+ * [propName: string]: any
13
+ * }} IDefinition
14
+ */
15
+ /**
16
+ * @typedef { {
17
+ * id?: string,
18
+ * el?: HTMLElement,
19
+ * url?: IUrl,
20
+ * domEventType?: 'default' | 'touch' | 'mouse',
21
+ * nullUrlStart?: boolean,
22
+ * width?: number | string,
23
+ * height?: number | string,
24
+ * fluid?: boolean,
25
+ * fitVideoSize?: 'fixWidth'|'fixHeight'|'fixed',
26
+ * videoFillMode?: 'auto'|'fillHeight'|'fillWidth'|'fill'|'cover'|'contain',
27
+ * volume?: number | { [propName: string]: any },
28
+ * autoplay?: boolean,
29
+ * autoplayMuted?: boolean,
30
+ * loop?: boolean,
31
+ * isLive?: boolean,
32
+ * zoom?: number,
33
+ * videoInit?: boolean,
34
+ * poster?: string | { [propName: string]: any },
35
+ * isMobileSimulateMode?: 'mobile' | 'pc',
36
+ * defaultPlaybackRate?: number,
37
+ * execBeforePluginsCall?: () => any,
38
+ * allowSeekAfterEnded?: boolean,
39
+ * enableContextmenu?: boolean,
40
+ * closeVideoClick?: boolean,
41
+ * closeVideoDblclick?: boolean,
42
+ * closePlayerBlur?: boolean,
43
+ * closeDelayBlur?: boolean,
44
+ * leavePlayerTime?: number,
45
+ * closePlayVideoFocus?: boolean,
46
+ * closePauseVideoFocus?: boolean,
47
+ * closeFocusVideoFocus?: boolean,
48
+ * closeControlsBlur?: boolean,
49
+ * topBarAutoHide?: boolean,
50
+ * videoAttributes?: { [propName: string]: any },
51
+ * startTime?: number,
52
+ * seekedStatus?: 'play' | 'pause' | 'auto',
53
+ * miniprogress?: boolean,
54
+ * disableSwipeHandler?: () => any,
55
+ * enableSwipeHandler?: () => any,
56
+ * preProcessUrl?: (url: IUrl, ext?: { [propName: string]: any }) => { url: IUrl, [propName: string]: any },
57
+ * ignores?: Array<'cssfullscreen' | 'screenshot' | 'pip' | 'miniscreen' | 'keyboard' | 'download' | 'playbackrate' | 'time' | 'definition' | 'error' | 'fullscreen' | 'loading' | 'mobile' | 'pc' | 'play' | 'poster' | 'progress' | 'replay' | 'start' | 'volume' | string>,
58
+ * inactive?: number,
59
+ * lang?: string,
60
+ * controls?: boolean | { [propName: string]: any },
61
+ * marginControls?: boolean,
62
+ * fullscreenTarget?: HTMLElement, // 全屏作用的dom元素
63
+ * screenShot?: boolean | { [propName: string]: any },
64
+ * rotate?: boolean | { [propName: string]: any },
65
+ * pip?: boolean | { [propName: string]: any },
66
+ * download?: boolean | { [propName: string]: any },
67
+ * mini?: boolean | { [propName: string]: any },
68
+ * cssFullscreen?: boolean | { [propName: string]: any },
69
+ * keyShortcut?: boolean,
70
+ * presets?: any[],
71
+ * plugins?: any[]
72
+ * playbackRate?: number | Array<number> | { [propName: string]: any },
73
+ * definition?: { list: Array<IDefinition> , defaultDefinition?: IDefinition['definition'], [propName: string]: any},
74
+ * playsinline?: boolean,
75
+ * customDuration?: number,
76
+ * timeOffset?: number,
77
+ * icons?: { [propName: string]: string | HTMLElement | () => HTMLElement | string },
78
+ * i18n?: Array<any>,
79
+ * tabindex?: number,
80
+ * thumbnail?: {
81
+ * urls: Array<string>,
82
+ * pic_num: number,
83
+ * col: number,
84
+ * row: number,
85
+ * height?: number,
86
+ * width?: number,
87
+ * },
88
+ * videoConfig?: { [propName: string]: any },
89
+ * isHideTips?: boolean,
90
+ * minWaitDelay?: number,
91
+ * commonStyle?: {
92
+ * progressColor?: string,
93
+ * playedColor?: string,
94
+ * cachedColor?: string,
95
+ * sliderBtnStyle?: { [propName: string]: any },
96
+ * volumeColor?: string
97
+ * },
98
+ * [propName: string]: any;
99
+ * } } IPlayerOptions
100
+ */
101
+ /**
102
+ * @returns { IPlayerOptions }
103
+ */
104
+ export default function getDefaultConfig(): IPlayerOptions;
105
+ export type IUrl = string | MediaStream | {
106
+ [propName: string]: any;
107
+ src: string;
108
+ type?: string;
109
+ }[];
110
+ export type IDefinition = {
111
+ [propName: string]: any;
112
+ url: IUrl;
113
+ definition: any;
114
+ bitrate?: number;
115
+ bandwidth?: number;
116
+ text?: string | {
117
+ [propName: string]: any;
118
+ };
119
+ iconText?: string | {
120
+ [propName: string]: any;
121
+ };
122
+ };
123
+ export type IPlayerOptions = {
124
+ [propName: string]: any;
125
+ id?: string;
126
+ el?: HTMLElement;
127
+ url?: IUrl;
128
+ domEventType?: 'default' | 'touch' | 'mouse';
129
+ nullUrlStart?: boolean;
130
+ width?: number | string;
131
+ height?: number | string;
132
+ fluid?: boolean;
133
+ fitVideoSize?: 'fixWidth' | 'fixHeight' | 'fixed';
134
+ videoFillMode?: 'auto' | 'fillHeight' | 'fillWidth' | 'fill' | 'cover' | 'contain';
135
+ volume?: number | {
136
+ [propName: string]: any;
137
+ };
138
+ autoplay?: boolean;
139
+ autoplayMuted?: boolean;
140
+ loop?: boolean;
141
+ isLive?: boolean;
142
+ zoom?: number;
143
+ videoInit?: boolean;
144
+ poster?: string | {
145
+ [propName: string]: any;
146
+ };
147
+ isMobileSimulateMode?: 'mobile' | 'pc';
148
+ defaultPlaybackRate?: number;
149
+ execBeforePluginsCall?: () => any;
150
+ allowSeekAfterEnded?: boolean;
151
+ enableContextmenu?: boolean;
152
+ closeVideoClick?: boolean;
153
+ closeVideoDblclick?: boolean;
154
+ closePlayerBlur?: boolean;
155
+ closeDelayBlur?: boolean;
156
+ leavePlayerTime?: number;
157
+ closePlayVideoFocus?: boolean;
158
+ closePauseVideoFocus?: boolean;
159
+ closeFocusVideoFocus?: boolean;
160
+ closeControlsBlur?: boolean;
161
+ topBarAutoHide?: boolean;
162
+ videoAttributes?: {
163
+ [propName: string]: any;
164
+ };
165
+ startTime?: number;
166
+ seekedStatus?: 'play' | 'pause' | 'auto';
167
+ miniprogress?: boolean;
168
+ disableSwipeHandler?: () => any;
169
+ enableSwipeHandler?: () => any;
170
+ preProcessUrl?: (url: IUrl, ext?: {
171
+ [propName: string]: any;
172
+ }) => {
173
+ [propName: string]: any;
174
+ url: IUrl;
175
+ };
176
+ ignores?: Array<'cssfullscreen' | 'screenshot' | 'pip' | 'miniscreen' | 'keyboard' | 'download' | 'playbackrate' | 'time' | 'definition' | 'error' | 'fullscreen' | 'loading' | 'mobile' | 'pc' | 'play' | 'poster' | 'progress' | 'replay' | 'start' | 'volume' | string>;
177
+ inactive?: number;
178
+ lang?: string;
179
+ controls?: boolean | {
180
+ [propName: string]: any;
181
+ };
182
+ marginControls?: boolean;
183
+ fullscreenTarget?: HTMLElement;
184
+ screenShot?: boolean | {
185
+ [propName: string]: any;
186
+ };
187
+ rotate?: boolean | {
188
+ [propName: string]: any;
189
+ };
190
+ pip?: boolean | {
191
+ [propName: string]: any;
192
+ };
193
+ download?: boolean | {
194
+ [propName: string]: any;
195
+ };
196
+ mini?: boolean | {
197
+ [propName: string]: any;
198
+ };
199
+ cssFullscreen?: boolean | {
200
+ [propName: string]: any;
201
+ };
202
+ keyShortcut?: boolean;
203
+ presets?: any[];
204
+ plugins?: any[];
205
+ playbackRate?: number | number[] | {
206
+ [propName: string]: any;
207
+ };
208
+ definition?: {
209
+ [propName: string]: any;
210
+ list: Array<IDefinition>;
211
+ defaultDefinition?: IDefinition['definition'];
212
+ };
213
+ playsinline?: boolean;
214
+ customDuration?: number;
215
+ timeOffset?: number;
216
+ icons?: {
217
+ [propName: string]: string | HTMLElement | (() => HTMLElement | string);
218
+ };
219
+ i18n?: Array<any>;
220
+ tabindex?: number;
221
+ thumbnail?: {
222
+ urls: Array<string>;
223
+ pic_num: number;
224
+ col: number;
225
+ row: number;
226
+ height?: number;
227
+ width?: number;
228
+ };
229
+ videoConfig?: {
230
+ [propName: string]: any;
231
+ };
232
+ isHideTips?: boolean;
233
+ minWaitDelay?: number;
234
+ commonStyle?: {
235
+ progressColor?: string;
236
+ playedColor?: string;
237
+ cachedColor?: string;
238
+ sliderBtnStyle?: {
239
+ [propName: string]: any;
240
+ };
241
+ volumeColor?: string;
242
+ };
243
+ };
@@ -0,0 +1,85 @@
1
+ import { getLang } from "./utils/util.js";
2
+ function getDefaultConfig() {
3
+ return {
4
+ id: "",
5
+ el: null,
6
+ url: "",
7
+ domEventType: "default",
8
+ nullUrlStart: false,
9
+ width: 600,
10
+ height: 337.5,
11
+ fluid: false,
12
+ fitVideoSize: "fixed",
13
+ videoFillMode: "auto",
14
+ volume: 0.6,
15
+ autoplay: false,
16
+ autoplayMuted: false,
17
+ loop: false,
18
+ isLive: false,
19
+ zoom: 1,
20
+ videoInit: true,
21
+ poster: "",
22
+ isMobileSimulateMode: false,
23
+ defaultPlaybackRate: 1,
24
+ execBeforePluginsCall: null,
25
+ allowSeekAfterEnded: true,
26
+ enableContextmenu: true,
27
+ closeVideoClick: false,
28
+ closeVideoDblclick: false,
29
+ closePlayerBlur: false,
30
+ closeDelayBlur: false,
31
+ leavePlayerTime: 3e3,
32
+ closePlayVideoFocus: false,
33
+ closePauseVideoFocus: false,
34
+ closeFocusVideoFocus: true,
35
+ closeControlsBlur: true,
36
+ topBarAutoHide: true,
37
+ videoAttributes: {},
38
+ startTime: 0,
39
+ seekedStatus: "play",
40
+ miniprogress: false,
41
+ disableSwipeHandler: function disableSwipeHandler() {
42
+ },
43
+ enableSwipeHandler: function enableSwipeHandler() {
44
+ },
45
+ preProcessUrl: null,
46
+ ignores: [],
47
+ whitelist: [],
48
+ inactive: 3e3,
49
+ lang: getLang(),
50
+ controls: true,
51
+ marginControls: false,
52
+ fullscreenTarget: null,
53
+ screenShot: false,
54
+ rotate: false,
55
+ pip: false,
56
+ download: false,
57
+ mini: false,
58
+ cssFullscreen: true,
59
+ keyShortcut: true,
60
+ presets: [],
61
+ plugins: [],
62
+ playbackRate: 1,
63
+ definition: {
64
+ list: []
65
+ },
66
+ playsinline: true,
67
+ customDuration: 0,
68
+ timeOffset: 0,
69
+ icons: {},
70
+ i18n: [],
71
+ tabindex: 0,
72
+ thumbnail: null,
73
+ videoConfig: {},
74
+ isHideTips: false,
75
+ minWaitDelay: 200,
76
+ commonStyle: {
77
+ progressColor: "",
78
+ playedColor: "",
79
+ cachedColor: "",
80
+ sliderBtnStyle: {},
81
+ volumeColor: ""
82
+ }
83
+ };
84
+ }
85
+ export { getDefaultConfig as default };
package/es/error.d.ts ADDED
@@ -0,0 +1,114 @@
1
+ export type Player = import('./player').default;
2
+ export type IError = {
3
+ [propName: string]: any;
4
+ playerVersion: string;
5
+ currentTime: number;
6
+ duration: number;
7
+ ended: boolean;
8
+ readyState: number;
9
+ networkState: number;
10
+ src: any;
11
+ errorType: string;
12
+ errorCode: number;
13
+ message: string;
14
+ mediaError?: {
15
+ code: number;
16
+ message?: string;
17
+ };
18
+ originError?: any;
19
+ url?: any;
20
+ host?: string;
21
+ };
22
+ /**
23
+ * @typedef { {
24
+ * playerVersion: string,
25
+ * currentTime: number,
26
+ * duration: number,
27
+ * ended: boolean,
28
+ * readyState: number,
29
+ * networkState: number,
30
+ * src: any,
31
+ * errorType: string,
32
+ * errorCode: number,
33
+ * message: string,
34
+ * mediaError?: {
35
+ * code: number,
36
+ * message?: string
37
+ * },
38
+ * originError?: any,
39
+ * url?: any,
40
+ * host?: string,
41
+ * [propName: string]: any
42
+ * } } IError
43
+ */
44
+ /**
45
+ * @type { IError }
46
+ */
47
+ declare class Errors {
48
+ /**
49
+ *
50
+ * @param { Player } player
51
+ * @param { {
52
+ * errorType: string,
53
+ * errorCode: number,
54
+ * errorMessage: string,
55
+ * originError: any,
56
+ * ext: { [propName: string]: any; }
57
+ * } } errorInfo
58
+ * @returns
59
+ */
60
+ constructor(player: Player, errorInfo?: {
61
+ errorType: string;
62
+ errorCode: number;
63
+ errorMessage: string;
64
+ originError: any;
65
+ ext: {
66
+ [propName: string]: any;
67
+ };
68
+ }, ...args: any[]);
69
+ }
70
+ export namespace ErrorTypes {
71
+ namespace network {
72
+ const code: number;
73
+ }
74
+ namespace mse {
75
+ const code_1: number;
76
+ export { code_1 as code };
77
+ }
78
+ namespace parse {
79
+ const code_2: number;
80
+ export { code_2 as code };
81
+ }
82
+ namespace format {
83
+ const code_3: number;
84
+ export { code_3 as code };
85
+ }
86
+ namespace decoder {
87
+ const code_4: number;
88
+ export { code_4 as code };
89
+ }
90
+ namespace runtime {
91
+ const code_5: number;
92
+ export { code_5 as code };
93
+ }
94
+ namespace timeout {
95
+ const code_6: number;
96
+ export { code_6 as code };
97
+ }
98
+ namespace other {
99
+ const code_7: number;
100
+ export { code_7 as code };
101
+ }
102
+ }
103
+ /**
104
+ * @typedef { import ('./player').default } Player
105
+ */
106
+ export const ERROR_TYPE_MAP: {
107
+ 1: string;
108
+ 2: string;
109
+ 3: string;
110
+ 4: string;
111
+ 5: string;
112
+ 6: string;
113
+ };
114
+ export { Errors as default };
package/es/error.js ADDED
@@ -0,0 +1,75 @@
1
+ import { createClass as _createClass, classCallCheck as _classCallCheck } from "./_virtual/_rollupPluginBabelHelpers.js";
2
+ import version from "./version.js";
3
+ import util from "./utils/util.js";
4
+ var ERROR_TYPE_MAP = {
5
+ 1: "media",
6
+ 2: "media",
7
+ 3: "media",
8
+ 4: "media",
9
+ 5: "media",
10
+ 6: "media"
11
+ };
12
+ var ERROR_MAP = {
13
+ 1: 5101,
14
+ 2: 5102,
15
+ 3: 5103,
16
+ 4: 5104,
17
+ 5: 5105,
18
+ 6: 5106
19
+ };
20
+ var Errors = /* @__PURE__ */ _createClass(
21
+ function Errors2(player) {
22
+ var errorInfo = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
23
+ errorType: "",
24
+ errorCode: 0,
25
+ errorMessage: "",
26
+ originError: "",
27
+ ext: {},
28
+ mediaError: null
29
+ };
30
+ _classCallCheck(this, Errors2);
31
+ var ERROR_TYPES = player && player.i18n ? player.i18n.ERROR_TYPES : null;
32
+ if (player.media) {
33
+ var mediaError = errorInfo.mediaError ? errorInfo.mediaError : player.media.error || {};
34
+ var duration = player.duration, currentTime = player.currentTime, ended = player.ended, src = player.src, currentSrc = player.currentSrc;
35
+ var _player$media = player.media, readyState = _player$media.readyState, networkState = _player$media.networkState;
36
+ var _errc = errorInfo.errorCode || mediaError.code;
37
+ if (ERROR_MAP[_errc]) {
38
+ _errc = ERROR_MAP[_errc];
39
+ }
40
+ var r = {
41
+ playerVersion: version,
42
+ currentTime,
43
+ duration,
44
+ ended,
45
+ readyState,
46
+ networkState,
47
+ src: src || currentSrc,
48
+ errorType: errorInfo.errorType,
49
+ errorCode: _errc,
50
+ message: errorInfo.errorMessage || mediaError.message,
51
+ mediaError,
52
+ originError: errorInfo.originError ? errorInfo.originError.stack : "",
53
+ host: util.getHostFromUrl(src || currentSrc)
54
+ };
55
+ errorInfo.ext && Object.keys(errorInfo.ext).map(function(key) {
56
+ r[key] = errorInfo.ext[key];
57
+ });
58
+ return r;
59
+ } else {
60
+ if (arguments.length > 1) {
61
+ var _r = {
62
+ playerVersion: version,
63
+ domain: document.domain
64
+ };
65
+ var arr = ["errorType", "currentTime", "duration", "networkState", "readyState", "src", "currentSrc", "ended", "errd", "errorCode", "mediaError"];
66
+ for (var i = 0; i < arguments.length; i++) {
67
+ _r[arr[i]] = arguments[i];
68
+ }
69
+ _r.ex = ERROR_TYPES ? (ERROR_TYPES[arguments[0]] || {}).msg : "";
70
+ return _r;
71
+ }
72
+ }
73
+ }
74
+ );
75
+ export { ERROR_TYPE_MAP, Errors as default };
package/es/events.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ export const PLAY: "play";
2
+ export const PLAYING: "playing";
3
+ export const ENDED: "ended";
4
+ export const PAUSE: "pause";
5
+ export const ERROR: "error";
6
+ export const SEEKING: "seeking";
7
+ export const SEEKED: "seeked";
8
+ export const TIME_UPDATE: "timeupdate";
9
+ export const WAITING: "waiting";
10
+ export const CANPLAY: "canplay";
11
+ export const CANPLAY_THROUGH: "canplaythrough";
12
+ export const DURATION_CHANGE: "durationchange";
13
+ export const VOLUME_CHANGE: "volumechange";
14
+ export const LOADED_DATA: "loadeddata";
15
+ export const LOADED_METADATA: "loadedmetadata";
16
+ export const RATE_CHANGE: "ratechange";
17
+ export const PROGRESS: "progress";
18
+ export const LOAD_START: "loadstart";
19
+ export const EMPTIED: "emptied";
20
+ export const STALLED: "stalled";
21
+ export const SUSPEND: "suspend";
22
+ export const ABORT: "abort";
23
+ export const BUFFER_CHANGE: "bufferedChange";
24
+ export const PLAYER_FOCUS: "focus";
25
+ export const PLAYER_BLUR: "blur";
26
+ export const READY: "ready";
27
+ export const URL_NULL: "urlNull";
28
+ export const AUTOPLAY_STARTED: "autoplay_started";
29
+ export const AUTOPLAY_PREVENTED: "autoplay_was_prevented";
30
+ export const COMPLETE: "complete";
31
+ export const REPLAY: "replay";
32
+ export const DESTROY: "destroy";
33
+ export const URL_CHANGE: "urlchange";
34
+ export const DOWNLOAD_SPEED_CHANGE: "download_speed_change";
35
+ export const FULLSCREEN_CHANGE: "fullscreen_change";
36
+ export const CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
37
+ export const MINI_STATE_CHANGE: "mini_state_change";
38
+ export const DEFINITION_CHANGE: "definition_change";
39
+ export const BEFORE_DEFINITION_CHANGE: "before_definition_change";
40
+ export const AFTER_DEFINITION_CHANGE: "after_definition_change";
41
+ export const SEI_PARSED: "SEI_PARSED";
42
+ export const RETRY: "retry";
43
+ export const VIDEO_RESIZE: "video_resize";
44
+ export const PIP_CHANGE: "pip_change";
45
+ export const ROTATE: "rotate";
46
+ export const SCREEN_SHOT: "screenShot";
47
+ export const PLAYNEXT: "playnext";
48
+ export const SHORTCUT: "shortcut";
49
+ export const XGLOG: "xglog";
50
+ export const USER_ACTION: "user_action";
51
+ export const RESET: "reset";
52
+ export const SOURCE_ERROR: "source_error";
53
+ export const SOURCE_SUCCESS: "source_success";
54
+ export const SWITCH_SUBTITLE: "switch_subtitle";
55
+ export const VIDEO_EVENTS: string[];
56
+ export namespace STATS_EVENTS {
57
+ const STATS_INFO: string;
58
+ const STATS_DOWNLOAD: string;
59
+ const STATS_RESET: string;
60
+ }
61
+ export const FPS_STUCK: "fps_stuck";
package/es/events.js ADDED
@@ -0,0 +1,62 @@
1
+ var PLAY = "play";
2
+ var PLAYING = "playing";
3
+ var ENDED = "ended";
4
+ var PAUSE = "pause";
5
+ var ERROR = "error";
6
+ var SEEKING = "seeking";
7
+ var SEEKED = "seeked";
8
+ var TIME_UPDATE = "timeupdate";
9
+ var WAITING = "waiting";
10
+ var CANPLAY = "canplay";
11
+ var CANPLAY_THROUGH = "canplaythrough";
12
+ var DURATION_CHANGE = "durationchange";
13
+ var VOLUME_CHANGE = "volumechange";
14
+ var LOADED_DATA = "loadeddata";
15
+ var LOADED_METADATA = "loadedmetadata";
16
+ var RATE_CHANGE = "ratechange";
17
+ var PROGRESS = "progress";
18
+ var LOAD_START = "loadstart";
19
+ var EMPTIED = "emptied";
20
+ var STALLED = "stalled";
21
+ var SUSPEND = "suspend";
22
+ var ABORT = "abort";
23
+ var BUFFER_CHANGE = "bufferedChange";
24
+ var PLAYER_FOCUS = "focus";
25
+ var PLAYER_BLUR = "blur";
26
+ var READY = "ready";
27
+ var URL_NULL = "urlNull";
28
+ var AUTOPLAY_STARTED = "autoplay_started";
29
+ var AUTOPLAY_PREVENTED = "autoplay_was_prevented";
30
+ var COMPLETE = "complete";
31
+ var REPLAY = "replay";
32
+ var DESTROY = "destroy";
33
+ var URL_CHANGE = "urlchange";
34
+ var DOWNLOAD_SPEED_CHANGE = "download_speed_change";
35
+ var FULLSCREEN_CHANGE = "fullscreen_change";
36
+ var CSS_FULLSCREEN_CHANGE = "cssFullscreen_change";
37
+ var MINI_STATE_CHANGE = "mini_state_change";
38
+ var DEFINITION_CHANGE = "definition_change";
39
+ var BEFORE_DEFINITION_CHANGE = "before_definition_change";
40
+ var AFTER_DEFINITION_CHANGE = "after_definition_change";
41
+ var SEI_PARSED = "SEI_PARSED";
42
+ var RETRY = "retry";
43
+ var VIDEO_RESIZE = "video_resize";
44
+ var PIP_CHANGE = "pip_change";
45
+ var ROTATE = "rotate";
46
+ var SCREEN_SHOT = "screenShot";
47
+ var PLAYNEXT = "playnext";
48
+ var SHORTCUT = "shortcut";
49
+ var XGLOG = "xglog";
50
+ var USER_ACTION = "user_action";
51
+ var RESET = "reset";
52
+ var SOURCE_ERROR = "source_error";
53
+ var SOURCE_SUCCESS = "source_success";
54
+ var SWITCH_SUBTITLE = "switch_subtitle";
55
+ var VIDEO_EVENTS = ["play", "playing", "ended", "pause", "error", "seeking", "seeked", "timeupdate", "waiting", "canplay", "canplaythrough", "durationchange", "volumechange", "loadeddata", "loadedmetadata", "ratechange", "progress", "loadstart", "emptied", "stalled", "suspend", "abort", "lowdecode"];
56
+ var STATS_EVENTS = {
57
+ STATS_INFO: "stats_info",
58
+ STATS_DOWNLOAD: "stats_download",
59
+ STATS_RESET: "stats_reset"
60
+ };
61
+ var FPS_STUCK = "fps_stuck";
62
+ export { ABORT, AFTER_DEFINITION_CHANGE, AUTOPLAY_PREVENTED, AUTOPLAY_STARTED, BEFORE_DEFINITION_CHANGE, BUFFER_CHANGE, CANPLAY, CANPLAY_THROUGH, COMPLETE, CSS_FULLSCREEN_CHANGE, DEFINITION_CHANGE, DESTROY, DOWNLOAD_SPEED_CHANGE, DURATION_CHANGE, EMPTIED, ENDED, ERROR, FPS_STUCK, FULLSCREEN_CHANGE, LOADED_DATA, LOADED_METADATA, LOAD_START, MINI_STATE_CHANGE, PAUSE, PIP_CHANGE, PLAY, PLAYER_BLUR, PLAYER_FOCUS, PLAYING, PLAYNEXT, PROGRESS, RATE_CHANGE, READY, REPLAY, RESET, RETRY, ROTATE, SCREEN_SHOT, SEEKED, SEEKING, SEI_PARSED, SHORTCUT, SOURCE_ERROR, SOURCE_SUCCESS, STALLED, STATS_EVENTS, SUSPEND, SWITCH_SUBTITLE, TIME_UPDATE, URL_CHANGE, URL_NULL, USER_ACTION, VIDEO_EVENTS, VIDEO_RESIZE, VOLUME_CHANGE, WAITING, XGLOG };
package/es/icons.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare var _default: {};
2
+ export default _default;