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,180 @@
1
+ @import '../common/thumbnail.scss';
2
+ $color: #FF0000;
3
+
4
+ .xgplayer {
5
+ xg-trigger {
6
+ -webkit-user-select:none;
7
+ -moz-user-select:none;
8
+ -ms-user-select:none;
9
+ -khtml-user-select:none;
10
+ user-select:none;
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ height: 100%;
15
+ width: 100%;
16
+ .time-preview {
17
+ display: none;
18
+ pointer-events: none;
19
+ position: absolute;
20
+ width: 200px;
21
+ margin: 0 auto;
22
+ padding: 0 20px 30px;
23
+ top: 50%;
24
+ left: 50%;
25
+ transform: translate(-50%, -50%);
26
+ color: #fff;
27
+ text-shadow: 0 0 1px rgba(0,0,0,0.54);
28
+ font-size: 17px;
29
+ text-align: center;
30
+ pointer-events: none;
31
+ span {
32
+ line-height: 24px;
33
+ &.xg-cur {
34
+ color: #FF0000;
35
+ }
36
+ }
37
+ .xg-seek-show {
38
+ transform: translateX(-10px);
39
+ &.xg-back {
40
+ .xg-seek-pre {
41
+ transform: rotate(180deg) translateX(-5px);
42
+ }
43
+ }
44
+ &.hide-seek-icon {
45
+ .xg-seek-icon {
46
+ display: none;
47
+ }
48
+ }
49
+ }
50
+ .xg-bar {
51
+ width: 96px;
52
+ height: 2px;
53
+ margin: 0 auto;
54
+ margin-top: 8px;
55
+ border-radius: 10px;
56
+ box-sizing: content-box;
57
+ background: rgba(255,255,255,0.3);
58
+ .xg-curbar {
59
+ width: 0;
60
+ height: 100%;
61
+ background-color: #FF0000;
62
+ }
63
+ &.hide {
64
+ display: none;
65
+ }
66
+ }
67
+ }
68
+
69
+ .mobile-thumbnail {
70
+ position: relative;
71
+ left: 50%;
72
+ transform: translateX(-50%);
73
+ }
74
+
75
+ .xg-top-note {
76
+ position: absolute;
77
+ height: 32px;
78
+ width: 135px;
79
+ top: 26px;
80
+ left: 50%;
81
+ margin-left: -78px;
82
+ background: rgba(0, 0, 0, 0.3);
83
+ border-radius: 100px;
84
+ color: #fff;
85
+ span {
86
+ display: block;
87
+ font-size: 13px;
88
+ line-height: 32px;
89
+ height: 32px;
90
+ font-size: 13px;
91
+ text-align: center;
92
+ }
93
+ i {
94
+ color: $color;
95
+ margin: 0 5px
96
+ }
97
+ }
98
+ .xg-playbackrate {
99
+ display: none;
100
+ }
101
+ &[data-xg-action=seeking] {
102
+ .time-preview {
103
+ display: block;
104
+ }
105
+ }
106
+ &[data-xg-action=playbackrate] {
107
+ .xg-playbackrate {
108
+ display: block;
109
+ }
110
+ }
111
+ }
112
+ .gradient {
113
+ display: none;
114
+ position: absolute;
115
+ top: 0;
116
+ left: 0;
117
+ height: 100%;
118
+ width: 100%;
119
+ pointer-events: none;
120
+ background-image: linear-gradient(rgba(0,0,0,.6),rgba(0,0,0,.36) 20%,rgba(0,0,0,0) 36%,rgba(0,0,0,0) 70%,rgba(0,0,0,0.24) 77%,rgba(0,0,0,0.36) 83%,rgba(0,0,0,.6));
121
+
122
+ &.top {
123
+ background-image: linear-gradient(rgba(0,0,0,.6),rgba(0,0,0,.36) 20%,rgba(0,0,0,0) 36%,rgba(0,0,0,0) 70%);
124
+ }
125
+
126
+ &.bottom {
127
+ background-image: linear-gradient(rgba(0,0,0,0) 70%,rgba(0,0,0,0.24) 77%,rgba(0,0,0,0.36) 83%,rgba(0,0,0,.6));
128
+ }
129
+
130
+ &.none {
131
+ background-image: initial;
132
+ }
133
+ }
134
+ }
135
+ .xgplayer-mobile {
136
+ .xgplayer-controls {
137
+ background-image: initial;
138
+ }
139
+
140
+ &.xgplayer-playing {
141
+ .gradient {
142
+ display: block;
143
+ }
144
+ }
145
+
146
+ &.xgplayer-inactive {
147
+ .gradient {
148
+ background-image: initial;
149
+ }
150
+ }
151
+
152
+ .xgmask {
153
+ position: absolute;
154
+ height: 100%;
155
+ z-index: 10;
156
+ top: 0;
157
+ left: 0;
158
+ width: 100%;
159
+ pointer-events: none;
160
+ background-color: rgba(0,0,0,0);
161
+ }
162
+ /**/
163
+ }
164
+
165
+ @media (prefers-color-scheme: dark) {
166
+ .xgplayer-mobile {
167
+ xg-trigger .time-preview {
168
+ color: #fff;
169
+ span.xg-cur {
170
+ color: #FF0000;
171
+ }
172
+ .xg-bar {
173
+ background-color: rgba(255, 255, 255, 0.3);
174
+ &.xg-curbar {
175
+ background-color: #FF0000;
176
+ }
177
+ }
178
+ }
179
+ }
180
+ }
@@ -0,0 +1,43 @@
1
+ export default Touche;
2
+ declare class Touche {
3
+ constructor(dom: any, config?: {
4
+ eventType: string;
5
+ });
6
+ _pos: {
7
+ moving: boolean;
8
+ start: boolean;
9
+ x: number;
10
+ y: number;
11
+ };
12
+ config: {
13
+ pressDelay: number;
14
+ dbClickDelay: number;
15
+ disablePress: boolean;
16
+ disableDbClick: boolean;
17
+ miniStep: number;
18
+ needPreventDefault: boolean;
19
+ };
20
+ root: any;
21
+ events: {
22
+ start: string;
23
+ end: string;
24
+ move: string;
25
+ cancel: string;
26
+ };
27
+ pressIntrvalId: NodeJS.Timeout;
28
+ dbIntrvalId: NodeJS.Timeout;
29
+ __handlers: {};
30
+ _initEvent(): void;
31
+ __setPress(e: any): void;
32
+ __clearPress(): void;
33
+ __setDb(e: any): void;
34
+ __clearDb(): void;
35
+ on(event: any, handler: any): void;
36
+ off(event: any, handler: any): void;
37
+ trigger(event: any, e: any): void;
38
+ onTouchStart: (e: any) => void;
39
+ onTouchCancel: (e: any) => void;
40
+ onTouchEnd: (e: any) => void;
41
+ onTouchMove: (e: any) => void;
42
+ destroy(): void;
43
+ }
@@ -0,0 +1,214 @@
1
+ import { createClass as _createClass, classCallCheck as _classCallCheck, defineProperty as _defineProperty } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ var EVENTS = {
3
+ PRESS: "press",
4
+ PRESS_END: "pressend",
5
+ DOUBlE_CLICK: "doubleclick",
6
+ CLICK: "click",
7
+ TOUCH_MOVE: "touchmove",
8
+ TOUCH_START: "touchstart",
9
+ TOUCH_END: "touchend"
10
+ };
11
+ var TOUCHS = {
12
+ start: "touchstart",
13
+ end: "touchend",
14
+ move: "touchmove",
15
+ cancel: "touchcancel"
16
+ };
17
+ var MOUSES = {
18
+ start: "mousedown",
19
+ end: "mouseup",
20
+ move: "mousemove",
21
+ cancel: "mouseleave"
22
+ };
23
+ function getTouch(touches) {
24
+ if (touches && touches.length > 0) {
25
+ return touches[touches.length - 1];
26
+ } else {
27
+ return null;
28
+ }
29
+ }
30
+ function getDefaultConfig() {
31
+ return {
32
+ pressDelay: 600,
33
+ dbClickDelay: 200,
34
+ disablePress: false,
35
+ disableDbClick: false,
36
+ miniStep: 2,
37
+ needPreventDefault: true
38
+ };
39
+ }
40
+ var Touche = /* @__PURE__ */ function() {
41
+ function Touche2(dom) {
42
+ var _this = this;
43
+ var _config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
44
+ eventType: "touch"
45
+ };
46
+ _classCallCheck(this, Touche2);
47
+ _defineProperty(this, "onTouchStart", function(e) {
48
+ var _pos = _this._pos, root = _this.root;
49
+ var touch = getTouch(e.touches);
50
+ _pos.x = touch ? parseInt(touch.pageX, 10) : e.pageX;
51
+ _pos.y = touch ? parseInt(touch.pageX, 10) : e.pageX;
52
+ _pos.start = true;
53
+ _this.__setPress(e);
54
+ root.addEventListener(_this.events.end, _this.onTouchEnd);
55
+ root.addEventListener(_this.events.cancel, _this.onTouchCancel);
56
+ root.addEventListener(_this.events.move, _this.onTouchMove);
57
+ _this.trigger(EVENTS.TOUCH_START, e);
58
+ });
59
+ _defineProperty(this, "onTouchCancel", function(e) {
60
+ _this.onTouchEnd(e);
61
+ });
62
+ _defineProperty(this, "onTouchEnd", function(e) {
63
+ var _pos = _this._pos, root = _this.root;
64
+ _this.__clearPress();
65
+ root.removeEventListener(_this.events.cancel, _this.onTouchCancel);
66
+ root.removeEventListener(_this.events.end, _this.onTouchEnd);
67
+ root.removeEventListener(_this.events.move, _this.onTouchMove);
68
+ e.moving = _pos.moving;
69
+ e.press = _pos.press;
70
+ _pos.press && _this.trigger(EVENTS.PRESS_END, e);
71
+ _this.trigger(EVENTS.TOUCH_END, e);
72
+ !_pos.press && !_pos.moving && _this.__setDb(e);
73
+ _pos.press = false;
74
+ _pos.start = false;
75
+ _pos.moving = false;
76
+ });
77
+ _defineProperty(this, "onTouchMove", function(e) {
78
+ var _pos = _this._pos, config = _this.config;
79
+ var touch = getTouch(e.touches);
80
+ var x = touch ? parseInt(touch.pageX, 10) : e.pageX;
81
+ var y = touch ? parseInt(touch.pageY, 10) : e.pageX;
82
+ var diffx = x - _pos.x;
83
+ var diffy = y - _pos.y;
84
+ if (Math.abs(diffy) < config.miniStep && Math.abs(diffx) < config.miniStep) {
85
+ return;
86
+ }
87
+ _this.__clearPress();
88
+ _pos.press && _this.trigger(EVENTS.PRESS_END, e);
89
+ _pos.press = false;
90
+ _pos.moving = true;
91
+ _this.trigger(EVENTS.TOUCH_MOVE, e);
92
+ });
93
+ this._pos = {
94
+ moving: false,
95
+ start: false,
96
+ x: 0,
97
+ y: 0
98
+ };
99
+ this.config = getDefaultConfig();
100
+ Object.keys(_config).map(function(key) {
101
+ _this.config[key] = _config[key];
102
+ });
103
+ this.root = dom;
104
+ this.events = _config.eventType === "mouse" ? MOUSES : TOUCHS;
105
+ this.pressIntrvalId = null;
106
+ this.dbIntrvalId = null;
107
+ this.__handlers = {};
108
+ this._initEvent();
109
+ }
110
+ _createClass(Touche2, [{
111
+ key: "_initEvent",
112
+ value: function _initEvent() {
113
+ this.root.addEventListener(this.events.start, this.onTouchStart);
114
+ }
115
+ }, {
116
+ key: "__setPress",
117
+ value: function __setPress(e) {
118
+ var _this2 = this;
119
+ var config = this.config;
120
+ if (this.pressIntrvalId) {
121
+ this.__clearPress();
122
+ }
123
+ this.pressIntrvalId = setTimeout(function() {
124
+ _this2.trigger(EVENTS.PRESS, e);
125
+ _this2._pos.press = true;
126
+ _this2.__clearPress();
127
+ }, config.pressDelay);
128
+ }
129
+ }, {
130
+ key: "__clearPress",
131
+ value: function __clearPress() {
132
+ window.clearTimeout(this.pressIntrvalId);
133
+ this.pressIntrvalId = null;
134
+ }
135
+ }, {
136
+ key: "__setDb",
137
+ value: function __setDb(e) {
138
+ var _this3 = this;
139
+ var config = this.config;
140
+ if (this.dbIntrvalId) {
141
+ this.__clearDb();
142
+ this.trigger(EVENTS.DOUBlE_CLICK, e);
143
+ return;
144
+ }
145
+ this.dbIntrvalId = setTimeout(function() {
146
+ _this3.__clearDb();
147
+ if (!_this3._pos.start && !_this3._pos.press && !_this3._pos.moving) {
148
+ _this3.trigger(EVENTS.CLICK, e);
149
+ }
150
+ }, config.dbClickDelay);
151
+ }
152
+ }, {
153
+ key: "__clearDb",
154
+ value: function __clearDb() {
155
+ clearTimeout(this.dbIntrvalId);
156
+ this.dbIntrvalId = null;
157
+ }
158
+ }, {
159
+ key: "on",
160
+ value: function on(event, handler) {
161
+ if (!this.__handlers[event]) {
162
+ this.__handlers[event] = [];
163
+ }
164
+ this.__handlers[event].push(handler);
165
+ }
166
+ }, {
167
+ key: "off",
168
+ value: function off(event, handler) {
169
+ if (!this.__handlers[event]) {
170
+ return;
171
+ }
172
+ var handlers = this.__handlers[event];
173
+ var index = -1;
174
+ for (var i = 0; i < handlers.length; i++) {
175
+ if (handlers[i] === handler) {
176
+ index = i;
177
+ break;
178
+ }
179
+ }
180
+ if (index >= 0) {
181
+ this.__handlers[event].splice(index, 1);
182
+ }
183
+ }
184
+ }, {
185
+ key: "trigger",
186
+ value: function trigger(event, e) {
187
+ if (!this.__handlers[event]) {
188
+ return;
189
+ }
190
+ this.__handlers[event].map(function(handler) {
191
+ try {
192
+ handler(e);
193
+ } catch (error) {
194
+ console.error("trigger>>:".concat(event), error);
195
+ }
196
+ });
197
+ }
198
+ }, {
199
+ key: "destroy",
200
+ value: function destroy() {
201
+ var _this4 = this;
202
+ var map = {
203
+ touchend: "onTouchEnd",
204
+ touchmove: "onTouchMove",
205
+ touchstart: "onTouchStart"
206
+ };
207
+ Object.keys(map).forEach(function(key) {
208
+ _this4.root.removeEventListener(key, _this4[map[key]]);
209
+ });
210
+ }
211
+ }]);
212
+ return Touche2;
213
+ }();
214
+ export { Touche as default };
@@ -0,0 +1,5 @@
1
+ export default class NetAdaption extends BasePlugin {
2
+ _timer: NodeJS.Timer;
3
+ _checkStatus(): void;
4
+ }
5
+ import BasePlugin from "../../plugin/basePlugin";
@@ -0,0 +1,3 @@
1
+ .xgplayer.xgplayer-inactive {
2
+ cursor: none;
3
+ }
@@ -0,0 +1,14 @@
1
+ export default class PCPlugin extends BasePlugin {
2
+ static get defaultConfig(): {};
3
+ _clickCount: number;
4
+ initEvents(): void;
5
+ switchPlayPause(e: any): void;
6
+ onMouseMove: (e: any) => void;
7
+ onMouseEnter: (e: any) => void;
8
+ onMouseLeave: (e: any) => void;
9
+ onContextmenu(e: any): void;
10
+ onVideoClick: (e: any) => void;
11
+ clickTimer: any;
12
+ onVideoDblClick: (e: any) => void;
13
+ }
14
+ import { BasePlugin } from "../../plugin";
@@ -0,0 +1,199 @@
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 "../../utils/util.js";
3
+ import sniffer from "../../utils/sniffer.js";
4
+ import BasePlugin from "../../plugin/basePlugin.js";
5
+ import "delegate";
6
+ import { runHooks } from "../../plugin/hooksDescriptor.js";
7
+ var MOUSE_EVENTS = {
8
+ mouseenter: "onMouseEnter",
9
+ mouseleave: "onMouseLeave",
10
+ mousemove: "onMouseMove"
11
+ };
12
+ var HOOKS = ["videoClick", "videoDbClick"];
13
+ var PCPlugin = /* @__PURE__ */ function(_BasePlugin) {
14
+ _inherits(PCPlugin2, _BasePlugin);
15
+ var _super = _createSuper(PCPlugin2);
16
+ function PCPlugin2() {
17
+ var _this;
18
+ _classCallCheck(this, PCPlugin2);
19
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
+ args[_key] = arguments[_key];
21
+ }
22
+ _this = _super.call.apply(_super, [this].concat(args));
23
+ _defineProperty(_assertThisInitialized(_this), "onMouseMove", function(e) {
24
+ var _assertThisInitialize = _assertThisInitialized(_this), player = _assertThisInitialize.player, playerConfig = _assertThisInitialize.playerConfig;
25
+ if (!player.isActive) {
26
+ player.focus({
27
+ autoHide: !playerConfig.closeDelayBlur
28
+ });
29
+ !playerConfig.closeFocusVideoFocus && player.media.focus();
30
+ }
31
+ });
32
+ _defineProperty(_assertThisInitialized(_this), "onMouseEnter", function(e) {
33
+ var _assertThisInitialize2 = _assertThisInitialized(_this), playerConfig = _assertThisInitialize2.playerConfig, player = _assertThisInitialize2.player;
34
+ !playerConfig.closeFocusVideoFocus && player.media.focus();
35
+ if (playerConfig.closeDelayBlur) {
36
+ player.focus({
37
+ autoHide: false
38
+ });
39
+ } else {
40
+ player.focus();
41
+ }
42
+ });
43
+ _defineProperty(_assertThisInitialized(_this), "onMouseLeave", function(e) {
44
+ var _this$playerConfig = _this.playerConfig, closePlayerBlur = _this$playerConfig.closePlayerBlur, leavePlayerTime = _this$playerConfig.leavePlayerTime, closeDelayBlur = _this$playerConfig.closeDelayBlur;
45
+ if (!closePlayerBlur && !closeDelayBlur) {
46
+ if (leavePlayerTime) {
47
+ _this.player.focus({
48
+ autoHide: true,
49
+ delay: leavePlayerTime
50
+ });
51
+ } else {
52
+ _this.player.blur();
53
+ }
54
+ }
55
+ });
56
+ _defineProperty(_assertThisInitialized(_this), "onVideoClick", function(e) {
57
+ var _assertThisInitialize3 = _assertThisInitialized(_this), player = _assertThisInitialize3.player, playerConfig = _assertThisInitialize3.playerConfig;
58
+ if (e.target && playerConfig.closeVideoClick) {
59
+ return;
60
+ }
61
+ if (e.target === player.root || e.target === player.media || e.target === player.innerContainer || e.target === player.media.__canvas) {
62
+ e.preventDefault();
63
+ if (!playerConfig.closeVideoStopPropagation) {
64
+ e.stopPropagation();
65
+ }
66
+ _this._clickCount++;
67
+ if (_this.clickTimer) {
68
+ clearTimeout(_this.clickTimer);
69
+ _this.clickTimer = null;
70
+ }
71
+ _this.clickTimer = setTimeout(function() {
72
+ if (!_this._clickCount) {
73
+ return;
74
+ }
75
+ _this._clickCount--;
76
+ runHooks(_assertThisInitialized(_this), HOOKS[0], function(plugin, data) {
77
+ _this.switchPlayPause(data.e);
78
+ }, {
79
+ e,
80
+ paused: player.paused
81
+ });
82
+ clearTimeout(_this.clickTimer);
83
+ _this.clickTimer = null;
84
+ }, 300);
85
+ }
86
+ });
87
+ _defineProperty(_assertThisInitialized(_this), "onVideoDblClick", function(e) {
88
+ var _assertThisInitialize4 = _assertThisInitialized(_this), player = _assertThisInitialize4.player, playerConfig = _assertThisInitialize4.playerConfig;
89
+ if (playerConfig.closeVideoDblclick || !e.target || e.target !== player.media && e.target !== player.media.__canvas) {
90
+ return;
91
+ }
92
+ if (!playerConfig.closeVideoClick && _this._clickCount < 2) {
93
+ _this._clickCount = 0;
94
+ return;
95
+ }
96
+ _this._clickCount = 0;
97
+ if (_this.clickTimer) {
98
+ clearTimeout(_this.clickTimer);
99
+ _this.clickTimer = null;
100
+ }
101
+ e.preventDefault();
102
+ e.stopPropagation();
103
+ runHooks(_assertThisInitialized(_this), HOOKS[1], function(plugin, data) {
104
+ _this.emitUserAction(data.e, "switch_fullscreen", {
105
+ props: "fullscreen",
106
+ from: player.fullscreen,
107
+ to: !player.fullscreen
108
+ });
109
+ player.fullscreen ? player.exitFullscreen() : player.getFullscreen();
110
+ }, {
111
+ e,
112
+ fullscreen: player.fullscreen
113
+ });
114
+ });
115
+ return _this;
116
+ }
117
+ _createClass(PCPlugin2, [{
118
+ key: "afterCreate",
119
+ value: function afterCreate() {
120
+ var _this2 = this;
121
+ this._clickCount = 0;
122
+ HOOKS.map(function(item) {
123
+ _this2.__hooks[item] = null;
124
+ });
125
+ var isMobileSimulateMode = this.playerConfig.isMobileSimulateMode;
126
+ if (isMobileSimulateMode === "mobile" || sniffer.device === "mobile" && !sniffer.os.isIpad) {
127
+ return;
128
+ }
129
+ this.initEvents();
130
+ }
131
+ }, {
132
+ key: "initEvents",
133
+ value: function initEvents() {
134
+ var _this3 = this;
135
+ var _this$player = this.player, video = _this$player.video, root = _this$player.root;
136
+ var enableContextmenu = this.playerConfig.enableContextmenu;
137
+ root && root.addEventListener("click", this.onVideoClick, false);
138
+ root && root.addEventListener("dblclick", this.onVideoDblClick, false);
139
+ Object.keys(MOUSE_EVENTS).map(function(item) {
140
+ root.addEventListener(item, _this3[MOUSE_EVENTS[item]], false);
141
+ });
142
+ enableContextmenu && video && video.addEventListener("contextmenu", this.onContextmenu, false);
143
+ }
144
+ }, {
145
+ key: "switchPlayPause",
146
+ value: function switchPlayPause(e) {
147
+ var player = this.player;
148
+ this.emitUserAction(e, "switch_play_pause", {
149
+ props: "paused",
150
+ from: player.paused,
151
+ to: !player.paused
152
+ });
153
+ if (!player.ended) {
154
+ player.paused ? player.play() : player.pause();
155
+ } else {
156
+ player.duration !== Infinity && player.duration > 0 && player.replay();
157
+ }
158
+ }
159
+ }, {
160
+ key: "onContextmenu",
161
+ value: function onContextmenu(e) {
162
+ e = e || window.event;
163
+ if (e.preventDefault) {
164
+ e.preventDefault();
165
+ }
166
+ if (e.stopPropagation) {
167
+ e.stopPropagation();
168
+ } else {
169
+ e.returnValue = false;
170
+ e.cancelBubble = true;
171
+ }
172
+ }
173
+ }, {
174
+ key: "destroy",
175
+ value: function destroy() {
176
+ var _this4 = this;
177
+ var _this$player2 = this.player, video = _this$player2.video, root = _this$player2.root;
178
+ this.clickTimer && clearTimeout(this.clickTimer);
179
+ root.removeEventListener("click", this.onVideoClick, false);
180
+ root.removeEventListener("dblclick", this.onVideoDblClick, false);
181
+ video.removeEventListener("contextmenu", this.onContextmenu, false);
182
+ Object.keys(MOUSE_EVENTS).map(function(item) {
183
+ root.removeEventListener(item, _this4[MOUSE_EVENTS[item]], false);
184
+ });
185
+ }
186
+ }], [{
187
+ key: "pluginName",
188
+ get: function get() {
189
+ return "pc";
190
+ }
191
+ }, {
192
+ key: "defaultConfig",
193
+ get: function get() {
194
+ return {};
195
+ }
196
+ }]);
197
+ return PCPlugin2;
198
+ }(BasePlugin);
199
+ export { PCPlugin as default };
@@ -0,0 +1,5 @@
1
+ .xgplayer {
2
+ &.xgplayer-inactive{
3
+ cursor: none;
4
+ }
5
+ }
@@ -0,0 +1,12 @@
1
+ .xgplayer .xgplayer-pip .xg-exit-pip {
2
+ display: none;
3
+ }
4
+ .xgplayer .xgplayer-pip .xg-get-pip {
5
+ display: block;
6
+ }
7
+ .xgplayer .xgplayer-pip[data-state=pip] .xg-exit-pip {
8
+ display: block;
9
+ }
10
+ .xgplayer .xgplayer-pip[data-state=pip] .xg-get-pip {
11
+ display: none;
12
+ }