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,68 @@
1
+ export type IMiniScreenConfig = {
2
+ [propName: string]: any;
3
+ index?: number;
4
+ disable?: boolean;
5
+ width?: number;
6
+ height?: number;
7
+ left?: number;
8
+ top?: number;
9
+ isShowIcon?: boolean;
10
+ isScrollSwitch?: boolean;
11
+ scrollTop?: number;
12
+ disableDrag?: boolean;
13
+ };
14
+ /**
15
+ * @typedef {{
16
+ * index?: number,
17
+ * disable?: boolean,
18
+ * width?: number,
19
+ * height?: number,
20
+ * left?: number, // 默认左下角
21
+ * top?: number, // 默认左下角
22
+ * isShowIcon?: boolean, // 是否显示icon
23
+ * isScrollSwitch?: boolean, // 滚动自动切换自动切换
24
+ * scrollTop?: number, // 触发滚动的高度
25
+ * disableDrag?: boolean, // 禁用拖拽
26
+ * [propName: string]: any
27
+ * }} IMiniScreenConfig
28
+ */
29
+ declare class MiniScreen extends Plugin {
30
+ /**
31
+ * @type IMiniScreenConfig
32
+ */
33
+ static get defaultConfig(): IMiniScreenConfig;
34
+ constructor(args: any);
35
+ isMini: boolean;
36
+ isClose: boolean;
37
+ pos: {
38
+ left: any;
39
+ top: any;
40
+ height: any;
41
+ width: any;
42
+ scrollY: number;
43
+ };
44
+ lastStyle: {};
45
+ beforeCreate(args: any): void;
46
+ _draggabilly: Draggabilly;
47
+ registerIcons(): {
48
+ play: {
49
+ icon: any;
50
+ class: string;
51
+ };
52
+ pause: {
53
+ icon: any;
54
+ class: string;
55
+ };
56
+ };
57
+ initIcons(): void;
58
+ onCancelClick: (e: any) => void;
59
+ onCenterClick: (e: any) => void;
60
+ onScroll: (e: any) => void;
61
+ getMini(): void;
62
+ exitMini(): boolean;
63
+ render(): string;
64
+ }
65
+ import MiniScreenIcon from "./miniScreenIcon";
66
+ import Plugin from "../../plugin";
67
+ import Draggabilly from "../../utils/draggabilly";
68
+ export { MiniScreen as default, MiniScreenIcon };
@@ -0,0 +1,212 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import util from "../../utils/util.js";
3
+ import { PAUSE, PLAY, MINI_STATE_CHANGE } from "../../events.js";
4
+ import "../../utils/debug.js";
5
+ import Plugin from "../../plugin/plugin.js";
6
+ import { xgIconTips } from "../common/iconTools.js";
7
+ import PlaySvg from "../assets/play.js";
8
+ import PauseSvg from "../assets/pause.js";
9
+ import MiniScreenIcon from "./miniScreenIcon.js";
10
+ export { default as MiniScreenIcon } from "./miniScreenIcon.js";
11
+ import Draggabilly from "../../utils/draggabilly.js";
12
+ var MiniScreen = /* @__PURE__ */ function(_Plugin) {
13
+ _inherits(MiniScreen2, _Plugin);
14
+ var _super = _createSuper(MiniScreen2);
15
+ function MiniScreen2(args) {
16
+ var _this;
17
+ _classCallCheck(this, MiniScreen2);
18
+ _this = _super.call(this, args);
19
+ _defineProperty(_assertThisInitialized(_this), "onCancelClick", function(e) {
20
+ _this.exitMini();
21
+ _this.isClose = true;
22
+ });
23
+ _defineProperty(_assertThisInitialized(_this), "onCenterClick", function(e) {
24
+ var _assertThisInitialize = _assertThisInitialized(_this), player = _assertThisInitialize.player;
25
+ player.paused ? player.play() : player.pause();
26
+ });
27
+ _defineProperty(_assertThisInitialized(_this), "onScroll", function(e) {
28
+ if (!window.scrollY && window.scrollY !== 0 || Math.abs(window.scrollY - _this.pos.scrollY) < 50) {
29
+ return;
30
+ }
31
+ var scrollHeight = parseInt(util.getCss(_this.player.root, "height"));
32
+ scrollHeight += _this.config.scrollTop;
33
+ _this.pos.scrollY = window.scrollY;
34
+ if (window.scrollY > scrollHeight + 5) {
35
+ !_this.isMini && !_this.isClose && _this.getMini();
36
+ } else if (window.scrollY <= scrollHeight) {
37
+ _this.isMini && _this.exitMini();
38
+ _this.isClose = false;
39
+ }
40
+ });
41
+ _this.isMini = false;
42
+ _this.isClose = false;
43
+ var _assertThisInitialize2 = _assertThisInitialized(_this), config = _assertThisInitialize2.config;
44
+ _this.pos = {
45
+ left: config.left < 0 ? window.innerWidth - config.width - 20 : config.left,
46
+ top: config.top < 0 ? window.innerHeight - config.height - 20 : config.top,
47
+ height: _this.config.height,
48
+ width: _this.config.width,
49
+ scrollY: window.scrollY || 0
50
+ };
51
+ _this.lastStyle = null;
52
+ return _this;
53
+ }
54
+ _createClass(MiniScreen2, [{
55
+ key: "beforeCreate",
56
+ value: function beforeCreate(args) {
57
+ if (typeof args.player.config.mini === "boolean") {
58
+ args.config.isShowIcon = args.player.config.mini;
59
+ }
60
+ }
61
+ }, {
62
+ key: "afterCreate",
63
+ value: function afterCreate() {
64
+ var _this2 = this;
65
+ this.initIcons();
66
+ this.on(PAUSE, function() {
67
+ _this2.setAttr("data-state", "pause");
68
+ });
69
+ this.on(PLAY, function() {
70
+ _this2.setAttr("data-state", "play");
71
+ });
72
+ }
73
+ }, {
74
+ key: "onPluginsReady",
75
+ value: function onPluginsReady() {
76
+ var _this3 = this;
77
+ var player = this.player, config = this.config;
78
+ if (config.disable) {
79
+ return;
80
+ }
81
+ if (this.config.isShowIcon) {
82
+ var options = {
83
+ config: {
84
+ onClick: function onClick() {
85
+ _this3.getMini();
86
+ }
87
+ }
88
+ };
89
+ player.controls.registerPlugin(MiniScreenIcon, options, MiniScreenIcon.pluginName);
90
+ }
91
+ var eventName = util.checkTouchSupport() ? "touchend" : "click";
92
+ this.bind(".mini-cancel-btn", eventName, this.onCancelClick);
93
+ this.bind(".play-icon", eventName, this.onCenterClick);
94
+ if (!this.config.disableDrag) {
95
+ this._draggabilly = new Draggabilly(this.player.root, {
96
+ handle: this.root
97
+ });
98
+ }
99
+ if (this.config.isScrollSwitch) {
100
+ window.addEventListener("scroll", this.onScroll);
101
+ }
102
+ }
103
+ }, {
104
+ key: "registerIcons",
105
+ value: function registerIcons() {
106
+ return {
107
+ play: {
108
+ icon: PlaySvg,
109
+ class: "xg-icon-play"
110
+ },
111
+ pause: {
112
+ icon: PauseSvg,
113
+ class: "xg-icon-pause"
114
+ }
115
+ };
116
+ }
117
+ }, {
118
+ key: "initIcons",
119
+ value: function initIcons() {
120
+ var icons = this.icons;
121
+ this.appendChild(".play-icon", icons.play);
122
+ this.appendChild(".play-icon", icons.pause);
123
+ }
124
+ }, {
125
+ key: "getMini",
126
+ value: function getMini() {
127
+ var _this4 = this;
128
+ if (this.isMini) {
129
+ return;
130
+ }
131
+ var player = this.player, playerConfig = this.playerConfig;
132
+ var target = this.config.target || this.player.root;
133
+ this.lastStyle = {};
134
+ util.addClass(player.root, "xgplayer-mini");
135
+ ["width", "height", "top", "left"].map(function(key) {
136
+ _this4.lastStyle[key] = target.style[key];
137
+ target.style[key] = "".concat(_this4.pos[key], "px");
138
+ });
139
+ if (playerConfig.fluid) {
140
+ target.style["padding-top"] = "";
141
+ }
142
+ this.emit(MINI_STATE_CHANGE, true);
143
+ player.isMini = this.isMini = true;
144
+ }
145
+ }, {
146
+ key: "exitMini",
147
+ value: function exitMini() {
148
+ var _this5 = this;
149
+ if (!this.isMini) {
150
+ return false;
151
+ }
152
+ var player = this.player, playerConfig = this.playerConfig;
153
+ var target = this.config.target || this.player.root;
154
+ util.removeClass(player.root, "xgplayer-mini");
155
+ if (this.lastStyle) {
156
+ Object.keys(this.lastStyle).map(function(key) {
157
+ target.style[key] = _this5.lastStyle[key];
158
+ });
159
+ }
160
+ this.lastStyle = null;
161
+ if (playerConfig.fluid) {
162
+ player.root.style.width = "100%";
163
+ player.root.style.height = "0";
164
+ player.root.style["padding-top"] = "".concat(playerConfig.height * 100 / playerConfig.width, "%");
165
+ }
166
+ this.emit(MINI_STATE_CHANGE, false);
167
+ this.isMini = player.isMini = false;
168
+ }
169
+ }, {
170
+ key: "destroy",
171
+ value: function destroy() {
172
+ window.removeEventListener("scroll", this.onScroll);
173
+ var eventName = util.checkTouchSupport() ? "touchend" : "click";
174
+ this.unbind(".mini-cancel-btn", eventName, this.onCancelClick);
175
+ this.unbind(".play-icon", eventName, this.onCenterClick);
176
+ this._draggabilly && this._draggabilly.destroy();
177
+ this._draggabilly = null;
178
+ this.exitMini();
179
+ }
180
+ }, {
181
+ key: "render",
182
+ value: function render() {
183
+ if (this.config.disable) {
184
+ return;
185
+ }
186
+ return '\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n '.concat(xgIconTips(this, "MINI_DRAG", this.playerConfig.isHideTips), '\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>');
187
+ }
188
+ }], [{
189
+ key: "pluginName",
190
+ get: function get() {
191
+ return "miniscreen";
192
+ }
193
+ }, {
194
+ key: "defaultConfig",
195
+ get: function get() {
196
+ return {
197
+ index: 10,
198
+ disable: false,
199
+ width: 320,
200
+ height: 180,
201
+ left: -1,
202
+ top: -1,
203
+ isShowIcon: false,
204
+ isScrollSwitch: false,
205
+ scrollTop: 0,
206
+ disableDrag: false
207
+ };
208
+ }
209
+ }]);
210
+ return MiniScreen2;
211
+ }(Plugin);
212
+ export { MiniScreen as default };
@@ -0,0 +1,198 @@
1
+ @import "../../style/variable";
2
+ .xg-mini-layer {
3
+ display: none;
4
+ position: absolute;
5
+ top: 0;
6
+ left: 0;
7
+ width: 100%;
8
+ height: 100%;
9
+ z-index: 11;
10
+ background: linear-gradient(180deg,rgba(57,57,57,.9),rgba(57,57,57,0) 50.27%);
11
+ .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-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
+ // 超过结束时的blur层
32
+ z-index: 22;
33
+ .xgplayer-pip-disableBtn {
34
+ pointer-events: all;
35
+ }
36
+ #disabledMini {
37
+ display: none;
38
+ position: relative;
39
+ }
40
+ #disabledMini + label {
41
+ cursor: pointer;
42
+ position: relative;
43
+ display: flex;
44
+ align-items: center;
45
+ }
46
+ #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
+ #disabledMini:checked {
61
+ + label {
62
+ color: #ff142b;
63
+ }
64
+ + label::before {
65
+ border-color: #ff142b;
66
+ }
67
+ + label:after {
68
+ content: "";
69
+ position: absolute;
70
+ width: 4px;
71
+ height: 8px;
72
+ border-color: #ff142b;
73
+ border-style: solid;
74
+ border-width: 0px 2px 2px 0px;
75
+ transform: rotate(45deg);
76
+ left: 6px;
77
+ top: 5px;
78
+ }
79
+ }
80
+ .xgplayer-mini-disableBtn {
81
+ xg-tips {
82
+ position: absolute;
83
+ padding: 4px 6px;
84
+ white-space: nowrap;
85
+ bottom: -30px;
86
+ right: 15px;
87
+ border-radius: 4px;
88
+ background-color: rgba(0, 0, 0, 0.54);
89
+ display: none;
90
+ }
91
+ }
92
+ .xgplayer-mini-disableBtn:hover {
93
+ #disabledMini {
94
+ + label::before {
95
+ border-color: #ff142b;
96
+ }
97
+ + label {
98
+ color: #ff142b;
99
+ }
100
+ }
101
+ xg-tips {
102
+ display: block;
103
+ }
104
+ }
105
+ }
106
+ .mini-cancel-btn {
107
+ cursor: pointer;
108
+ display: block;
109
+ color: #fff;
110
+ width: 40px;
111
+ height: 38px;
112
+ position: absolute;
113
+ right: 0;
114
+ top: 0;
115
+ text-align: center;
116
+ line-height: 38px;
117
+ }
118
+ .play-icon {
119
+ cursor: pointer;
120
+ height: 48px;
121
+ width: 48px;
122
+ position: absolute;
123
+ background: rgba(0,0,0,.54);
124
+ border-radius: 24px;
125
+ top: 50%;
126
+ left: 50%;
127
+ margin: -24px 0 0 -24px;
128
+ svg, img {
129
+ width: 50px;
130
+ height: 50px;
131
+ fill: #faf7f7;
132
+ }
133
+ }
134
+ .xg-icon-play {
135
+ display: none;
136
+ }
137
+ .xg-icon-pause {
138
+ display: block;
139
+ }
140
+
141
+ &[data-state=pause] {
142
+ .xg-icon-play {
143
+ display: block;
144
+ }
145
+ .xg-icon-pause {
146
+ display: none;
147
+ }
148
+ }
149
+ }
150
+ .xgplayer-miniicon {
151
+ position: relative;
152
+ outline: none;
153
+ display: block;
154
+ .name {
155
+ text-align: center;
156
+ font-size: 13px;
157
+ line-height: 20px;
158
+ height: 20px;
159
+ color: $definitionNameColor;
160
+ line-height: 40px;
161
+ span{
162
+ font-size: 13px;
163
+ width: 60px;
164
+ height: 20px;
165
+ line-height: 20px;
166
+ background: $definitionNameBgColor;
167
+ border-radius: 10px;
168
+ display:inline-block;
169
+ vertical-align:middle;
170
+ }
171
+ }
172
+ }
173
+
174
+ .xgplayer-mini {
175
+ position: fixed;
176
+ width: 320px;
177
+ height: 180px;
178
+ z-index: 91;
179
+ box-shadow: 0 4px 7px 2px rgba(0, 0, 0, .2);
180
+ &:hover {
181
+ cursor: move;
182
+ .xg-mini-layer {
183
+ display: block;
184
+ }
185
+ }
186
+ &.xgplayer-ended {
187
+ .xg-mini-layer {
188
+ display: none;
189
+ }
190
+ }
191
+ }
192
+
193
+ .xgplayer-mobile {
194
+ .xg-mini-layer .play-icon {
195
+ background: none;
196
+ border-radius: initial;
197
+ }
198
+ }
@@ -0,0 +1,11 @@
1
+ export default MiniScreenIcon;
2
+ declare class MiniScreenIcon extends Plugin {
3
+ static get defaultConfig(): {
4
+ position: string;
5
+ index: number;
6
+ };
7
+ getMini(): void;
8
+ exitMini(): void;
9
+ render(): string;
10
+ }
11
+ import Plugin from "../../plugin";
@@ -0,0 +1,56 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import "../../utils/util.js";
3
+ import "../../utils/debug.js";
4
+ import Plugin, { POSITIONS } from "../../plugin/plugin.js";
5
+ var MiniScreenIcon = /* @__PURE__ */ function(_Plugin) {
6
+ _inherits(MiniScreenIcon2, _Plugin);
7
+ var _super = _createSuper(MiniScreenIcon2);
8
+ function MiniScreenIcon2() {
9
+ _classCallCheck(this, MiniScreenIcon2);
10
+ return _super.apply(this, arguments);
11
+ }
12
+ _createClass(MiniScreenIcon2, [{
13
+ key: "afterCreate",
14
+ value: function afterCreate() {
15
+ this.getMini = this.getMini.bind(this);
16
+ this.exitMini = this.exitMini.bind(this);
17
+ this.bind("click", this.getMini);
18
+ }
19
+ }, {
20
+ key: "getMini",
21
+ value: function getMini() {
22
+ this.config.onClick && this.config.onClick();
23
+ }
24
+ }, {
25
+ key: "exitMini",
26
+ value: function exitMini() {
27
+ this.config.onClick && this.config.onClick();
28
+ }
29
+ }, {
30
+ key: "destroy",
31
+ value: function destroy() {
32
+ this.unbind(["click", "touchend"], this.getMini);
33
+ }
34
+ }, {
35
+ key: "render",
36
+ value: function render() {
37
+ var langKey = "MINISCREEN";
38
+ return '\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[langKey], '">').concat(this.i18n[langKey], "</span></div>\n </xg-icon>");
39
+ }
40
+ }], [{
41
+ key: "pluginName",
42
+ get: function get() {
43
+ return "miniscreenIcon";
44
+ }
45
+ }, {
46
+ key: "defaultConfig",
47
+ get: function get() {
48
+ return {
49
+ position: POSITIONS.CONTROLS_RIGHT,
50
+ index: 10
51
+ };
52
+ }
53
+ }]);
54
+ return MiniScreenIcon2;
55
+ }(Plugin);
56
+ export { MiniScreenIcon as default };