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,31 @@
1
+ export default INDEXDB;
2
+ declare class INDEXDB {
3
+ constructor(mydb?: {
4
+ name: string;
5
+ version: number;
6
+ db: any;
7
+ ojstore: {
8
+ name: string;
9
+ keypath: string;
10
+ };
11
+ });
12
+ indexedDB: any;
13
+ IDBKeyRange: any;
14
+ myDB: {
15
+ name: string;
16
+ version: number;
17
+ db: any;
18
+ ojstore: {
19
+ name: string;
20
+ keypath: string;
21
+ };
22
+ };
23
+ openDB(callback: any): void;
24
+ deletedb(): void;
25
+ closeDB(): void;
26
+ addData(storename: any, data: any): void;
27
+ putData(storename: any, data: any): void;
28
+ getDataByKey(storename: any, key: any, callback: any): void;
29
+ deleteData(storename: any, key: any): void;
30
+ clearData(storename: any): void;
31
+ }
@@ -0,0 +1,107 @@
1
+ import { createClass as _createClass, classCallCheck as _classCallCheck } from "../_virtual/_rollupPluginBabelHelpers.js";
2
+ var INDEXDB = /* @__PURE__ */ function() {
3
+ function INDEXDB2() {
4
+ var mydb = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
5
+ name: "xgplayer",
6
+ version: 1,
7
+ db: null,
8
+ ojstore: {
9
+ name: "xg-m4a",
10
+ keypath: "vid"
11
+ }
12
+ };
13
+ _classCallCheck(this, INDEXDB2);
14
+ this.indexedDB = window.indexedDB || window.webkitindexedDB;
15
+ this.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;
16
+ this.myDB = mydb;
17
+ }
18
+ _createClass(INDEXDB2, [{
19
+ key: "openDB",
20
+ value: function openDB(callback) {
21
+ var _this = this;
22
+ var self = this;
23
+ var version = this.myDB.version || 1;
24
+ var request = self.indexedDB.open(self.myDB.name, version);
25
+ request.onerror = function(e) {
26
+ };
27
+ request.onsuccess = function(e) {
28
+ _this.myDB.db = e.target.result;
29
+ callback.call(self);
30
+ };
31
+ request.onupgradeneeded = function(e) {
32
+ var db = e.target.result;
33
+ e.target.transaction;
34
+ if (!db.objectStoreNames.contains(self.myDB.ojstore.name)) {
35
+ db.createObjectStore(self.myDB.ojstore.name, {
36
+ keyPath: self.myDB.ojstore.keypath
37
+ });
38
+ }
39
+ };
40
+ }
41
+ }, {
42
+ key: "deletedb",
43
+ value: function deletedb() {
44
+ var self = this;
45
+ self.indexedDB.deleteDatabase(this.myDB.name);
46
+ }
47
+ }, {
48
+ key: "closeDB",
49
+ value: function closeDB() {
50
+ this.myDB.db.close();
51
+ }
52
+ }, {
53
+ key: "addData",
54
+ value: function addData(storename, data) {
55
+ var store = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
56
+ var request;
57
+ for (var i = 0; i < data.length; i++) {
58
+ request = store.add(data[i]);
59
+ request.onerror = function() {
60
+ };
61
+ request.onsuccess = function() {
62
+ };
63
+ }
64
+ }
65
+ }, {
66
+ key: "putData",
67
+ value: function putData(storename, data) {
68
+ var store = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
69
+ var request;
70
+ for (var i = 0; i < data.length; i++) {
71
+ request = store.put(data[i]);
72
+ request.onerror = function() {
73
+ };
74
+ request.onsuccess = function() {
75
+ };
76
+ }
77
+ }
78
+ }, {
79
+ key: "getDataByKey",
80
+ value: function getDataByKey(storename, key, callback) {
81
+ var self = this;
82
+ var store = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
83
+ var request = store.get(key);
84
+ request.onerror = function() {
85
+ callback.call(self, null);
86
+ };
87
+ request.onsuccess = function(e) {
88
+ var result = e.target.result;
89
+ callback.call(self, result);
90
+ };
91
+ }
92
+ }, {
93
+ key: "deleteData",
94
+ value: function deleteData(storename, key) {
95
+ var store = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
96
+ store.delete(key);
97
+ }
98
+ }, {
99
+ key: "clearData",
100
+ value: function clearData(storename) {
101
+ var store = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
102
+ store.clear();
103
+ }
104
+ }]);
105
+ return INDEXDB2;
106
+ }();
107
+ export { INDEXDB as default };
@@ -0,0 +1,10 @@
1
+ declare namespace XG_DEBUG {
2
+ namespace config {
3
+ const debug: number;
4
+ }
5
+ function logInfo(message: any, ...optionalParams: any[]): void;
6
+ function logWarn(message: any, ...optionalParams: any[]): void;
7
+ function logError(message: any, ...optionalParams: any[]): void;
8
+ }
9
+ export function bindDebug(player: any): void;
10
+ export { XG_DEBUG as default };
@@ -0,0 +1,43 @@
1
+ var XG_DEBUG_OPEN = typeof window !== "undefined" && window.location && window.location.href.indexOf("xgplayerdebugger=1") > -1;
2
+ var STYLE = {
3
+ info: "color: #525252; background-color: #90ee90;",
4
+ error: "color: #525252; background-color: red;",
5
+ warn: "color: #525252; background-color: yellow; "
6
+ };
7
+ var XGTAG = "%c[xgplayer]";
8
+ var XG_DEBUG = {
9
+ config: {
10
+ debug: XG_DEBUG_OPEN ? 3 : 0
11
+ },
12
+ logInfo: function logInfo(message) {
13
+ var _console;
14
+ for (var _len = arguments.length, optionalParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
15
+ optionalParams[_key - 1] = arguments[_key];
16
+ }
17
+ this.config.debug >= 3 && (_console = console).log.apply(_console, [XGTAG, STYLE.info, message].concat(optionalParams));
18
+ },
19
+ logWarn: function logWarn(message) {
20
+ var _console2;
21
+ for (var _len2 = arguments.length, optionalParams = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
22
+ optionalParams[_key2 - 1] = arguments[_key2];
23
+ }
24
+ this.config.debug >= 1 && (_console2 = console).warn.apply(_console2, [XGTAG, STYLE.warn, message].concat(optionalParams));
25
+ },
26
+ logError: function logError(message) {
27
+ var _console3;
28
+ if (this.config.debug < 1) {
29
+ return;
30
+ }
31
+ var _fun = this.config.debug >= 2 ? "trace" : "error";
32
+ for (var _len3 = arguments.length, optionalParams = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
33
+ optionalParams[_key3 - 1] = arguments[_key3];
34
+ }
35
+ (_console3 = console)[_fun].apply(_console3, [XGTAG, STYLE.error, message].concat(optionalParams));
36
+ }
37
+ };
38
+ function bindDebug(player) {
39
+ player.logInfo = XG_DEBUG.logInfo.bind(player);
40
+ player.logWarn = XG_DEBUG.logWarn.bind(player);
41
+ player.logError = XG_DEBUG.logError.bind(player);
42
+ }
43
+ export { bindDebug, XG_DEBUG as default };
@@ -0,0 +1,54 @@
1
+ export default class Draggabilly {
2
+ constructor(root: any, options?: {});
3
+ isEnabled: boolean;
4
+ isDragging: boolean;
5
+ isDown: boolean;
6
+ position: {};
7
+ downPoint: {};
8
+ dragPoint: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ startPos: {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ _root: any;
17
+ _handlerDom: any;
18
+ _bindStartEvent(): void;
19
+ _startKey: string;
20
+ _unbindStartEvent(): void;
21
+ _bindPostStartEvents(event: any): void;
22
+ _boundPointerEvents: any;
23
+ _unbindPostStartEvents(): void;
24
+ enable(): void;
25
+ disable(): void;
26
+ onDocUp(e: any): void;
27
+ animate(): void;
28
+ positionDrag(): void;
29
+ setLeftTop(): void;
30
+ onmousedown(e: any): void;
31
+ onmousemove(e: any): void;
32
+ onmouseup(e: any): void;
33
+ ontouchstart(e: any): void;
34
+ touchIdentifier: any;
35
+ ontouchmove(e: any): void;
36
+ ontouchend(e: any): void;
37
+ ontouchcancel(e: any): void;
38
+ dragStart(e: any, pointer: any): void;
39
+ dragRealStart(e: any, pointer: any): void;
40
+ dragEnd(e: any, pointer: any): void;
41
+ _dragPointerMove(e: any, pointer: any): {
42
+ x: number;
43
+ y: number;
44
+ };
45
+ dragMove(e: any, pointer: any): void;
46
+ dragCancel(e: any, pointer: any): void;
47
+ presetInfo(): void;
48
+ destroy(): void;
49
+ hasDragStarted(moveVector: any): boolean;
50
+ checkContain(axis: any, drag: any, grid: any): any;
51
+ _getPosition(): void;
52
+ _addTransformPosition(style: any): void;
53
+ _getPositionCoord(styleSide: any, measure: any): number;
54
+ }
@@ -0,0 +1,410 @@
1
+ import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, possibleConstructorReturn as _possibleConstructorReturn, createClass as _createClass, typeof as _typeof } from "../_virtual/_rollupPluginBabelHelpers.js";
2
+ import EventEmitter from "eventemitter3";
3
+ function getStyleSize(value) {
4
+ var num = parseFloat(value);
5
+ var isValid = value.indexOf("%") === -1 && !Number.isNaN(num);
6
+ return isValid && num;
7
+ }
8
+ var measurements = ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom", "marginLeft", "marginRight", "marginTop", "marginBottom", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "borderBottomWidth"];
9
+ var measurementsLength = measurements.length;
10
+ function getZeroSize() {
11
+ var size = {
12
+ width: 0,
13
+ height: 0,
14
+ innerWidth: 0,
15
+ innerHeight: 0,
16
+ outerWidth: 0,
17
+ outerHeight: 0
18
+ };
19
+ for (var i = 0; i < measurementsLength; i++) {
20
+ var measurement = measurements[i];
21
+ size[measurement] = 0;
22
+ }
23
+ return size;
24
+ }
25
+ function getStyle(elem) {
26
+ var style = window.getComputedStyle(elem);
27
+ return style;
28
+ }
29
+ function getSize(elem) {
30
+ if (typeof elem === "string") {
31
+ elem = document.querySelector(elem);
32
+ }
33
+ if (!elem || _typeof(elem) !== "object" || !elem.nodeType) {
34
+ return;
35
+ }
36
+ var style = getStyle(elem);
37
+ if (style.display === "none") {
38
+ return getZeroSize();
39
+ }
40
+ var size = {};
41
+ size.width = elem.offsetWidth;
42
+ size.height = elem.offsetHeight;
43
+ var isBorderBox = size.isBorderBox = style.boxSizing === "border-box";
44
+ for (var i = 0; i < measurementsLength; i++) {
45
+ var measurement = measurements[i];
46
+ var value = style[measurement];
47
+ var num = parseFloat(value);
48
+ size[measurement] = !Number.isNaN(num) ? num : 0;
49
+ }
50
+ var paddingWidth = size.paddingLeft + size.paddingRight;
51
+ var paddingHeight = size.paddingTop + size.paddingBottom;
52
+ var marginWidth = size.marginLeft + size.marginRight;
53
+ var marginHeight = size.marginTop + size.marginBottom;
54
+ var borderWidth = size.borderLeftWidth + size.borderRightWidth;
55
+ var borderHeight = size.borderTopWidth + size.borderBottomWidth;
56
+ var isBorderBoxSizeOuter = isBorderBox;
57
+ var styleWidth = getStyleSize(style.width);
58
+ if (styleWidth !== false) {
59
+ size.width = styleWidth + (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth);
60
+ }
61
+ var styleHeight = getStyleSize(style.height);
62
+ if (styleHeight !== false) {
63
+ size.height = styleHeight + (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight);
64
+ }
65
+ size.innerWidth = size.width - (paddingWidth + borderWidth);
66
+ size.innerHeight = size.height - (paddingHeight + borderHeight);
67
+ size.outerWidth = size.width + marginWidth;
68
+ size.outerHeight = size.height + marginHeight;
69
+ return size;
70
+ }
71
+ function getTouch(touches, dentifier) {
72
+ for (var i = 0; i < touches.length; i++) {
73
+ var touch = touches[i];
74
+ if (touch.identifier === dentifier) {
75
+ return touch;
76
+ }
77
+ }
78
+ }
79
+ var EVENTS = {
80
+ START: "dragStart",
81
+ MOVE: "dragMove",
82
+ ENDED: "dragEnded"
83
+ };
84
+ var POST_START_EVENTS = {
85
+ mousedown: ["mousemove", "mouseup"],
86
+ touchstart: ["touchmove", "touchend", "touchcancel"],
87
+ pointerdown: ["pointermove", "pointerup", "pointercancel"]
88
+ };
89
+ var Draggabilly = /* @__PURE__ */ function(_EventEmitter) {
90
+ _inherits(Draggabilly2, _EventEmitter);
91
+ var _super = _createSuper(Draggabilly2);
92
+ function Draggabilly2(root) {
93
+ var _this;
94
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
95
+ _classCallCheck(this, Draggabilly2);
96
+ _this = _super.call(this);
97
+ _this.isEnabled = true;
98
+ _this.isDragging = false;
99
+ _this.isDown = false;
100
+ _this.position = {};
101
+ _this.downPoint = {};
102
+ _this.dragPoint = {
103
+ x: 0,
104
+ y: 0
105
+ };
106
+ _this.startPos = {
107
+ x: 0,
108
+ y: 0
109
+ };
110
+ _this._root = root instanceof Element ? root : document.querySelector(root);
111
+ _this._handlerDom = options.handle instanceof Element ? options.handle : document.querySelector(options.handle);
112
+ if (!_this._root || !_this._handlerDom) {
113
+ return _possibleConstructorReturn(_this);
114
+ }
115
+ _this._bindStartEvent();
116
+ return _this;
117
+ }
118
+ _createClass(Draggabilly2, [{
119
+ key: "_bindStartEvent",
120
+ value: function _bindStartEvent() {
121
+ var _this2 = this;
122
+ if ("ontouchstart" in window) {
123
+ this._startKey = "touchstart";
124
+ } else {
125
+ this._startKey = "mousedown";
126
+ }
127
+ this["on".concat(this._startKey)] = this["on".concat(this._startKey)].bind(this);
128
+ this._handlerDom.addEventListener(this._startKey, this["on".concat(this._startKey)]);
129
+ POST_START_EVENTS[this._startKey].map(function(key) {
130
+ _this2["on".concat(key)] = _this2["on".concat(key)].bind(_this2);
131
+ });
132
+ }
133
+ }, {
134
+ key: "_unbindStartEvent",
135
+ value: function _unbindStartEvent() {
136
+ this._handlerDom.removeEventListener(this._startKey, this["on".concat(this._startKey)]);
137
+ }
138
+ }, {
139
+ key: "_bindPostStartEvents",
140
+ value: function _bindPostStartEvents(event) {
141
+ var _this3 = this;
142
+ if (!event) {
143
+ return;
144
+ }
145
+ var events = POST_START_EVENTS[this._startKey];
146
+ events.map(function(eventName) {
147
+ window.addEventListener(eventName, _this3["on".concat(eventName)]);
148
+ });
149
+ this._boundPointerEvents = events;
150
+ }
151
+ }, {
152
+ key: "_unbindPostStartEvents",
153
+ value: function _unbindPostStartEvents() {
154
+ var _this4 = this;
155
+ if (!this._boundPointerEvents) {
156
+ return;
157
+ }
158
+ this._boundPointerEvents.map(function(eventName) {
159
+ window.removeEventListener(eventName, _this4["on".concat(eventName)]);
160
+ });
161
+ delete this._boundPointerEvents;
162
+ }
163
+ }, {
164
+ key: "enable",
165
+ value: function enable() {
166
+ this.isEnabled = true;
167
+ }
168
+ }, {
169
+ key: "disable",
170
+ value: function disable() {
171
+ this.isEnabled = false;
172
+ if (this.isDragging) {
173
+ this.onUp();
174
+ }
175
+ }
176
+ }, {
177
+ key: "onDocUp",
178
+ value: function onDocUp(e) {
179
+ this.onUp();
180
+ }
181
+ }, {
182
+ key: "animate",
183
+ value: function animate() {
184
+ var _this5 = this;
185
+ if (!this.isDragging) {
186
+ return;
187
+ }
188
+ this.positionDrag();
189
+ window.requestAnimationFrame(function() {
190
+ _this5.animate();
191
+ });
192
+ }
193
+ }, {
194
+ key: "positionDrag",
195
+ value: function positionDrag() {
196
+ var transform = "translate3d(".concat(this.dragPoint.x, "px, ").concat(this.dragPoint.y, "px, 0)");
197
+ this._root.style.transform = transform;
198
+ this._root.style.webKitTransform = transform;
199
+ }
200
+ }, {
201
+ key: "setLeftTop",
202
+ value: function setLeftTop() {
203
+ this._root.style.left = this.position.x + "px";
204
+ this._root.style.top = this.position.y + "px";
205
+ }
206
+ }, {
207
+ key: "onmousedown",
208
+ value: function onmousedown(e) {
209
+ this.dragStart(e, e);
210
+ }
211
+ }, {
212
+ key: "onmousemove",
213
+ value: function onmousemove(e) {
214
+ this.dragMove(e, e);
215
+ }
216
+ }, {
217
+ key: "onmouseup",
218
+ value: function onmouseup(e) {
219
+ this.dragEnd(e, e);
220
+ }
221
+ }, {
222
+ key: "ontouchstart",
223
+ value: function ontouchstart(e) {
224
+ var touch = e.changedTouches[0];
225
+ this.dragStart(e, touch);
226
+ this.touchIdentifier = touch.pointerId !== void 0 ? touch.pointerId : touch.identifier;
227
+ e.preventDefault();
228
+ }
229
+ }, {
230
+ key: "ontouchmove",
231
+ value: function ontouchmove(e) {
232
+ var touch = getTouch(e.changedTouches, this.touchIdentifier);
233
+ if (touch) {
234
+ this.dragMove(e, touch);
235
+ }
236
+ }
237
+ }, {
238
+ key: "ontouchend",
239
+ value: function ontouchend(e) {
240
+ var touch = getTouch(e.changedTouches, this.touchIdentifier);
241
+ if (touch) {
242
+ this.dragEnd(e, touch);
243
+ }
244
+ e.preventDefault();
245
+ }
246
+ }, {
247
+ key: "ontouchcancel",
248
+ value: function ontouchcancel(e) {
249
+ var touch = getTouch(e.changedTouches, this.touchIdentifier);
250
+ if (touch) {
251
+ this.dragCancel(e, touch);
252
+ }
253
+ }
254
+ }, {
255
+ key: "dragStart",
256
+ value: function dragStart(e, pointer) {
257
+ if (!this._root || this.isDown || !this.isEnabled) {
258
+ return;
259
+ }
260
+ this.downPoint = pointer;
261
+ this.dragPoint.x = 0;
262
+ this.dragPoint.y = 0;
263
+ this._getPosition();
264
+ var size = getSize(this._root);
265
+ this.startPos.x = this.position.x;
266
+ this.startPos.y = this.position.y;
267
+ this.startPos.maxY = window.innerHeight - size.height;
268
+ this.startPos.maxX = window.innerWidth - size.width;
269
+ this.setLeftTop();
270
+ this.isDown = true;
271
+ this._bindPostStartEvents(e);
272
+ }
273
+ }, {
274
+ key: "dragRealStart",
275
+ value: function dragRealStart(e, pointer) {
276
+ this.isDragging = true;
277
+ this.animate();
278
+ this.emit(EVENTS.START, this.startPos);
279
+ }
280
+ }, {
281
+ key: "dragEnd",
282
+ value: function dragEnd(e, pointer) {
283
+ if (!this._root) {
284
+ return;
285
+ }
286
+ this._unbindPostStartEvents();
287
+ if (this.isDragging) {
288
+ this._root.style.transform = "";
289
+ this.setLeftTop();
290
+ this.emit(EVENTS.ENDED);
291
+ }
292
+ this.presetInfo();
293
+ }
294
+ }, {
295
+ key: "_dragPointerMove",
296
+ value: function _dragPointerMove(e, pointer) {
297
+ var moveVector = {
298
+ x: pointer.pageX - this.downPoint.pageX,
299
+ y: pointer.pageY - this.downPoint.pageY
300
+ };
301
+ if (!this.isDragging && this.hasDragStarted(moveVector)) {
302
+ this.dragRealStart(e, pointer);
303
+ }
304
+ return moveVector;
305
+ }
306
+ }, {
307
+ key: "dragMove",
308
+ value: function dragMove(e, pointer) {
309
+ e = e || window.event;
310
+ if (!this.isDown) {
311
+ return;
312
+ }
313
+ var _this$startPos = this.startPos, x = _this$startPos.x, y = _this$startPos.y;
314
+ var moveVector = this._dragPointerMove(e, pointer);
315
+ var dragX = moveVector.x;
316
+ var dragY = moveVector.y;
317
+ dragX = this.checkContain("x", dragX, x);
318
+ dragY = this.checkContain("y", dragY, y);
319
+ this.position.x = x + dragX;
320
+ this.position.y = y + dragY;
321
+ this.dragPoint.x = dragX;
322
+ this.dragPoint.y = dragY;
323
+ this.emit(EVENTS.MOVE, this.position);
324
+ }
325
+ }, {
326
+ key: "dragCancel",
327
+ value: function dragCancel(e, pointer) {
328
+ this.dragEnd(e, pointer);
329
+ }
330
+ }, {
331
+ key: "presetInfo",
332
+ value: function presetInfo() {
333
+ this.isDragging = false;
334
+ this.startPos = {
335
+ x: 0,
336
+ y: 0
337
+ };
338
+ this.dragPoint = {
339
+ x: 0,
340
+ y: 0
341
+ };
342
+ this.isDown = false;
343
+ }
344
+ }, {
345
+ key: "destroy",
346
+ value: function destroy() {
347
+ this._unbindStartEvent();
348
+ this._unbindPostStartEvents();
349
+ if (this.isDragging) {
350
+ this.dragEnd();
351
+ }
352
+ this.removeAllListeners();
353
+ this._handlerDom = null;
354
+ }
355
+ }, {
356
+ key: "hasDragStarted",
357
+ value: function hasDragStarted(moveVector) {
358
+ return Math.abs(moveVector.x) > 3 || Math.abs(moveVector.y) > 3;
359
+ }
360
+ }, {
361
+ key: "checkContain",
362
+ value: function checkContain(axis, drag, grid) {
363
+ if (drag + grid < 0) {
364
+ return 0 - grid;
365
+ }
366
+ if (axis === "x" && drag + grid > this.startPos.maxX) {
367
+ return this.startPos.maxX - grid;
368
+ }
369
+ if (axis === "y" && drag + grid > this.startPos.maxY) {
370
+ return this.startPos.maxY - grid;
371
+ }
372
+ return drag;
373
+ }
374
+ }, {
375
+ key: "_getPosition",
376
+ value: function _getPosition() {
377
+ var style = window.getComputedStyle(this._root);
378
+ var x = this._getPositionCoord(style.left, "width");
379
+ var y = this._getPositionCoord(style.top, "height");
380
+ this.position.x = Number.isNaN(x) ? 0 : x;
381
+ this.position.y = Number.isNaN(y) ? 0 : y;
382
+ this._addTransformPosition(style);
383
+ }
384
+ }, {
385
+ key: "_addTransformPosition",
386
+ value: function _addTransformPosition(style) {
387
+ var transform = style.transform;
388
+ if (transform.indexOf("matrix") !== 0) {
389
+ return;
390
+ }
391
+ var matrixValues = transform.split(",");
392
+ var xIndex = transform.indexOf("matrix3d") === 0 ? 12 : 4;
393
+ var translateX = parseInt(matrixValues[xIndex], 10);
394
+ var translateY = parseInt(matrixValues[xIndex + 1], 10);
395
+ this.position.x += translateX;
396
+ this.position.y += translateY;
397
+ }
398
+ }, {
399
+ key: "_getPositionCoord",
400
+ value: function _getPositionCoord(styleSide, measure) {
401
+ if (styleSide.indexOf("%") !== -1) {
402
+ var parentSize = getSize(this._root.parentNode);
403
+ return !parentSize ? 0 : parseFloat(styleSide) / 100 * parentSize[measure];
404
+ }
405
+ return parseInt(styleSide, 10);
406
+ }
407
+ }]);
408
+ return Draggabilly2;
409
+ }(EventEmitter);
410
+ export { Draggabilly as default };
@@ -0,0 +1,28 @@
1
+ export default sniffer;
2
+ export type ICheckResult = {
3
+ isSupport: boolean;
4
+ mime: string;
5
+ };
6
+ export type ISniffer = {
7
+ device: 'pc' | 'mobile';
8
+ browser: 'ie' | 'firefox' | 'chrome' | 'opera' | 'safari';
9
+ os: {
10
+ isTablet: boolean;
11
+ isPhone: boolean;
12
+ isIpad: boolean;
13
+ isIos: boolean;
14
+ isAndroid: boolean;
15
+ isPc: boolean;
16
+ isSymbian: boolean;
17
+ isWindowsPhone: boolean;
18
+ isFireFox: boolean;
19
+ };
20
+ isWeixin: boolean;
21
+ isSupportMP4(): ICheckResult;
22
+ isHevcSupported(): boolean;
23
+ probeConfigSupported(info: MediaDecodingConfiguration): Promise<MediaCapabilitiesDecodingInfo>;
24
+ };
25
+ /**
26
+ * @type ISniffer
27
+ */
28
+ declare const sniffer: ISniffer;