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,140 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass, objectSpread2 as _objectSpread2, get as _get, getPrototypeOf as _getPrototypeOf } from "../../_virtual/_rollupPluginBabelHelpers.js";
2
+ import "../../utils/util.js";
3
+ import { RATE_CHANGE } from "../../events.js";
4
+ import "../../utils/debug.js";
5
+ import { POSITIONS } from "../../plugin/plugin.js";
6
+ import OptionsIcon from "../common/optionsIcon.js";
7
+ var PlaybackRate = /* @__PURE__ */ function(_OptionsIcon) {
8
+ _inherits(PlaybackRate2, _OptionsIcon);
9
+ var _super = _createSuper(PlaybackRate2);
10
+ function PlaybackRate2(args) {
11
+ var _this;
12
+ _classCallCheck(this, PlaybackRate2);
13
+ _this = _super.call(this, args);
14
+ _this.curRate = 1;
15
+ return _this;
16
+ }
17
+ _createClass(PlaybackRate2, [{
18
+ key: "beforeCreate",
19
+ value: function beforeCreate(args) {
20
+ var playbackRate = args.player.config.playbackRate;
21
+ var list = !playbackRate ? [] : Array.isArray(playbackRate) ? playbackRate : args.config.list;
22
+ if (Array.isArray(list)) {
23
+ args.config.list = list.map(function(item) {
24
+ if (typeof item === "number") {
25
+ item = {
26
+ rate: item,
27
+ text: "".concat(item, "x")
28
+ };
29
+ } else if (!item.text && item.rate) {
30
+ item.text = "".concat(item.rate, "x");
31
+ }
32
+ return item;
33
+ });
34
+ }
35
+ }
36
+ }, {
37
+ key: "afterCreate",
38
+ value: function afterCreate() {
39
+ var _this2 = this;
40
+ _get(_getPrototypeOf(PlaybackRate2.prototype), "afterCreate", this).call(this);
41
+ this.on(RATE_CHANGE, function() {
42
+ if (_this2.curValue === _this2.player.playbackRate) {
43
+ return;
44
+ }
45
+ _this2.renderItemList();
46
+ });
47
+ this.renderItemList();
48
+ }
49
+ }, {
50
+ key: "show",
51
+ value: function show() {
52
+ if (!this.config.list || this.config.list.length === 0) {
53
+ return;
54
+ }
55
+ _get(_getPrototypeOf(PlaybackRate2.prototype), "show", this).call(this);
56
+ }
57
+ }, {
58
+ key: "onItemClick",
59
+ value: function onItemClick(e, data) {
60
+ _get(_getPrototypeOf(PlaybackRate2.prototype), "onItemClick", this).apply(this, arguments);
61
+ var target = e.delegateTarget;
62
+ var rate = Number(target.getAttribute("rate"));
63
+ if (!rate || rate === this.curValue) {
64
+ return false;
65
+ }
66
+ var props = {
67
+ playbackRate: {
68
+ from: this.player.playbackRate,
69
+ to: rate
70
+ }
71
+ };
72
+ this.emitUserAction(e, "change_rate", {
73
+ props
74
+ });
75
+ this.curValue = rate;
76
+ this.player.playbackRate = rate;
77
+ }
78
+ }, {
79
+ key: "renderItemList",
80
+ value: function renderItemList() {
81
+ var _this3 = this;
82
+ var playbackRate = this.player.playbackRate || 1;
83
+ this.curValue = playbackRate;
84
+ var curIndex = -1;
85
+ var items = this.config.list.map(function(item, index) {
86
+ var itemInfo = {
87
+ rate: item.rate
88
+ };
89
+ if (itemInfo.rate === playbackRate) {
90
+ itemInfo.selected = true;
91
+ curIndex = index;
92
+ }
93
+ itemInfo.showText = _this3.getTextByLang(item);
94
+ return itemInfo;
95
+ });
96
+ _get(_getPrototypeOf(PlaybackRate2.prototype), "renderItemList", this).call(this, items, curIndex);
97
+ }
98
+ }, {
99
+ key: "changeCurrentText",
100
+ value: function changeCurrentText() {
101
+ if (this.isIcons) {
102
+ return;
103
+ }
104
+ var list = this.config.list;
105
+ var index = this.curIndex < list.length ? this.curIndex : 0;
106
+ var curItem = list[index];
107
+ var _text = "";
108
+ if (!curItem || this.curIndex < 0) {
109
+ _text = "".concat(this.player.playbackRate, "x");
110
+ } else {
111
+ _text = this.getTextByLang(curItem, "iconText");
112
+ }
113
+ this.find(".icon-text").innerHTML = _text;
114
+ }
115
+ }, {
116
+ key: "destroy",
117
+ value: function destroy() {
118
+ _get(_getPrototypeOf(PlaybackRate2.prototype), "destroy", this).call(this);
119
+ }
120
+ }], [{
121
+ key: "pluginName",
122
+ get: function get() {
123
+ return "playbackRate";
124
+ }
125
+ }, {
126
+ key: "defaultConfig",
127
+ get: function get() {
128
+ return _objectSpread2(_objectSpread2({}, OptionsIcon.defaultConfig), {}, {
129
+ position: POSITIONS.CONTROLS_RIGHT,
130
+ index: 4,
131
+ list: [2, 1.5, 1, 0.75, 0.5],
132
+ className: "xgplayer-playbackrate",
133
+ isShowIcon: true,
134
+ hidePortrait: false
135
+ });
136
+ }
137
+ }]);
138
+ return PlaybackRate2;
139
+ }(OptionsIcon);
140
+ export { PlaybackRate as default };
@@ -0,0 +1,6 @@
1
+ .xgplayer {
2
+ .xgplayer-playbackrate {
3
+ display: none;
4
+ cursor: default;
5
+ }
6
+ }
@@ -0,0 +1,39 @@
1
+ .xgplayer .xgplayer-poster {
2
+ display: block;
3
+ opacity: 1;
4
+ visibility: visible;
5
+ position: absolute;
6
+ left: 0;
7
+ top: 0;
8
+ width: 100%;
9
+ height: 100%;
10
+ background-size: cover;
11
+ background-position: center center;
12
+ background-size: 100% auto;
13
+ background-repeat: no-repeat;
14
+ transition: opacity 0.3s ease, visibility 0.3s ease;
15
+ pointer-events: none;
16
+ }
17
+ .xgplayer .xgplayer-poster.hide {
18
+ opacity: 0;
19
+ visibility: hidden;
20
+ }
21
+
22
+ .xgplayer.xgplayer-playing .xgplayer-poster {
23
+ opacity: 0;
24
+ visibility: hidden;
25
+ }
26
+
27
+ .xgplayer.xgplayer-is-enter .xgplayer-poster.xg-showplay, .xgplayer.xgplayer-playing .xgplayer-poster.xg-showplay {
28
+ opacity: 1;
29
+ visibility: visible;
30
+ }
31
+
32
+ .xgplayer.xgplayer-nostart .xgplayer-poster, .xgplayer.xgplayer-ended .xgplayer-poster, .xgplayer.not-allow-autoplay .xgplayer-poster {
33
+ opacity: 1;
34
+ visibility: visible;
35
+ }
36
+ .xgplayer.xgplayer-nostart .xgplayer-poster.hide, .xgplayer.xgplayer-ended .xgplayer-poster.hide, .xgplayer.not-allow-autoplay .xgplayer-poster.hide {
37
+ opacity: 0;
38
+ visibility: hidden;
39
+ }
@@ -0,0 +1,27 @@
1
+ export default Poster;
2
+ export type IPosterConfig = {
3
+ isEndedShow?: boolean;
4
+ hideCanplay?: boolean;
5
+ poster?: string;
6
+ };
7
+ /**
8
+ * @typedef {{
9
+ * isEndedShow?: boolean, // 是否在播放结束之后显示
10
+ * hideCanplay?: boolean, // cnaplay 时间大于1的时候才隐藏
11
+ * poster?: string // 封面图地址
12
+ * }} IPosterConfig
13
+ */
14
+ declare class Poster extends Plugin {
15
+ /**
16
+ * @type IPosterConfig
17
+ */
18
+ static get defaultConfig(): IPosterConfig;
19
+ set isEndedShow(arg: any);
20
+ get isEndedShow(): any;
21
+ show(): void;
22
+ beforeCreate(args: any): void;
23
+ onTimeUpdate(): void;
24
+ update(poster: any): void;
25
+ render(): string;
26
+ }
27
+ 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, TIME_UPDATE, URL_CHANGE, PLAY } from "../../events.js";
4
+ import "../../utils/debug.js";
5
+ import Plugin from "../../plugin/plugin.js";
6
+ var Poster = /* @__PURE__ */ function(_Plugin) {
7
+ _inherits(Poster2, _Plugin);
8
+ var _super = _createSuper(Poster2);
9
+ function Poster2() {
10
+ _classCallCheck(this, Poster2);
11
+ return _super.apply(this, arguments);
12
+ }
13
+ _createClass(Poster2, [{
14
+ key: "isEndedShow",
15
+ get: function get() {
16
+ return this.config.isEndedShow;
17
+ },
18
+ set: function set(value) {
19
+ this.config.isEndedShow = value;
20
+ }
21
+ }, {
22
+ key: "hide",
23
+ value: function hide() {
24
+ util.addClass(this.root, "hide");
25
+ }
26
+ }, {
27
+ key: "show",
28
+ value: function show() {
29
+ util.removeClass(this.root, "hide");
30
+ }
31
+ }, {
32
+ key: "beforeCreate",
33
+ value: function beforeCreate(args) {
34
+ if (typeof args.player.config.poster === "string") {
35
+ args.config.poster = args.player.config.poster;
36
+ }
37
+ }
38
+ }, {
39
+ key: "afterCreate",
40
+ value: function afterCreate() {
41
+ var _this = this;
42
+ this.on(ENDED, function() {
43
+ if (_this.isEndedShow) {
44
+ util.removeClass(_this.root, "hide");
45
+ }
46
+ });
47
+ if (this.config.hideCanplay) {
48
+ this.once(TIME_UPDATE, function() {
49
+ _this.onTimeUpdate();
50
+ });
51
+ this.on(URL_CHANGE, function() {
52
+ util.removeClass(_this.root, "hide");
53
+ util.addClass(_this.root, "xg-showplay");
54
+ _this.once(TIME_UPDATE, function() {
55
+ _this.onTimeUpdate();
56
+ });
57
+ });
58
+ } else {
59
+ this.on(PLAY, function() {
60
+ util.addClass(_this.root, "hide");
61
+ });
62
+ }
63
+ }
64
+ }, {
65
+ key: "onTimeUpdate",
66
+ value: function onTimeUpdate() {
67
+ var _this2 = this;
68
+ if (!this.player.currentTime) {
69
+ this.once(TIME_UPDATE, function() {
70
+ _this2.onTimeUpdate();
71
+ });
72
+ } else {
73
+ util.removeClass(this.root, "xg-showplay");
74
+ }
75
+ }
76
+ }, {
77
+ key: "update",
78
+ value: function update(poster) {
79
+ if (!poster) {
80
+ return;
81
+ }
82
+ this.config.poster = poster;
83
+ this.root.style.backgroundImage = "url(".concat(poster, ")");
84
+ }
85
+ }, {
86
+ key: "render",
87
+ value: function render() {
88
+ var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay;
89
+ var style = poster ? "background-image:url(".concat(poster, ");") : "";
90
+ return '<xg-poster class="xgplayer-poster '.concat(hideCanplay ? "xg-showplay" : "", '" style="').concat(style, '">\n </xg-poster>');
91
+ }
92
+ }], [{
93
+ key: "pluginName",
94
+ get: function get() {
95
+ return "poster";
96
+ }
97
+ }, {
98
+ key: "defaultConfig",
99
+ get: function get() {
100
+ return {
101
+ isEndedShow: true,
102
+ hideCanplay: false,
103
+ poster: ""
104
+ };
105
+ }
106
+ }]);
107
+ return Poster2;
108
+ }(Plugin);
109
+ export { Poster as default };
@@ -0,0 +1,56 @@
1
+ .xgplayer {
2
+ .xgplayer-poster {
3
+ display: block;
4
+ opacity: 1;
5
+ visibility: visible;
6
+ position: absolute;
7
+ left: 0;
8
+ top: 0;
9
+ width: 100%;
10
+ height: 100%;
11
+ background-size: cover;
12
+ background-position: center center;
13
+ background-size: 100% auto;
14
+ background-repeat: no-repeat;
15
+ transition: opacity .3s ease,visibility .3s ease;
16
+ pointer-events: none;
17
+ &.hide {
18
+ opacity: 0;
19
+ visibility: hidden;
20
+ }
21
+ }
22
+ }
23
+
24
+ .xgplayer.xgplayer-playing {
25
+ .xgplayer-poster {
26
+ // display: none;
27
+ opacity: 0;
28
+ visibility: hidden;
29
+ }
30
+ }
31
+
32
+ .xgplayer {
33
+ &.xgplayer-is-enter, &.xgplayer-playing {
34
+ .xgplayer-poster.xg-showplay {
35
+ opacity: 1;
36
+ visibility: visible;
37
+ }
38
+ }
39
+ }
40
+
41
+ .xgplayer {
42
+ &.xgplayer-nostart,
43
+ &.xgplayer-ended,
44
+ &.not-allow-autoplay {
45
+ .xgplayer-poster {
46
+ // display: block;
47
+ opacity: 1;
48
+ visibility: visible;
49
+ &.hide {
50
+ opacity: 0;
51
+ visibility: hidden;
52
+ }
53
+ }
54
+ }
55
+ }
56
+
@@ -0,0 +1,234 @@
1
+ @charset "UTF-8";
2
+ .xgplayer {
3
+ /* 滑块样式 */
4
+ /* 进度条打点*/
5
+ }
6
+ .xgplayer .xgplayer-progress {
7
+ display: flex;
8
+ align-items: center;
9
+ position: relative;
10
+ min-width: 50px;
11
+ height: 12px;
12
+ left: 0;
13
+ right: 0;
14
+ top: 0;
15
+ outline: none;
16
+ flex: 1;
17
+ cursor: pointer;
18
+ }
19
+ .xgplayer .xgplayer-progress-outer {
20
+ position: relative;
21
+ width: 100%;
22
+ height: 2px;
23
+ border-radius: 3px;
24
+ cursor: pointer;
25
+ }
26
+ .xgplayer .progress-list {
27
+ display: flex;
28
+ height: 100%;
29
+ width: 100%;
30
+ border-radius: inherit;
31
+ }
32
+ .xgplayer .xgplayer-progress-inner {
33
+ position: relative;
34
+ flex: 1;
35
+ height: 100%;
36
+ background: rgba(255, 255, 255, 0.3);
37
+ transition: height 0.2s ease-in, opacity 0.2s ease-out;
38
+ border-radius: inherit;
39
+ margin-right: 2px;
40
+ pointer-events: none;
41
+ }
42
+ .xgplayer .xgplayer-progress-inner:last-child, .xgplayer .xgplayer-progress-inner:only-child {
43
+ margin-right: 0;
44
+ }
45
+ .xgplayer .inner-focus-point {
46
+ background: #fff;
47
+ position: relative;
48
+ }
49
+ .xgplayer .inner-focus-point:before, .xgplayer .inner-focus-point:after {
50
+ position: absolute;
51
+ top: 0;
52
+ content: " ";
53
+ display: block;
54
+ width: 2px;
55
+ height: 300%;
56
+ top: 50%;
57
+ z-index: 1;
58
+ transform: translateY(-50%);
59
+ border-radius: 3px;
60
+ background: #fff;
61
+ }
62
+ .xgplayer .inner-focus-point:before {
63
+ left: 0;
64
+ }
65
+ .xgplayer .inner-focus-point:after {
66
+ right: 0;
67
+ }
68
+ .xgplayer .xgplayer-progress-cache, .xgplayer .xgplayer-progress-played {
69
+ display: block;
70
+ height: 100%;
71
+ width: 0;
72
+ position: absolute;
73
+ top: 0;
74
+ left: 0;
75
+ border-radius: inherit;
76
+ }
77
+ .xgplayer .xgplayer-progress-played {
78
+ background: linear-gradient(-90deg, #FA1F41 0%, #E31106 100%);
79
+ }
80
+ .xgplayer .xgplayer-progress-cache {
81
+ background: rgba(255, 255, 255, 0.5);
82
+ }
83
+ .xgplayer .xgplayer-progress-btn {
84
+ display: block;
85
+ background: rgba(255, 94, 94, 0.304093);
86
+ border: 0.5px solid rgba(255, 94, 94, 0.056545);
87
+ box-shadow: 0px 0px 1px rgba(255, 0, 0, 0.382897);
88
+ width: 20px;
89
+ height: 20px;
90
+ border-radius: 30px;
91
+ left: 0;
92
+ top: 50%;
93
+ position: absolute;
94
+ z-index: 1;
95
+ transform: translate(-50%, -50%);
96
+ box-sizing: border-box;
97
+ pointer-events: none;
98
+ }
99
+ .xgplayer .xgplayer-progress-btn:before {
100
+ content: " ";
101
+ display: block;
102
+ position: relative;
103
+ width: 12px;
104
+ height: 12px;
105
+ left: 50%;
106
+ top: 50%;
107
+ transform: translate(-50%, -50%);
108
+ border-radius: 30px;
109
+ background: #FFFFFF;
110
+ }
111
+ .xgplayer .xgplayer-progress-btn.active {
112
+ border: 4px solid rgba(255, 94, 94, 0.064057);
113
+ }
114
+ .xgplayer .xgplayer-progress-btn.active:before {
115
+ box-shadow: 0px 0px 3px rgba(248, 89, 89, 0.689);
116
+ }
117
+ .xgplayer .xgplayer-progress-dot {
118
+ display: inline-block;
119
+ position: absolute;
120
+ height: 100%;
121
+ width: 5px;
122
+ top: 0px;
123
+ background: white;
124
+ border-radius: 6px;
125
+ z-index: 16;
126
+ }
127
+ .xgplayer .xgplayer-progress-dot .xgplayer-progress-tip {
128
+ position: absolute;
129
+ left: 25%;
130
+ top: -40px;
131
+ height: auto;
132
+ line-height: 30px;
133
+ width: auto;
134
+ transform: scale(0.8) translateX(-50%);
135
+ background: rgba(0, 0, 0, 0.3);
136
+ border-radius: 6px;
137
+ border: 1px solid rgba(0, 0, 0, 0.8);
138
+ cursor: default;
139
+ white-space: nowrap;
140
+ display: none;
141
+ }
142
+ .xgplayer .xgplayer-progress-dot:hover .xgplayer-progress-tip {
143
+ display: block;
144
+ }
145
+ .xgplayer .flex-controls .xgplayer-progress {
146
+ transform: translateY(0);
147
+ }
148
+ .xgplayer.xgplayer-pc .xgplayer-progress-btn {
149
+ transform: translate(-50%, -50%) scale(0);
150
+ }
151
+ .xgplayer.xgplayer-pc .xgplayer-progress-outer {
152
+ height: 3px;
153
+ }
154
+ .xgplayer.xgplayer-pc .xgplayer-progress-inner {
155
+ margin-right: 4px;
156
+ }
157
+ .xgplayer.xgplayer-pc .xgplayer-progress-inner:last-child, .xgplayer.xgplayer-pc .xgplayer-progress-inner:only-child {
158
+ margin-right: 0;
159
+ }
160
+ .xgplayer.xgplayer-pc .inner-focus-point:before, .xgplayer.xgplayer-pc .inner-focus-point:after {
161
+ width: 3px;
162
+ }
163
+ .xgplayer.xgplayer-pc .inner-focus-highlight {
164
+ background: rgba(255, 255, 255, 0.8);
165
+ }
166
+ .xgplayer.xgplayer-pc .xgplayer-progress.active .xgplayer-progress-outer {
167
+ height: 6px;
168
+ margin-bottom: 3px;
169
+ transition: height 0.3s ease, margin-bottom 0.3s ease;
170
+ }
171
+ .xgplayer.xgplayer-pc .xgplayer-progress.active .xgplayer-progress-btn {
172
+ transform: translate(-50%, -50%) scale(1);
173
+ }
174
+ .xgplayer.xgplayer-pc .xgplayer-progress.active .inner-focus-point:before, .xgplayer.xgplayer-pc .xgplayer-progress.active .inner-focus-point:after {
175
+ width: 6px;
176
+ }
177
+ .xgplayer .xgplayer-progress-bottom .xgplayer-progress-outer {
178
+ top: 9px;
179
+ }
180
+ .xgplayer .xgplayer-progress-bottom .xgplayer-progress-btn:before {
181
+ height: 6px;
182
+ width: 6px;
183
+ }
184
+ .xgplayer.xgplayer-mobile .xgplayer-progress-bottom .xgplayer-progress-outer {
185
+ height: 4px;
186
+ }
187
+ @media (prefers-color-scheme: dark) {
188
+ .xgplayer .xgplayer-progress .xgplayer-progress-inner {
189
+ background-color: rgba(255, 255, 255, 0.3);
190
+ }
191
+ .xgplayer .xgplayer-progress .inner-focus-highlight {
192
+ background: rgba(255, 255, 255, 0.8);
193
+ }
194
+ .xgplayer .xgplayer-progress .xgplayer-progress-btn {
195
+ background: rgba(255, 94, 94, 0.304093);
196
+ border: 0.5px solid rgba(255, 94, 94, 0.056545);
197
+ box-shadow: 0px 0px 1px rgba(255, 0, 0, 0.382897);
198
+ }
199
+ .xgplayer .xgplayer-progress .xgplayer-progress-btn:before {
200
+ background-color: #fff;
201
+ }
202
+ .xgplayer .xgplayer-progress .xgplayer-progress-played {
203
+ background-color: linear-gradient(-90deg, #FA1F41 0%, #E31106 100%);
204
+ }
205
+ .xgplayer .xgplayer-progress .xgplayer-progress-cache {
206
+ background-color: rgba(255, 255, 255, 0.5);
207
+ }
208
+ }
209
+ .xg-mini-progress {
210
+ display: none;
211
+ position: absolute;
212
+ height: 2px;
213
+ left: 0;
214
+ right: 0;
215
+ bottom: 0px;
216
+ pointer-events: none;
217
+ }
218
+ .xg-mini-progress xg-mini-progress-played, .xg-mini-progress xg-mini-progress-cache {
219
+ height: 100%;
220
+ width: 0;
221
+ position: absolute;
222
+ top: 0;
223
+ left: 0;
224
+ border-radius: inherit;
225
+ }
226
+ .xg-mini-progress xg-mini-progress-played {
227
+ background: linear-gradient(-90deg, #FA1F41 0%, #E31106 100%);
228
+ }
229
+ .xg-mini-progress xg-mini-progress-cache {
230
+ background: rgba(255, 255, 255, 0.5);
231
+ }
232
+ .xgplayer-inactive .xg-mini-progress, .xgplayer-mini .xg-mini-progress {
233
+ display: block;
234
+ }