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,11 @@
1
+ export default Loading;
2
+ declare class Loading extends Plugin {
3
+ static get defaultConfig(): {
4
+ position: string;
5
+ };
6
+ registerIcons(): {
7
+ loadingIcon: any;
8
+ };
9
+ render(): string;
10
+ }
11
+ import Plugin from "../../plugin/plugin";
@@ -0,0 +1,43 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import Plugin, { POSITIONS } from "../../plugin/plugin.js";
3
+ import loadingIcon from "../assets/loading.js";
4
+ var Loading = /* @__PURE__ */ function(_Plugin) {
5
+ _inherits(Loading2, _Plugin);
6
+ var _super = _createSuper(Loading2);
7
+ function Loading2() {
8
+ _classCallCheck(this, Loading2);
9
+ return _super.apply(this, arguments);
10
+ }
11
+ _createClass(Loading2, [{
12
+ key: "registerIcons",
13
+ value: function registerIcons() {
14
+ return {
15
+ loadingIcon
16
+ };
17
+ }
18
+ }, {
19
+ key: "afterCreate",
20
+ value: function afterCreate() {
21
+ this.appendChild("xg-loading-inner", this.icons.loadingIcon);
22
+ }
23
+ }, {
24
+ key: "render",
25
+ value: function render() {
26
+ return '\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>';
27
+ }
28
+ }], [{
29
+ key: "pluginName",
30
+ get: function get() {
31
+ return "loading";
32
+ }
33
+ }, {
34
+ key: "defaultConfig",
35
+ get: function get() {
36
+ return {
37
+ position: POSITIONS.ROOT
38
+ };
39
+ }
40
+ }]);
41
+ return Loading2;
42
+ }(Plugin);
43
+ export { Loading as default };
@@ -0,0 +1,70 @@
1
+ @import '../../style/variable';
2
+
3
+ @keyframes loadingRotate {
4
+ 0% {
5
+ transform: rotate(0);
6
+ }
7
+ 25% {
8
+ transform: rotate(90deg);
9
+ }
10
+ 50% {
11
+ transform: rotate(180deg);
12
+ }
13
+ 75% {
14
+ transform: rotate(270deg);
15
+ }
16
+ 100% {
17
+ transform: rotate(360deg);
18
+ }
19
+ }
20
+ @keyframes loadingDashOffset {
21
+ 0% {
22
+ stroke-dashoffset: 236;
23
+ }
24
+ 100% {
25
+ stroke-dashoffset: 0;
26
+ }
27
+ }
28
+ xg-loading-inner {
29
+ display: block;
30
+ height: 100%;
31
+ width: 100%;
32
+ transform-origin: center;
33
+ animation: loadingRotate 1s 0.1s linear infinite;
34
+ }
35
+ .xgplayer-loading {
36
+ display: none;
37
+ width: 70px;
38
+ height: 70px;
39
+ overflow: hidden;
40
+ // transform: scale(0.7);
41
+ position: absolute;
42
+ z-index: 10;
43
+ left: 50%;
44
+ top: 50%;
45
+ transform: translate(-50%, -50%);
46
+ pointer-events: none;
47
+ svg, img {
48
+ width: 100%;
49
+ height: 100%;
50
+ }
51
+ }
52
+
53
+ .xgplayer-mobile {
54
+ .xgplayer-loading {
55
+ width: 50px;
56
+ height: 50px;
57
+ }
58
+ }
59
+
60
+ .xgplayer-isloading {
61
+ .xgplayer-loading{
62
+ display: block;
63
+ }
64
+ }
65
+
66
+ .xgplayer-nostart,.xgplayer-pause,.xgplayer-is-enter, .xgplayer-is-ended,.xgplayer-is-error {
67
+ .xgplayer-loading{
68
+ display: none;
69
+ }
70
+ }
@@ -0,0 +1,54 @@
1
+ export namespace LOG_TYPES {
2
+ const LOAD_START: string;
3
+ const LOADED_DATA: string;
4
+ const FIRST_FRAME: string;
5
+ const WAIT_START: string;
6
+ const WAIT_END: string;
7
+ const SEEK_START: string;
8
+ const SEEK_END: string;
9
+ }
10
+ declare class XGLogger extends BasePlugin {
11
+ static get defaultConfig(): {
12
+ waitTimeout: number;
13
+ };
14
+ _waitType: string | number;
15
+ newPointTime: number;
16
+ loadedCostTime: number;
17
+ startCostTime: number;
18
+ pt: number;
19
+ vt: number;
20
+ fvt: number;
21
+ _initOnceEvents(): void;
22
+ _sendFF(endType: any): void;
23
+ s: number;
24
+ _onTimeupdate: () => void;
25
+ _onAutoplayStart: () => void;
26
+ _onReset: () => void;
27
+ _state: {
28
+ autoplayStart: boolean;
29
+ isFFLoading: boolean;
30
+ isTimeUpdate: boolean;
31
+ isFFSend: boolean;
32
+ isLs: boolean;
33
+ };
34
+ _isSeeking: boolean;
35
+ seekingStart: number;
36
+ waitingStart: number;
37
+ fixedWaitingStart: number;
38
+ _isWaiting: boolean;
39
+ _waitTimer: any;
40
+ _waittTimer: any;
41
+ _onSeeking: () => void;
42
+ _onSeeked: () => void;
43
+ _onWaitingLoadStart: () => void;
44
+ _onWaiting: () => void;
45
+ _onError: () => void;
46
+ _startWaitTimeout(): void;
47
+ _onPlaying: () => void;
48
+ endState(endType: any): void;
49
+ suspendSeekingStatus(endType: any): void;
50
+ suspendWaitingStatus(endType: any): void;
51
+ emitLog(eventType: any, data: any): void;
52
+ }
53
+ import BasePlugin from "../../plugin";
54
+ export { XGLogger as default };
@@ -0,0 +1,311 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass, objectSpread2 as _objectSpread2 } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import util from "../../utils/util.js";
3
+ import { LOAD_START, LOADED_DATA, SEEKING, SEEKED, DESTROY, URL_CHANGE, PLAYING, CANPLAY, WAITING, ERROR, RESET, AUTOPLAY_STARTED, TIME_UPDATE, XGLOG } from "../../events.js";
4
+ import XG_DEBUG from "../../utils/debug.js";
5
+ import Plugin from "../../plugin/plugin.js";
6
+ function now() {
7
+ return new Date().getTime();
8
+ }
9
+ var LOG_TYPES = {
10
+ LOAD_START: "loadstart",
11
+ LOADED_DATA: "loadeddata",
12
+ FIRST_FRAME: "firstFrame",
13
+ WAIT_START: "waitingStart",
14
+ WAIT_END: "waitingEnd",
15
+ SEEK_START: "seekStart",
16
+ SEEK_END: "seekEnd"
17
+ };
18
+ var XGLogger = /* @__PURE__ */ function(_BasePlugin) {
19
+ _inherits(XGLogger2, _BasePlugin);
20
+ var _super = _createSuper(XGLogger2);
21
+ function XGLogger2() {
22
+ var _this;
23
+ _classCallCheck(this, XGLogger2);
24
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25
+ args[_key] = arguments[_key];
26
+ }
27
+ _this = _super.call.apply(_super, [this].concat(args));
28
+ _defineProperty(_assertThisInitialized(_this), "_onTimeupdate", function() {
29
+ _this._state.isTimeUpdate = true;
30
+ if (_this._state.autoplayStart) {
31
+ XG_DEBUG.logInfo("[xgLogger]".concat(_this.player.playerId, " _onTimeupdate"));
32
+ _this._sendFF("onTimeupdate");
33
+ }
34
+ });
35
+ _defineProperty(_assertThisInitialized(_this), "_onAutoplayStart", function() {
36
+ XG_DEBUG.logInfo("[xgLogger]".concat(_this.player.playerId, " _onAutoplayStart"));
37
+ _this._state.autoplayStart = true;
38
+ _this.vt && _this._sendFF("onAutoplayStart");
39
+ });
40
+ _defineProperty(_assertThisInitialized(_this), "_onReset", function() {
41
+ _this._state = {
42
+ autoplayStart: false,
43
+ isFFLoading: false,
44
+ isTimeUpdate: false,
45
+ isFFSend: false,
46
+ isLs: false
47
+ };
48
+ _this.vt = 0;
49
+ _this.pt = 0;
50
+ _this.fvt = 0;
51
+ _this.newPointTime = now();
52
+ _this.loadedCostTime = 0;
53
+ _this.startCostTime = 0;
54
+ _this._isSeeking = false;
55
+ _this.seekingStart = 0;
56
+ _this.waitingStart = 0;
57
+ _this.fixedWaitingStart = 0;
58
+ _this._isWaiting = false;
59
+ _this._waitTimer && util.clearTimeout(_assertThisInitialized(_this), _this._waitTimer);
60
+ _this._waittTimer && util.clearTimeout(_assertThisInitialized(_this), _this._waittTimer);
61
+ _this._waitTimer = null;
62
+ _this._waittTimer = null;
63
+ _this._waitType = 0;
64
+ });
65
+ _defineProperty(_assertThisInitialized(_this), "_onSeeking", function() {
66
+ if (_this.seekingStart) {
67
+ return;
68
+ }
69
+ _this.suspendWaitingStatus("seek");
70
+ _this.seekingStart = now();
71
+ _this.emitLog(LOG_TYPES.SEEK_START, {
72
+ start: now()
73
+ });
74
+ });
75
+ _defineProperty(_assertThisInitialized(_this), "_onSeeked", function() {
76
+ _this.suspendSeekingStatus("seeked");
77
+ });
78
+ _defineProperty(_assertThisInitialized(_this), "_onWaitingLoadStart", function() {
79
+ if (_this._isWaiting || _this.vt) {
80
+ return;
81
+ }
82
+ _this._isWaiting = true;
83
+ _this.waitingStart = now();
84
+ _this.fixedWaitingStart = now();
85
+ _this._waitType = 1;
86
+ _this.emitLog(LOG_TYPES.WAIT_START, {
87
+ fixedStart: _this.fixedWaitingStart,
88
+ start: _this.waitingStart,
89
+ type: 1,
90
+ endType: "loadstart"
91
+ });
92
+ });
93
+ _defineProperty(_assertThisInitialized(_this), "_onWaiting", function() {
94
+ if (_this._isWaiting || !_this.vt) {
95
+ return;
96
+ }
97
+ _this._isWaiting = true;
98
+ if (!_this.vt) {
99
+ _this._waitType = 1;
100
+ } else if (_this.seekingStart) {
101
+ _this._waitType = 2;
102
+ } else {
103
+ _this._waitType = 0;
104
+ }
105
+ _this.fixedWaitingStart = now();
106
+ _this._waitTimer = util.setTimeout(_assertThisInitialized(_this), function() {
107
+ if (_this._isWaiting) {
108
+ _this.waitingStart = now();
109
+ util.clearTimeout(_assertThisInitialized(_this), _this._waitTimer);
110
+ _this._waitTimer = null;
111
+ _this._startWaitTimeout();
112
+ _this.emitLog(LOG_TYPES.WAIT_START, {
113
+ fixedStart: _this.fixedWaitingStart,
114
+ start: _this.waitingStart,
115
+ type: _this._waitType,
116
+ endType: _this._waitType === 2 ? "seek" : "playing"
117
+ });
118
+ }
119
+ }, 200);
120
+ });
121
+ _defineProperty(_assertThisInitialized(_this), "_onError", function() {
122
+ _this.suspendSeekingStatus("error");
123
+ _this.suspendWaitingStatus("error");
124
+ });
125
+ _defineProperty(_assertThisInitialized(_this), "_onPlaying", function() {
126
+ _this._isWaiting && _this.suspendWaitingStatus("playing");
127
+ });
128
+ return _this;
129
+ }
130
+ _createClass(XGLogger2, [{
131
+ key: "afterCreate",
132
+ value: function afterCreate() {
133
+ var _this2 = this;
134
+ this._onReset();
135
+ this._waitType = "firstFrame";
136
+ this._initOnceEvents();
137
+ this.newPointTime = now();
138
+ this.loadedCostTime = 0;
139
+ this.startCostTime = 0;
140
+ this.on(LOAD_START, function() {
141
+ var _state = _this2._state;
142
+ var autoplayStart = _state.autoplayStart, isFFSend = _state.isFFSend;
143
+ _this2.startCostTime = now() - _this2.newPointTime;
144
+ XG_DEBUG.logInfo("[xgLogger]".concat(_this2.player.playerId, " LOAD_START"), "autoplayStart:".concat(autoplayStart, " isFFSend:").concat(isFFSend, " startCostTime:").concat(_this2.startCostTime, " newPointTime").concat(_this2.newPointTime));
145
+ if (isFFSend) {
146
+ return;
147
+ }
148
+ !_state.isLs && _this2.emitLog(LOG_TYPES.LOAD_START, {});
149
+ _state.isLs = true;
150
+ _state.isTimeUpdate = false;
151
+ _state.isFFLoading = true;
152
+ _this2.pt = now();
153
+ _this2.vt = 0;
154
+ _this2.fvt = 0;
155
+ _this2._initOnceEvents();
156
+ _this2._onWaitingLoadStart();
157
+ });
158
+ this.on(LOADED_DATA, function() {
159
+ _this2.vt = now();
160
+ _this2.fvt = _this2.vt - _this2.pt;
161
+ _this2.loadedCostTime = _this2.vt - _this2.newPointTime;
162
+ var _this2$_state = _this2._state, isTimeUpdate = _this2$_state.isTimeUpdate, isFFSend = _this2$_state.isFFSend, autoplayStart = _this2$_state.autoplayStart;
163
+ XG_DEBUG.logInfo("[xgLogger]".concat(_this2.player.playerId, " LOADED_DATA"), "fvt:".concat(_this2.fvt, " isTimeUpdate:").concat(_this2._state.isTimeUpdate, " loadedCostTime:").concat(_this2.loadedCostTime));
164
+ if (isTimeUpdate || autoplayStart) {
165
+ _this2._sendFF("loadedData");
166
+ }
167
+ if (!isFFSend) {
168
+ _this2.emitLog(LOG_TYPES.LOADED_DATA, {});
169
+ }
170
+ _this2.suspendWaitingStatus("loadeddata");
171
+ });
172
+ this.on(SEEKING, this._onSeeking);
173
+ this.on(SEEKED, this._onSeeked);
174
+ this.on(DESTROY, function() {
175
+ _this2.endState("destroy");
176
+ });
177
+ this.on(URL_CHANGE, function() {
178
+ _this2.endState("urlChange");
179
+ XG_DEBUG.logInfo("[xgLogger]".concat(_this2.player.playerId, " URL_CHANGE"));
180
+ _this2._state.isFFSend && _this2._onReset();
181
+ });
182
+ this.on([PLAYING, CANPLAY], this._onPlaying);
183
+ this.on(WAITING, this._onWaiting);
184
+ this.on(ERROR, this._onError);
185
+ this.on(RESET, function() {
186
+ XG_DEBUG.logInfo("[xgLogger]".concat(_this2.player.playerId, " RESET"));
187
+ _this2.endState("reset");
188
+ _this2._initOnceEvents();
189
+ _this2._onReset();
190
+ });
191
+ }
192
+ }, {
193
+ key: "_initOnceEvents",
194
+ value: function _initOnceEvents() {
195
+ this.off(AUTOPLAY_STARTED, this._onAutoplayStart);
196
+ this.off(TIME_UPDATE, this._onTimeupdate);
197
+ this.once(AUTOPLAY_STARTED, this._onAutoplayStart);
198
+ this.once(TIME_UPDATE, this._onTimeupdate);
199
+ }
200
+ }, {
201
+ key: "_sendFF",
202
+ value: function _sendFF(endType) {
203
+ this.s = now();
204
+ var _this$_state = this._state, isFFLoading = _this$_state.isFFLoading, isFFSend = _this$_state.isFFSend;
205
+ XG_DEBUG.logInfo("[xgLogger]".concat(this.player.playerId, " _sendFF"), "".concat(endType, " fvt:").concat(this.fvt, " isFFLoading:").concat(isFFLoading, " !isFFSend:").concat(!isFFSend));
206
+ if (this.vt > 0 && isFFLoading && !isFFSend) {
207
+ XG_DEBUG.logInfo("[xgLogger]".concat(this.player.playerId, " emitLog_firstFrame"), endType);
208
+ this._state.isFFLoading = false;
209
+ this._state.isFFSend = true;
210
+ this.emitLog(LOG_TYPES.FIRST_FRAME, {
211
+ fvt: this.fvt,
212
+ costTime: this.fvt,
213
+ vt: this.vt,
214
+ startCostTime: this.startCostTime,
215
+ loadedCostTime: this.loadedCostTime
216
+ });
217
+ }
218
+ }
219
+ }, {
220
+ key: "_startWaitTimeout",
221
+ value: function _startWaitTimeout() {
222
+ var _this3 = this;
223
+ if (this._waittTimer) {
224
+ util.clearTimeout(this, this._waittTimer);
225
+ }
226
+ this._waittTimer = util.setTimeout(this, function() {
227
+ _this3.suspendWaitingStatus("timeout");
228
+ util.clearTimeout(_this3, _this3._waittTimer);
229
+ _this3._waittTimer = null;
230
+ }, this.config.waitTimeout);
231
+ }
232
+ }, {
233
+ key: "endState",
234
+ value: function endState(endType) {
235
+ this.suspendWaitingStatus(endType);
236
+ this.suspendSeekingStatus(endType);
237
+ }
238
+ }, {
239
+ key: "suspendSeekingStatus",
240
+ value: function suspendSeekingStatus(endType) {
241
+ if (!this.seekingStart) {
242
+ return;
243
+ }
244
+ var _now = now();
245
+ var _cost = _now - this.seekingStart;
246
+ this.seekingStart = 0;
247
+ this.emitLog(LOG_TYPES.SEEK_END, {
248
+ end: _now,
249
+ costTime: _cost,
250
+ endType
251
+ });
252
+ }
253
+ }, {
254
+ key: "suspendWaitingStatus",
255
+ value: function suspendWaitingStatus(endType) {
256
+ if (this._waitTimer) {
257
+ util.clearTimeout(this, this._waitTimer);
258
+ this._waitTimer = null;
259
+ }
260
+ if (this._waittTimer) {
261
+ util.clearTimeout(this, this._waittTimer);
262
+ this._waittTimer = null;
263
+ }
264
+ this._isWaiting = false;
265
+ if (!this.waitingStart) {
266
+ return;
267
+ }
268
+ var _now = now();
269
+ var _cost = _now - this.waitingStart;
270
+ var _fixedCost = _now - this.fixedWaitingStart;
271
+ var waitTimeout = this.config.waitTimeout;
272
+ this._isWaiting = false;
273
+ this.waitingStart = 0;
274
+ this.fixedWaitingStart = 0;
275
+ this.emitLog(LOG_TYPES.WAIT_END, {
276
+ fixedCostTime: _fixedCost > waitTimeout ? waitTimeout : _fixedCost,
277
+ costTime: _cost > waitTimeout ? waitTimeout : _cost,
278
+ type: endType === "loadeddata" ? 1 : this._waitType,
279
+ endType: this._waitType === 2 ? "seek" : endType
280
+ });
281
+ }
282
+ }, {
283
+ key: "emitLog",
284
+ value: function emitLog(eventType, data) {
285
+ var player = this.player;
286
+ this.emit(XGLOG, _objectSpread2({
287
+ t: now(),
288
+ host: util.getHostFromUrl(player.currentSrc),
289
+ vtype: player.vtype,
290
+ eventType,
291
+ currentTime: this.player.currentTime,
292
+ readyState: player.video.readyState,
293
+ networkState: player.video.networkState
294
+ }, data));
295
+ }
296
+ }], [{
297
+ key: "pluginName",
298
+ get: function get() {
299
+ return "xgLogger";
300
+ }
301
+ }, {
302
+ key: "defaultConfig",
303
+ get: function get() {
304
+ return {
305
+ waitTimeout: 1e4
306
+ };
307
+ }
308
+ }]);
309
+ return XGLogger2;
310
+ }(Plugin);
311
+ export { LOG_TYPES, XGLogger as default };
@@ -0,0 +1,179 @@
1
+ .xg-mini-layer {
2
+ display: none;
3
+ position: absolute;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ z-index: 11;
9
+ background: linear-gradient(180deg, rgba(57, 57, 57, 0.9), rgba(57, 57, 57, 0) 50.27%);
10
+ }
11
+ .xg-mini-layer .mask {
12
+ pointer-events: none;
13
+ position: absolute;
14
+ top: 0;
15
+ left: 0;
16
+ height: 100%;
17
+ width: 100%;
18
+ background-color: rgba(0, 0, 0, 0.4);
19
+ }
20
+ .xg-mini-layer xg-mini-header {
21
+ display: flex;
22
+ top: 0;
23
+ left: 0;
24
+ right: 40px;
25
+ box-sizing: border-box;
26
+ padding: 10px 3px 0 8px;
27
+ justify-content: space-between;
28
+ color: #ffffff;
29
+ font-size: 14px;
30
+ position: absolute;
31
+ z-index: 22;
32
+ }
33
+ .xg-mini-layer xg-mini-header .xgplayer-pip-disableBtn {
34
+ pointer-events: all;
35
+ }
36
+ .xg-mini-layer xg-mini-header #disabledMini {
37
+ display: none;
38
+ position: relative;
39
+ }
40
+ .xg-mini-layer xg-mini-header #disabledMini + label {
41
+ cursor: pointer;
42
+ position: relative;
43
+ display: flex;
44
+ align-items: center;
45
+ }
46
+ .xg-mini-layer xg-mini-header #disabledMini + label::before {
47
+ content: "";
48
+ color: #ff142b;
49
+ background-color: transparent;
50
+ border-radius: 2px;
51
+ border: solid 1px #cdcdcd;
52
+ width: 16px;
53
+ height: 16px;
54
+ display: inline-block;
55
+ text-align: center;
56
+ vertical-align: middle;
57
+ line-height: 16px;
58
+ margin-right: 7px;
59
+ }
60
+ .xg-mini-layer xg-mini-header #disabledMini:checked + label {
61
+ color: #ff142b;
62
+ }
63
+ .xg-mini-layer xg-mini-header #disabledMini:checked + label::before {
64
+ border-color: #ff142b;
65
+ }
66
+ .xg-mini-layer xg-mini-header #disabledMini:checked + label:after {
67
+ content: "";
68
+ position: absolute;
69
+ width: 4px;
70
+ height: 8px;
71
+ border-color: #ff142b;
72
+ border-style: solid;
73
+ border-width: 0px 2px 2px 0px;
74
+ transform: rotate(45deg);
75
+ left: 6px;
76
+ top: 5px;
77
+ }
78
+ .xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn xg-tips {
79
+ position: absolute;
80
+ padding: 4px 6px;
81
+ white-space: nowrap;
82
+ bottom: -30px;
83
+ right: 15px;
84
+ border-radius: 4px;
85
+ background-color: rgba(0, 0, 0, 0.54);
86
+ display: none;
87
+ }
88
+ .xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover #disabledMini + label::before {
89
+ border-color: #ff142b;
90
+ }
91
+ .xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover #disabledMini + label {
92
+ color: #ff142b;
93
+ }
94
+ .xg-mini-layer xg-mini-header .xgplayer-mini-disableBtn:hover xg-tips {
95
+ display: block;
96
+ }
97
+ .xg-mini-layer .mini-cancel-btn {
98
+ cursor: pointer;
99
+ display: block;
100
+ color: #fff;
101
+ width: 40px;
102
+ height: 38px;
103
+ position: absolute;
104
+ right: 0;
105
+ top: 0;
106
+ text-align: center;
107
+ line-height: 38px;
108
+ }
109
+ .xg-mini-layer .play-icon {
110
+ cursor: pointer;
111
+ height: 48px;
112
+ width: 48px;
113
+ position: absolute;
114
+ background: rgba(0, 0, 0, 0.54);
115
+ border-radius: 24px;
116
+ top: 50%;
117
+ left: 50%;
118
+ margin: -24px 0 0 -24px;
119
+ }
120
+ .xg-mini-layer .play-icon svg, .xg-mini-layer .play-icon img {
121
+ width: 50px;
122
+ height: 50px;
123
+ fill: #faf7f7;
124
+ }
125
+ .xg-mini-layer .xg-icon-play {
126
+ display: none;
127
+ }
128
+ .xg-mini-layer .xg-icon-pause {
129
+ display: block;
130
+ }
131
+ .xg-mini-layer[data-state=pause] .xg-icon-play {
132
+ display: block;
133
+ }
134
+ .xg-mini-layer[data-state=pause] .xg-icon-pause {
135
+ display: none;
136
+ }
137
+ .xgplayer-miniicon {
138
+ position: relative;
139
+ outline: none;
140
+ display: block;
141
+ }
142
+ .xgplayer-miniicon .name {
143
+ text-align: center;
144
+ font-size: 13px;
145
+ line-height: 20px;
146
+ height: 20px;
147
+ color: rgba(255, 255, 255, 0.8);
148
+ line-height: 40px;
149
+ }
150
+ .xgplayer-miniicon .name span {
151
+ font-size: 13px;
152
+ width: 60px;
153
+ height: 20px;
154
+ line-height: 20px;
155
+ background: rgba(0, 0, 0, 0.38);
156
+ border-radius: 10px;
157
+ display: inline-block;
158
+ vertical-align: middle;
159
+ }
160
+ .xgplayer-mini {
161
+ position: fixed;
162
+ width: 320px;
163
+ height: 180px;
164
+ z-index: 91;
165
+ box-shadow: 0 4px 7px 2px rgba(0, 0, 0, 0.2);
166
+ }
167
+ .xgplayer-mini:hover {
168
+ cursor: move;
169
+ }
170
+ .xgplayer-mini:hover .xg-mini-layer {
171
+ display: block;
172
+ }
173
+ .xgplayer-mini.xgplayer-ended .xg-mini-layer {
174
+ display: none;
175
+ }
176
+ .xgplayer-mobile .xg-mini-layer .play-icon {
177
+ background: none;
178
+ border-radius: initial;
179
+ }