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,47 @@
1
+ .xgplayer .xgplayer-prompt {
2
+ display: block;
3
+ pointer-events: none;
4
+ position: absolute;
5
+ z-index: 1;
6
+ padding: 6px 12px 5px;
7
+ opacity: 0;
8
+ left: 10px;
9
+ background: rgba(0, 0, 0, 0.5);
10
+ border-radius: 50px;
11
+ font-size: 12px;
12
+ line-height: 17px;
13
+ text-align: center;
14
+ color: #FFF;
15
+ }
16
+ .xgplayer .xgplayer-prompt.show {
17
+ display: block;
18
+ opacity: 1;
19
+ z-index: 10;
20
+ pointer-events: initial;
21
+ }
22
+ .xgplayer .xgplayer-prompt.arrow {
23
+ transform: translateX(-50%);
24
+ }
25
+ .xgplayer .xgplayer-prompt.arrow:after {
26
+ content: "";
27
+ display: block;
28
+ position: absolute;
29
+ left: 50%;
30
+ bottom: 0;
31
+ width: 0;
32
+ height: 0;
33
+ border-left: 6px solid transparent;
34
+ border-right: 6px solid transparent;
35
+ border-top: 8px solid rgba(0, 0, 0, 0.5);
36
+ transform: translate(-50%, 100%);
37
+ }
38
+ .xgplayer .xgplayer-prompt .highlight {
39
+ display: inline-block;
40
+ margin-left: 6px;
41
+ color: #FF0000;
42
+ cursor: pointer;
43
+ }
44
+ .xgplayer.xgplayer-is-error .xgplayer-prompt.show {
45
+ display: none;
46
+ opacity: 1;
47
+ }
@@ -0,0 +1,24 @@
1
+ export default Prompt;
2
+ /**
3
+ * 消息组件
4
+ */
5
+ declare class Prompt extends Plugin {
6
+ static get defaultConfig(): {
7
+ interval: number;
8
+ style: {};
9
+ mode: string;
10
+ autoHide: boolean;
11
+ detail: {
12
+ text: string;
13
+ highlight: string;
14
+ };
15
+ onClick: () => void;
16
+ };
17
+ intervalId: number | NodeJS.Timeout;
18
+ customConfig: any;
19
+ setStyle(style: any): void;
20
+ show(detail: any, config?: {}, onClick?: () => void): void;
21
+ customOnClick: () => void;
22
+ render(): string;
23
+ }
24
+ import Plugin from "../../plugin";
@@ -0,0 +1,110 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import util from "../../utils/util.js";
3
+ import "../../utils/debug.js";
4
+ import Plugin from "../../plugin/plugin.js";
5
+ import STATE_CLASS from "../../stateClassMap.js";
6
+ var Prompt = /* @__PURE__ */ function(_Plugin) {
7
+ _inherits(Prompt2, _Plugin);
8
+ var _super = _createSuper(Prompt2);
9
+ function Prompt2() {
10
+ _classCallCheck(this, Prompt2);
11
+ return _super.apply(this, arguments);
12
+ }
13
+ _createClass(Prompt2, [{
14
+ key: "afterCreate",
15
+ value: function afterCreate() {
16
+ var _this = this;
17
+ this.intervalId = 0;
18
+ this.customConfig = null;
19
+ this.bind(".highlight", ["click", "touchend"], function(e) {
20
+ if (_this.config.onClick || _this.customOnClick) {
21
+ e.preventDefault();
22
+ e.stopPropagation();
23
+ _this.customOnClick ? _this.customOnClick(e) : _this.config.onClick(e);
24
+ }
25
+ });
26
+ this.player.showPrompt = function() {
27
+ _this.show.apply(_this, arguments);
28
+ };
29
+ this.player.hidePrompt = function() {
30
+ _this.hide();
31
+ };
32
+ }
33
+ }, {
34
+ key: "setStyle",
35
+ value: function setStyle(style) {
36
+ var _this2 = this;
37
+ Object.keys(style).map(function(key) {
38
+ _this2.root.style[key] = style[key];
39
+ });
40
+ }
41
+ }, {
42
+ key: "show",
43
+ value: function show(detail) {
44
+ var _this3 = this;
45
+ var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
46
+ var onClick = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
47
+ };
48
+ if (!detail) {
49
+ return;
50
+ }
51
+ this.customOnClick = onClick;
52
+ var interval = this.config.interval;
53
+ if (this.intervalId) {
54
+ clearTimeout(this.intervalId);
55
+ this.intervalId = null;
56
+ }
57
+ util.addClass(this.root, "show");
58
+ config.mode === "arrow" && util.addClass(this.root, "arrow");
59
+ if (typeof detail === "string") {
60
+ this.find(".xgplayer-prompt-detail").innerHTML = detail;
61
+ } else {
62
+ this.find(".xgplayer-prompt-detail").innerHTML = "".concat(detail.text || "") + "".concat(detail.highlight ? '<i class="highlight">'.concat(detail.highlight, "</i>") : "");
63
+ }
64
+ config.style && this.setStyle(config.style);
65
+ var autoHide = typeof config.autoHide === "boolean" ? config.autoHide : this.config.autoHide;
66
+ if (autoHide) {
67
+ var hideinterval = config.interval || interval;
68
+ this.intervalId = setTimeout(function() {
69
+ _this3.hide();
70
+ }, hideinterval);
71
+ }
72
+ }
73
+ }, {
74
+ key: "hide",
75
+ value: function hide() {
76
+ util.removeClass(this.root, "show");
77
+ util.removeClass(this.root, "arrow");
78
+ this.root.removeAttribute("style");
79
+ this.customOnClick = null;
80
+ }
81
+ }, {
82
+ key: "render",
83
+ value: function render() {
84
+ return '<xg-prompt class="xgplayer-prompt '.concat(STATE_CLASS.CONTROLS_FOLLOW, '">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>');
85
+ }
86
+ }], [{
87
+ key: "pluginName",
88
+ get: function get() {
89
+ return "prompt";
90
+ }
91
+ }, {
92
+ key: "defaultConfig",
93
+ get: function get() {
94
+ return {
95
+ interval: 3e3,
96
+ style: {},
97
+ mode: "arrow",
98
+ autoHide: true,
99
+ detail: {
100
+ text: "",
101
+ highlight: ""
102
+ },
103
+ onClick: function onClick() {
104
+ }
105
+ };
106
+ }
107
+ }]);
108
+ return Prompt2;
109
+ }(Plugin);
110
+ export { Prompt as default };
@@ -0,0 +1,53 @@
1
+ .xgplayer {
2
+ .xgplayer-prompt {
3
+ display: block;
4
+ pointer-events: none;
5
+ position: absolute;
6
+ z-index: 1;
7
+ padding: 6px 12px 5px;
8
+ opacity: 0;
9
+ left: 10px;
10
+ background: rgba(0, 0, 0, 0.5);
11
+ border-radius: 50px;
12
+ font-size: 12px;
13
+ line-height: 17px;
14
+ text-align: center;
15
+ color: #FFF;
16
+ &.show {
17
+ display: block;
18
+ opacity: 1;
19
+ z-index: 10;
20
+ pointer-events: initial;
21
+ }
22
+ &.arrow {
23
+ transform: translateX(-50%);
24
+ &:after {
25
+ content: '';
26
+ display: block;
27
+ position: absolute;
28
+ left: 50%;
29
+ bottom: 0;
30
+ width: 0;
31
+ height: 0;
32
+ border-left: 6px solid transparent;
33
+ border-right: 6px solid transparent;
34
+ border-top: 8px solid rgba(0, 0, 0, 0.5);
35
+ transform: translate(-50%, 100%);
36
+ }
37
+ }
38
+ .highlight {
39
+ display: inline-block;
40
+ margin-left: 6px;
41
+ color: #FF0000;
42
+ cursor: pointer;
43
+ }
44
+ }
45
+
46
+ // &.xgplayer-ended,
47
+ &.xgplayer-is-error {
48
+ .xgplayer-prompt.show {
49
+ display: none;
50
+ opacity: 1;
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,33 @@
1
+ .xgplayer-replay {
2
+ display: none;
3
+ }
4
+
5
+ .xgplayer .xgplayer-replay {
6
+ display: none;
7
+ position: absolute;
8
+ left: 50%;
9
+ top: 50%;
10
+ width: 100px;
11
+ height: 100px;
12
+ justify-content: center;
13
+ align-items: center;
14
+ flex-direction: column;
15
+ z-index: 5;
16
+ transform: translate(-50%, -50%);
17
+ cursor: pointer;
18
+ }
19
+ .xgplayer .xgplayer-replay .xgplayer-replay-txt {
20
+ display: inline-block;
21
+ font-size: 14px;
22
+ color: #fff;
23
+ line-height: 34px;
24
+ text-align: center;
25
+ }
26
+ .xgplayer.xgplayer-mobile .xgplayer-replay-svg {
27
+ width: 50px;
28
+ height: 50px;
29
+ }
30
+ .xgplayer.xgplayer-mobile .xgplayer-replay-txt {
31
+ line-height: 24px;
32
+ font-size: 12px;
33
+ }
@@ -0,0 +1,16 @@
1
+ export default Replay;
2
+ declare class Replay extends Plugin {
3
+ static get defaultConfig(): {
4
+ disable: boolean;
5
+ };
6
+ registerIcons(): {
7
+ replay: any;
8
+ };
9
+ __handleReplay: any;
10
+ handleReplay(e: any): void;
11
+ show(): void;
12
+ enable(): void;
13
+ disable(): void;
14
+ render(): string;
15
+ }
16
+ import Plugin from "../../plugin";
@@ -0,0 +1,109 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import util from "../../utils/util.js";
3
+ import { ENDED, PLAY } from "../../events.js";
4
+ import "../../utils/debug.js";
5
+ import Plugin from "../../plugin/plugin.js";
6
+ import ReplaySvg from "../assets/replay.js";
7
+ var Replay = /* @__PURE__ */ function(_Plugin) {
8
+ _inherits(Replay2, _Plugin);
9
+ var _super = _createSuper(Replay2);
10
+ function Replay2() {
11
+ _classCallCheck(this, Replay2);
12
+ return _super.apply(this, arguments);
13
+ }
14
+ _createClass(Replay2, [{
15
+ key: "registerIcons",
16
+ value: function registerIcons() {
17
+ return {
18
+ replay: ReplaySvg
19
+ };
20
+ }
21
+ }, {
22
+ key: "afterCreate",
23
+ value: function afterCreate() {
24
+ var _this = this;
25
+ Plugin.insert(this.icons.replay, this.root, 0);
26
+ this.__handleReplay = this.hook("replayClick", function() {
27
+ _this.player.replay();
28
+ }, {
29
+ pre: function pre(e) {
30
+ e.preventDefault();
31
+ e.stopPropagation();
32
+ }
33
+ });
34
+ this.bind(".xgplayer-replay", ["click", "touchend"], this.__handleReplay);
35
+ this.on(ENDED, function() {
36
+ if (!_this.playerConfig.loop) {
37
+ util.addClass(_this.player.root, "replay");
38
+ }
39
+ if (_this.config.disable) {
40
+ return;
41
+ }
42
+ _this.show();
43
+ var path = _this.root.querySelector("path");
44
+ if (path) {
45
+ var transform = window.getComputedStyle(path).getPropertyValue("transform");
46
+ if (typeof transform === "string" && transform.indexOf("none") > -1) {
47
+ return null;
48
+ } else {
49
+ path.setAttribute("transform", transform);
50
+ }
51
+ }
52
+ });
53
+ this.on(PLAY, function() {
54
+ _this.hide();
55
+ });
56
+ }
57
+ }, {
58
+ key: "handleReplay",
59
+ value: function handleReplay(e) {
60
+ e.preventDefault();
61
+ e.stopPropagation();
62
+ this.player.replay();
63
+ util.removeClass(this.player.root, "replay");
64
+ }
65
+ }, {
66
+ key: "show",
67
+ value: function show() {
68
+ if (this.config.disable) {
69
+ return;
70
+ }
71
+ this.root.style.display = "flex";
72
+ }
73
+ }, {
74
+ key: "enable",
75
+ value: function enable() {
76
+ this.config.disable = false;
77
+ }
78
+ }, {
79
+ key: "disable",
80
+ value: function disable() {
81
+ this.config.disable = true;
82
+ this.hide();
83
+ }
84
+ }, {
85
+ key: "destroy",
86
+ value: function destroy() {
87
+ this.unbind(".xgplayer-replay", ["click", "touchend"], this.__handleReplay);
88
+ }
89
+ }, {
90
+ key: "render",
91
+ value: function render() {
92
+ return '<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY, '">').concat(this.i18n.REPLAY, "</xg-replay-txt>\n </xg-replay>");
93
+ }
94
+ }], [{
95
+ key: "pluginName",
96
+ get: function get() {
97
+ return "replay";
98
+ }
99
+ }, {
100
+ key: "defaultConfig",
101
+ get: function get() {
102
+ return {
103
+ disable: false
104
+ };
105
+ }
106
+ }]);
107
+ return Replay2;
108
+ }(Plugin);
109
+ export { Replay as default };
@@ -0,0 +1,41 @@
1
+ .xgplayer-replay {
2
+ display: none;
3
+ }
4
+ .xgplayer {
5
+ .xgplayer-replay {
6
+ display: none;
7
+ position: absolute;
8
+ left: 50%;
9
+ top: 50%;
10
+ width: 100px;
11
+ height: 100px;
12
+ justify-content: center;
13
+ align-items: center;
14
+ flex-direction: column;
15
+ z-index: 5;
16
+ transform: translate(-50%, -50%);
17
+ // background: rgba(0,0,0,0.38);
18
+ cursor: pointer;
19
+ // &:hover{
20
+ // background: rgba(0, 0, 0, .58);
21
+ // }
22
+ .xgplayer-replay-txt{
23
+ display: inline-block;
24
+ font-size: 14px;
25
+ color: #fff;
26
+ line-height: 34px;
27
+ text-align: center;
28
+ }
29
+ }
30
+ &.xgplayer-mobile {
31
+ .xgplayer-replay-svg {
32
+ width: 50px;
33
+ height: 50px;
34
+ }
35
+ .xgplayer-replay-txt {
36
+ line-height: 24px;
37
+ font-size: 12px;
38
+ }
39
+ }
40
+ }
41
+
File without changes
@@ -0,0 +1,22 @@
1
+ export default class Rotate extends IconPlugin {
2
+ static get defaultConfig(): {
3
+ position: string;
4
+ index: number;
5
+ innerRotate: boolean;
6
+ clockwise: boolean;
7
+ rotateDeg: number;
8
+ disable: boolean;
9
+ };
10
+ constructor(args: any);
11
+ rotateDeg: any;
12
+ onBtnClick(e: any): void;
13
+ rootWidth: string | number;
14
+ rootHeight: string | number;
15
+ updateRotateDeg(rotateDeg: any, innerRotate: any): void;
16
+ rotate(clockwise?: boolean, innerRotate?: boolean, times?: number): void;
17
+ registerIcons(): {
18
+ rotate: any;
19
+ };
20
+ render(): string;
21
+ }
22
+ import IconPlugin from "../common/iconPlugin";
@@ -0,0 +1,148 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass, get as _get, getPrototypeOf as _getPrototypeOf } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import util from "../../utils/util.js";
3
+ import { VIDEO_RESIZE, ROTATE } from "../../events.js";
4
+ import "../../utils/debug.js";
5
+ import { POSITIONS } from "../../plugin/plugin.js";
6
+ import { xgIconTips } from "../common/iconTools.js";
7
+ import Icon from "../common/iconPlugin.js";
8
+ import RotateSvg from "../assets/rotate.js";
9
+ var Rotate = /* @__PURE__ */ function(_IconPlugin) {
10
+ _inherits(Rotate2, _IconPlugin);
11
+ var _super = _createSuper(Rotate2);
12
+ function Rotate2(args) {
13
+ var _this;
14
+ _classCallCheck(this, Rotate2);
15
+ _this = _super.call(this, args);
16
+ _this.rotateDeg = _this.config.rotateDeg || 0;
17
+ return _this;
18
+ }
19
+ _createClass(Rotate2, [{
20
+ key: "afterCreate",
21
+ value: function afterCreate() {
22
+ var _this2 = this;
23
+ if (this.config.disable) {
24
+ return;
25
+ }
26
+ _get(_getPrototypeOf(Rotate2.prototype), "afterCreate", this).call(this);
27
+ this.appendChild(".xgplayer-icon", this.icons.rotate);
28
+ this.onBtnClick = this.onBtnClick.bind(this);
29
+ this.bind(".xgplayer-icon", ["click", "touchend"], this.onBtnClick);
30
+ this.on(VIDEO_RESIZE, function() {
31
+ if (_this2.rotateDeg && _this2.config.innerRotate) {
32
+ util.setTimeout(_this2, function() {
33
+ _this2.updateRotateDeg(_this2.rotateDeg, _this2.config.innerRotate);
34
+ }, 100);
35
+ }
36
+ });
37
+ var root = this.player.root;
38
+ this.rootWidth = root.style.width || root.offsetWidth || root.clientWidth;
39
+ this.rootHeight = root.style.height || root.offsetHeight || root.clientHeight;
40
+ if (this.rotateDeg) {
41
+ this.updateRotateDeg(this.rotateDeg, this.config.innerRotate);
42
+ }
43
+ }
44
+ }, {
45
+ key: "destroy",
46
+ value: function destroy() {
47
+ _get(_getPrototypeOf(Rotate2.prototype), "destroy", this).call(this);
48
+ this.unbind(".xgplayer-icon", ["click", "touchend"], this.onBtnClick);
49
+ }
50
+ }, {
51
+ key: "onBtnClick",
52
+ value: function onBtnClick(e) {
53
+ e.preventDefault();
54
+ e.stopPropagation();
55
+ this.emitUserAction(e, "rotate");
56
+ this.rotate(this.config.clockwise, this.config.innerRotate, 1);
57
+ }
58
+ }, {
59
+ key: "updateRotateDeg",
60
+ value: function updateRotateDeg(rotateDeg, innerRotate) {
61
+ if (!rotateDeg) {
62
+ rotateDeg = 0;
63
+ }
64
+ if (innerRotate) {
65
+ this.player.videoRotateDeg = rotateDeg;
66
+ return;
67
+ }
68
+ var player = this.player, rootWidth = this.rootWidth, rootHeight = this.rootHeight;
69
+ var root = player.root, innerContainer = player.innerContainer;
70
+ var video = player.media;
71
+ var width = root.offsetWidth;
72
+ var height = innerContainer && innerRotate ? innerContainer.offsetHeight : root.offsetHeight;
73
+ var rWidth = rootWidth;
74
+ var rHeight = rootHeight;
75
+ var x = 0;
76
+ var y = 0;
77
+ if (rotateDeg === 0.75 || rotateDeg === 0.25) {
78
+ rWidth = "".concat(height, "px");
79
+ rHeight = "".concat(width, "px");
80
+ x = -(height - width) / 2;
81
+ y = -(width - height) / 2;
82
+ }
83
+ var _transform = "translate(".concat(x, "px,").concat(y, "px) rotate(").concat(rotateDeg, "turn)");
84
+ var _styles = {
85
+ transformOrigin: "center center",
86
+ transform: _transform,
87
+ webKitTransform: _transform,
88
+ height: rHeight,
89
+ width: rWidth
90
+ };
91
+ var _target = innerRotate ? video : root;
92
+ var poster = innerRotate ? player.getPlugin("poster") : null;
93
+ Object.keys(_styles).map(function(key) {
94
+ _target.style[key] = _styles[key];
95
+ poster && poster.root && (poster.root.style[key] = _styles[key]);
96
+ });
97
+ }
98
+ }, {
99
+ key: "rotate",
100
+ value: function rotate() {
101
+ var clockwise = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
102
+ var innerRotate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
103
+ var times = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
104
+ var player = this.player;
105
+ if (!this.rotateDeg) {
106
+ this.rotateDeg = 0;
107
+ }
108
+ var factor = clockwise ? 1 : -1;
109
+ this.rotateDeg = (this.rotateDeg + 1 + factor * 0.25 * times) % 1;
110
+ this.updateRotateDeg(this.rotateDeg, innerRotate);
111
+ player.emit(ROTATE, this.rotateDeg * 360);
112
+ }
113
+ }, {
114
+ key: "registerIcons",
115
+ value: function registerIcons() {
116
+ return {
117
+ rotate: RotateSvg
118
+ };
119
+ }
120
+ }, {
121
+ key: "render",
122
+ value: function render() {
123
+ if (this.config.disable) {
124
+ return;
125
+ }
126
+ return '\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this, "ROTATE_TIPS", this.playerConfig.isHideTips), "\n </xg-icon>");
127
+ }
128
+ }], [{
129
+ key: "pluginName",
130
+ get: function get() {
131
+ return "rotate";
132
+ }
133
+ }, {
134
+ key: "defaultConfig",
135
+ get: function get() {
136
+ return {
137
+ position: POSITIONS.CONTROLS_RIGHT,
138
+ index: 6,
139
+ innerRotate: true,
140
+ clockwise: false,
141
+ rotateDeg: 0,
142
+ disable: false
143
+ };
144
+ }
145
+ }]);
146
+ return Rotate2;
147
+ }(Icon);
148
+ export { Rotate as default };
File without changes
@@ -0,0 +1,2 @@
1
+ var index = "";
2
+ export { index as default };
@@ -0,0 +1,3 @@
1
+ .xgplayer .xgplayer-shot {
2
+ display: none;
3
+ }
@@ -0,0 +1,30 @@
1
+ export default class ScreenShot extends IconPlugin {
2
+ static get defaultConfig(): {
3
+ position: string;
4
+ index: number;
5
+ quality: number;
6
+ type: string;
7
+ format: string;
8
+ width: number;
9
+ height: number;
10
+ fitVideo: boolean;
11
+ disable: boolean;
12
+ name: string;
13
+ };
14
+ beforeCreate(args: any): void;
15
+ initSize: (data: any) => void;
16
+ onClickBtn(e: any): void;
17
+ saveScreenShot(data: any, filename: any): void;
18
+ createCanvas(width: any, height: any): void;
19
+ canvasCtx: CanvasRenderingContext2D;
20
+ canvas: HTMLCanvasElement;
21
+ shot(width: any, height: any, option?: {
22
+ quality: number;
23
+ type: string;
24
+ }): Promise<any>;
25
+ registerIcons(): {
26
+ screenshotIcon: any;
27
+ };
28
+ render(): string;
29
+ }
30
+ import IconPlugin from "../common/iconPlugin";