ranui 0.1.9 → 0.1.10-alpha.2

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 (193) hide show
  1. package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +12 -0
  2. package/dist/arrow-down-D4qr4m33.js +30 -0
  3. package/dist/button.js +7 -0
  4. package/dist/checkbox.js +7 -0
  5. package/dist/colorpicker.js +13 -0
  6. package/dist/{colz-746223ab.js → colz-CRDozfZA.js} +1 -5
  7. package/dist/content.js +6 -0
  8. package/dist/docx-CChZ5Ycr.js +3665 -0
  9. package/dist/global-DOOKQmNv.js +4 -0
  10. package/dist/icon.js +6 -0
  11. package/dist/iconShadowless.js +6 -0
  12. package/dist/image.js +4 -0
  13. package/dist/index-01Qfd9QI.js +207 -0
  14. package/dist/{index-2d16a084.js → index-B2yRe66F.js} +8 -10
  15. package/dist/{index-3cf72afd.js → index-B4bfIbdI.js} +9 -23
  16. package/dist/{index-458debf7.js → index-BF8tJ6rR.js} +7 -31
  17. package/dist/{index-7b8840f9.js → index-BHmWrPCW.js} +223 -1011
  18. package/dist/{index-e03d23e7.js → index-BpOERe9M.js} +1 -1
  19. package/dist/{index-e2e5d725.js → index-ByBbFhvo.js} +123 -323
  20. package/dist/index-C-p_Wpit.js +103 -0
  21. package/dist/{index-b7790662.js → index-C1x9Popy.js} +1 -1
  22. package/dist/index-C6wPL-2Y.js +298 -0
  23. package/dist/{index-1048a998.js → index-CFnsLnrb.js} +68 -19
  24. package/dist/{index-57492b9b.js → index-CSnBqUsQ.js} +48 -1
  25. package/dist/index-CWWI8SHO.js +206 -0
  26. package/dist/index-Cbp6LrE5.js +501 -0
  27. package/dist/index-CbyMC6Yz.js +59 -0
  28. package/dist/index-Cr9AYoGT.js +498 -0
  29. package/dist/index-DLB8VOy7.js +281 -0
  30. package/dist/index-DRWOSfdF.js +521 -0
  31. package/dist/{index-4443363f.js → index-DRi1ylHx.js} +29 -50
  32. package/dist/index-Dapt713u.js +65624 -0
  33. package/dist/{index-7216d6b0.js → index-DqtzBqPN.js} +11 -29
  34. package/dist/{index-1b73beee.js → index-DsIUhdNt.js} +55 -90
  35. package/dist/{index-01b17e26.js → index-Du-Biu-I.js} +1 -1
  36. package/dist/{index-0d5b9435.js → index-DytfjwBV.js} +2 -2
  37. package/dist/index.js +25 -19
  38. package/dist/info-circle-fill-CFeVMdci.js +4 -0
  39. package/dist/input.js +6 -0
  40. package/dist/inputShadowless.js +6 -0
  41. package/dist/jszip.min-DD9Dc6z4.js +2674 -0
  42. package/dist/loading.js +6 -0
  43. package/dist/message.js +5 -0
  44. package/dist/modal.js +4 -0
  45. package/dist/{components/option/index.js → option.js} +3 -6
  46. package/dist/{pdf-bdb7818a.js → pdf-DpNqCylD.js} +12 -4
  47. package/dist/player.js +8 -0
  48. package/dist/popover.js +6 -0
  49. package/dist/preview.js +7 -0
  50. package/dist/progress.js +7 -0
  51. package/dist/radar.js +6 -0
  52. package/dist/select.js +10 -0
  53. package/dist/selectShadowless.js +10 -0
  54. package/dist/shadowless/shadowless/index.js +14 -0
  55. package/dist/skeleton.js +4 -0
  56. package/dist/sprite-CH2zLtZy.js +141 -0
  57. package/dist/style.css +1 -1
  58. package/dist/tab.js +6 -0
  59. package/dist/tabpane.js +4 -0
  60. package/dist/tsconfig.json +29 -0
  61. package/dist/umd/index.umd.cjs +21 -32
  62. package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
  63. package/dist/umd/shadowless/style.css +1 -0
  64. package/dist/umd/style.css +1 -1
  65. package/dist/utils-74Icp-PI.js +541 -0
  66. package/package.json +54 -24
  67. package/readme.md +18 -14
  68. package/typings.d.ts +101 -0
  69. package/dist/build/config.d.ts +0 -3
  70. package/dist/build/config.es.d.ts +0 -2
  71. package/dist/build/config.umd.d.ts +0 -2
  72. package/dist/components/button/index.d.ts +0 -35
  73. package/dist/components/button/index.js +0 -8
  74. package/dist/components/form/index.d.ts +0 -2
  75. package/dist/components/icon/index.d.ts +0 -2
  76. package/dist/components/icon/index.js +0 -6
  77. package/dist/components/image/index.d.ts +0 -2
  78. package/dist/components/image/index.js +0 -4
  79. package/dist/components/input/index.d.ts +0 -185
  80. package/dist/components/input/index.js +0 -6
  81. package/dist/components/message/index.d.ts +0 -14
  82. package/dist/components/message/index.js +0 -4
  83. package/dist/components/modal/index.d.ts +0 -2
  84. package/dist/components/modal/index.js +0 -4
  85. package/dist/components/option/index.d.ts +0 -2
  86. package/dist/components/player/index.d.ts +0 -213
  87. package/dist/components/player/index.js +0 -12
  88. package/dist/components/preview/colz.d.ts +0 -72
  89. package/dist/components/preview/docx.d.ts +0 -8
  90. package/dist/components/preview/excel/excel.d.ts +0 -2
  91. package/dist/components/preview/excel/index.d.ts +0 -1
  92. package/dist/components/preview/excel/media.d.ts +0 -37
  93. package/dist/components/preview/index.d.ts +0 -6
  94. package/dist/components/preview/index.js +0 -8
  95. package/dist/components/preview/pdf.d.ts +0 -1
  96. package/dist/components/preview/pptx/index.d.ts +0 -16
  97. package/dist/components/preview/pptx/process_pptx.d.ts +0 -23
  98. package/dist/components/preview/pptx/t_xml.d.ts +0 -1
  99. package/dist/components/preview/pptx/worker.d.ts +0 -1
  100. package/dist/components/progress/index.d.ts +0 -36
  101. package/dist/components/progress/index.js +0 -8
  102. package/dist/components/radar/index.d.ts +0 -2
  103. package/dist/components/radar/index.js +0 -7
  104. package/dist/components/scratch/index.d.ts +0 -19
  105. package/dist/components/select/index.d.ts +0 -105
  106. package/dist/components/select/index.js +0 -11
  107. package/dist/components/skeleton/index.d.ts +0 -2
  108. package/dist/components/skeleton/index.js +0 -4
  109. package/dist/components/tab/index.d.ts +0 -408
  110. package/dist/components/tab/index.js +0 -7
  111. package/dist/components/tabpane/index.d.ts +0 -352
  112. package/dist/components/tabpane/index.js +0 -4
  113. package/dist/docx-c5d02d8c.js +0 -21
  114. package/dist/index-73ce455b.js +0 -264
  115. package/dist/index-7913ec46.js +0 -239
  116. package/dist/index-c14450a9.js +0 -662
  117. package/dist/index.d.ts +0 -14
  118. package/dist/info-circle-fill-90ec9aa9.js +0 -14
  119. package/dist/playwright.config.d.ts +0 -9
  120. package/dist/plugins/auto-import-file.d.ts +0 -0
  121. package/dist/plugins/load-style.d.ts +0 -6
  122. package/dist/plugins/load-svg.d.ts +0 -9
  123. package/dist/tests/button.spec.d.ts +0 -1
  124. package/dist/umd/build/config.d.ts +0 -3
  125. package/dist/umd/build/config.es.d.ts +0 -2
  126. package/dist/umd/build/config.umd.d.ts +0 -2
  127. package/dist/umd/components/button/index.d.ts +0 -35
  128. package/dist/umd/components/form/index.d.ts +0 -2
  129. package/dist/umd/components/icon/index.d.ts +0 -2
  130. package/dist/umd/components/image/index.d.ts +0 -2
  131. package/dist/umd/components/input/index.d.ts +0 -185
  132. package/dist/umd/components/message/index.d.ts +0 -14
  133. package/dist/umd/components/modal/index.d.ts +0 -2
  134. package/dist/umd/components/option/index.d.ts +0 -2
  135. package/dist/umd/components/player/index.d.ts +0 -213
  136. package/dist/umd/components/preview/colz.d.ts +0 -72
  137. package/dist/umd/components/preview/docx.d.ts +0 -8
  138. package/dist/umd/components/preview/excel/excel.d.ts +0 -2
  139. package/dist/umd/components/preview/excel/index.d.ts +0 -1
  140. package/dist/umd/components/preview/excel/media.d.ts +0 -37
  141. package/dist/umd/components/preview/index.d.ts +0 -6
  142. package/dist/umd/components/preview/pdf.d.ts +0 -1
  143. package/dist/umd/components/preview/pptx/index.d.ts +0 -16
  144. package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
  145. package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
  146. package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
  147. package/dist/umd/components/progress/index.d.ts +0 -36
  148. package/dist/umd/components/radar/index.d.ts +0 -2
  149. package/dist/umd/components/scratch/index.d.ts +0 -19
  150. package/dist/umd/components/select/index.d.ts +0 -105
  151. package/dist/umd/components/skeleton/index.d.ts +0 -2
  152. package/dist/umd/components/tab/index.d.ts +0 -408
  153. package/dist/umd/components/tabpane/index.d.ts +0 -352
  154. package/dist/umd/index.d.ts +0 -14
  155. package/dist/umd/playwright.config.d.ts +0 -9
  156. package/dist/umd/plugins/auto-import-file.d.ts +0 -0
  157. package/dist/umd/plugins/load-style.d.ts +0 -6
  158. package/dist/umd/plugins/load-svg.d.ts +0 -9
  159. package/dist/umd/tests/button.spec.d.ts +0 -1
  160. package/dist/umd/utils/image.d.ts +0 -32
  161. package/dist/umd/utils/index.d.ts +0 -64
  162. package/dist/umd/utils/math.d.ts +0 -26
  163. package/dist/umd/utils/tween.d.ts +0 -21
  164. package/dist/umd/vite.config.d.ts +0 -6
  165. package/dist/utils/image.d.ts +0 -32
  166. package/dist/utils/index.d.ts +0 -64
  167. package/dist/utils/math.d.ts +0 -26
  168. package/dist/utils/tween.d.ts +0 -21
  169. package/dist/vendor-f71e6f68.js +0 -92126
  170. package/dist/vite.config.d.ts +0 -6
  171. /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
  172. /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
  173. /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
  174. /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
  175. /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
  176. /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
  177. /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
  178. /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
  179. /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
  180. /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
  181. /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
  182. /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
  183. /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
  184. /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
  185. /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
  186. /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
  187. /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
  188. /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
  189. /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
  190. /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
  191. /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
  192. /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
  193. /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
@@ -4,8 +4,9 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { c as createDocumentFragment, S as SyncHook, r as removeClassToElement, a as addClassToElement, d as timeFormat, e as range, b as generateThrottle } from "./index-7913ec46.js";
8
- import "./index-1b73beee.js";
7
+ import { b as createDocumentFragment, S as SyncHook, r as removeClassToElement, a as addClassToElement, t as timeFormat, e as range, d as generateThrottle } from "./utils-74Icp-PI.js";
8
+ import "./index-DsIUhdNt.js";
9
+ import { H as HTMLElementSSR } from "./index-CSnBqUsQ.js";
9
10
  !function t(e) {
10
11
  var r, i;
11
12
  r = this, i = function() {
@@ -123,7 +124,7 @@ import "./index-1b73beee.js";
123
124
  var r4 = Object.prototype.toString.call(t3).slice(8, -1);
124
125
  return "Object" === r4 && t3.constructor && (r4 = t3.constructor.name), "Map" === r4 || "Set" === r4 ? Array.from(t3) : "Arguments" === r4 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r4) ? g(t3, e3) : void 0;
125
126
  }
126
- }(t2)) || e2 && t2 && "number" == typeof t2.length) {
127
+ }(t2)) || e2) {
127
128
  r3 && (t2 = r3);
128
129
  var i3 = 0;
129
130
  return function() {
@@ -801,27 +802,18 @@ import "./index-1b73beee.js";
801
802
  if (16 !== t2.byteLength)
802
803
  throw new RangeError("Invalid system id");
803
804
  var i3, n2, a2;
804
- if (e2) {
805
- i3 = 1, n2 = new Uint8Array(16 * e2.length);
806
- for (var s2 = 0; s2 < e2.length; s2++) {
807
- var o2 = e2[s2];
808
- if (16 !== o2.byteLength)
809
- throw new RangeError("Invalid key");
810
- n2.set(o2, 16 * s2);
811
- }
812
- } else
813
- i3 = 0, n2 = new Uint8Array();
805
+ i3 = 0, n2 = new Uint8Array();
814
806
  i3 > 0 ? (a2 = new Uint8Array(4), e2.length > 0 && new DataView(a2.buffer).setUint32(0, e2.length, false)) : a2 = new Uint8Array();
815
807
  var l2 = new Uint8Array(4);
816
808
  return r3 && r3.byteLength > 0 && new DataView(l2.buffer).setUint32(0, r3.byteLength, false), function(t3) {
817
809
  for (var e3 = arguments.length, r4 = new Array(e3 > 1 ? e3 - 1 : 0), i4 = 1; i4 < e3; i4++)
818
810
  r4[i4 - 1] = arguments[i4];
819
- for (var n3 = r4.length, a3 = 8, s3 = n3; s3--; )
820
- a3 += r4[s3].byteLength;
821
- var o3 = new Uint8Array(a3);
822
- for (o3[0] = a3 >> 24 & 255, o3[1] = a3 >> 16 & 255, o3[2] = a3 >> 8 & 255, o3[3] = 255 & a3, o3.set(t3, 4), s3 = 0, a3 = 8; s3 < n3; s3++)
823
- o3.set(r4[s3], a3), a3 += r4[s3].byteLength;
824
- return o3;
811
+ for (var n3 = r4.length, a3 = 8, s2 = n3; s2--; )
812
+ a3 += r4[s2].byteLength;
813
+ var o2 = new Uint8Array(a3);
814
+ for (o2[0] = a3 >> 24 & 255, o2[1] = a3 >> 16 & 255, o2[2] = a3 >> 8 & 255, o2[3] = 255 & a3, o2.set(t3, 4), s2 = 0, a3 = 8; s2 < n3; s2++)
815
+ o2.set(r4[s2], a3), a3 += r4[s2].byteLength;
816
+ return o2;
825
817
  }([112, 115, 115, 104], new Uint8Array([i3, 0, 0, 0]), t2, a2, n2, l2, r3 || new Uint8Array());
826
818
  }
827
819
  var Bt = {}, Gt = function() {
@@ -4431,7 +4423,7 @@ import "./index-1b73beee.js";
4431
4423
  return i3 ? Math.round(n2) : n2;
4432
4424
  }
4433
4425
  function Bi(t2, e2) {
4434
- return void 0 === e2 && (e2 = false), Ui(t2, 1e3, 1 / 9e4, e2);
4426
+ return Ui(t2, 1e3, 1 / 9e4, e2);
4435
4427
  }
4436
4428
  Ni.types = void 0, Ni.HDLR_TYPES = void 0, Ni.STTS = void 0, Ni.STSC = void 0, Ni.STCO = void 0, Ni.STSZ = void 0, Ni.VMHD = void 0, Ni.SMHD = void 0, Ni.STSD = void 0, Ni.FTYP = void 0, Ni.DINF = void 0;
4437
4429
  var Gi = null, Ki = null, Hi = function() {
@@ -9312,18 +9304,18 @@ import "./index-1b73beee.js";
9312
9304
  return Xa.defaultConfig = void 0, Xa;
9313
9305
  }, "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (r = "undefined" != typeof globalThis ? globalThis : r || self).Hls = i();
9314
9306
  }(false);
9315
- const index$2 = "";
9316
9307
  const PLAY_STATE_LIST = ["play", "playing", "timeupdate"];
9317
9308
  const throttle = generateThrottle();
9318
9309
  const SPEED = [
9319
9310
  { label: "2.0X", value: 2 },
9320
9311
  { label: "1.5X", value: 1.5 },
9321
9312
  { label: "1.0X", value: 1 },
9313
+ { label: "0.8X", value: 0.8 },
9322
9314
  { label: "0.5X", value: 0.5 }
9323
9315
  ];
9324
- class RanPlayer extends HTMLElement {
9316
+ class RanPlayer extends HTMLElementSSR() {
9325
9317
  /**
9326
- * @description: 初始化view和video的全局上下文
9318
+ * @description: 初始化 view video 的全局上下文
9327
9319
  * @return {*}
9328
9320
  */
9329
9321
  constructor() {
@@ -9425,6 +9417,7 @@ class RanPlayer extends HTMLElement {
9425
9417
  }
9426
9418
  this.ctx.url = url;
9427
9419
  this.createClaritySelect();
9420
+ this.change("hlsManifestLoaded", { data });
9428
9421
  }
9429
9422
  });
9430
9423
  /**
@@ -9434,6 +9427,7 @@ class RanPlayer extends HTMLElement {
9434
9427
  __publicField(this, "updatePlayer", () => {
9435
9428
  var _a;
9436
9429
  const { Hls } = window;
9430
+ this.innerHTML = "";
9437
9431
  if (!this.contains(this._player))
9438
9432
  this.appendChild(this._player);
9439
9433
  if (this._hls) {
@@ -9450,25 +9444,36 @@ class RanPlayer extends HTMLElement {
9450
9444
  this._video.setAttribute("controls", "false");
9451
9445
  this._video.controls = false;
9452
9446
  this._video.setAttribute("initial-time", "0.01");
9453
- if ((Hls == null ? void 0 : Hls.isSupported()) && this.src) {
9454
- this._hls = new Hls();
9455
- if (this._hls) {
9456
- this._hls.off(Hls.Events.MANIFEST_LOADED, this.manifestLoaded);
9457
- this._hls.on(Hls.Events.MANIFEST_LOADED, this.manifestLoaded);
9458
- this._hls.loadSource(this.src);
9459
- this._hls.attachMedia(this._video);
9460
- }
9461
- this._container.appendChild(this._video);
9462
- (_a = this._video.parentElement) == null ? void 0 : _a.setAttribute(
9463
- "class",
9464
- "ran-player-contain"
9465
- );
9447
+ try {
9448
+ if (this._video.canPlayType("application/vnd.apple.mpegurl") && this.src) {
9449
+ this._video.src = this.src;
9450
+ } else if ((Hls == null ? void 0 : Hls.isSupported()) && this.src) {
9451
+ this._hls = new Hls();
9452
+ if (this._hls) {
9453
+ this._hls.off(Hls.Events.MANIFEST_LOADED, this.manifestLoaded);
9454
+ this._hls.on(Hls.Events.MANIFEST_LOADED, this.manifestLoaded);
9455
+ this._hls.off(Hls.Events.ERROR, this.hlsError);
9456
+ this._hls.on(Hls.Events.ERROR, this.hlsError);
9457
+ this._hls.loadSource(this.src);
9458
+ this._hls.attachMedia(this._video);
9459
+ }
9460
+ this._container.appendChild(this._video);
9461
+ (_a = this._video.parentElement) == null ? void 0 : _a.setAttribute("class", "ran-player-contain");
9462
+ }
9463
+ this.listenEvent();
9464
+ } catch (error) {
9465
+ }
9466
+ });
9467
+ __publicField(this, "hlsError", (event, data) => {
9468
+ this.change("hlsError", { event, data });
9469
+ if (this._video) {
9470
+ this._video.src = this.src;
9466
9471
  }
9467
- this.listenEvent();
9468
9472
  });
9469
9473
  __publicField(this, "change", (name, value) => {
9470
9474
  const currentTime = this.getCurrentTime();
9471
9475
  const duration = this.getTotalTime();
9476
+ this.debug && console.log(name, value);
9472
9477
  this.dispatchEvent(
9473
9478
  new CustomEvent("change", {
9474
9479
  detail: {
@@ -9483,14 +9488,8 @@ class RanPlayer extends HTMLElement {
9483
9488
  });
9484
9489
  __publicField(this, "onCanplay", (e) => {
9485
9490
  this.ctx.currentState = e.type;
9486
- removeClassToElement(
9487
- this._playerControllerBottomPlayBtn,
9488
- "ran-player-controller-bottom-left-btn-pause"
9489
- );
9490
- addClassToElement(
9491
- this._playerControllerBottomPlayBtn,
9492
- "ran-player-controller-bottom-left-btn-play"
9493
- );
9491
+ removeClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-pause");
9492
+ addClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-play");
9494
9493
  this.change("canplay", e);
9495
9494
  this.resize();
9496
9495
  });
@@ -9556,9 +9555,7 @@ class RanPlayer extends HTMLElement {
9556
9555
  this.ctx.duration = duration;
9557
9556
  this._playerControllerBottomTimeCurrent.innerText = "00:00";
9558
9557
  this._playerControllerBottomTimeDivide.innerText = "/";
9559
- this._playerControllerBottomTimeDuration.innerText = timeFormat(
9560
- this.ctx.duration
9561
- );
9558
+ this._playerControllerBottomTimeDuration.innerText = timeFormat(this.ctx.duration);
9562
9559
  this.change("loadeddata", e);
9563
9560
  });
9564
9561
  __publicField(this, "onTimeupdate", (e) => {
@@ -9576,28 +9573,16 @@ class RanPlayer extends HTMLElement {
9576
9573
  __publicField(this, "onPlay", (e) => {
9577
9574
  this.ctx.currentState = e.type;
9578
9575
  this.requestAnimationFrame(this.updateCurrentProgress);
9579
- removeClassToElement(
9580
- this._playerControllerBottomPlayBtn,
9581
- "ran-player-controller-bottom-left-btn-play"
9582
- );
9583
- addClassToElement(
9584
- this._playerControllerBottomPlayBtn,
9585
- "ran-player-controller-bottom-left-btn-pause"
9586
- );
9576
+ removeClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-play");
9577
+ addClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-pause");
9587
9578
  this.showControllerBar();
9588
9579
  this.change("play", e);
9589
9580
  });
9590
9581
  __publicField(this, "onPlaying", (e) => {
9591
9582
  this.ctx.currentState = e.type;
9592
9583
  this._playerBtn.style.setProperty("display", "none");
9593
- removeClassToElement(
9594
- this._playerControllerBottomPlayBtn,
9595
- "ran-player-controller-bottom-left-btn-play"
9596
- );
9597
- addClassToElement(
9598
- this._playerControllerBottomPlayBtn,
9599
- "ran-player-controller-bottom-left-btn-pause"
9600
- );
9584
+ removeClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-play");
9585
+ addClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-pause");
9601
9586
  this.requestAnimationFrame(this.updateCurrentProgress);
9602
9587
  this.showControllerBar();
9603
9588
  this.change("playing", e);
@@ -9606,14 +9591,8 @@ class RanPlayer extends HTMLElement {
9606
9591
  this.ctx.currentState = e.type;
9607
9592
  this._playerBtn.style.setProperty("display", "block");
9608
9593
  this.change("pause", e);
9609
- removeClassToElement(
9610
- this._playerControllerBottomPlayBtn,
9611
- "ran-player-controller-bottom-left-btn-pause"
9612
- );
9613
- addClassToElement(
9614
- this._playerControllerBottomPlayBtn,
9615
- "ran-player-controller-bottom-left-btn-play"
9616
- );
9594
+ removeClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-pause");
9595
+ addClassToElement(this._playerControllerBottomPlayBtn, "ran-player-controller-bottom-left-btn-play");
9617
9596
  this.cancelAnimationFrame();
9618
9597
  this._playerController.style.setProperty("opacity", "1");
9619
9598
  if (this.controllerBarTimeId) {
@@ -9625,23 +9604,14 @@ class RanPlayer extends HTMLElement {
9625
9604
  if (!this._video)
9626
9605
  return;
9627
9606
  this._video.removeEventListener("canplay", this.onCanplay);
9628
- this._video.removeEventListener(
9629
- "canplaythrough",
9630
- this.onCanplaythrough
9631
- );
9607
+ this._video.removeEventListener("canplaythrough", this.onCanplaythrough);
9632
9608
  this._video.removeEventListener("complete", this.onComplete);
9633
- this._video.removeEventListener(
9634
- "durationchange",
9635
- this.onDurationchange
9636
- );
9609
+ this._video.removeEventListener("durationchange", this.onDurationchange);
9637
9610
  this._video.removeEventListener("emptied", this.onEmptied);
9638
9611
  this._video.removeEventListener("ended", this.onEnded);
9639
9612
  this._video.removeEventListener("error", this.onError);
9640
9613
  this._video.removeEventListener("loadeddata", this.onLoadeddata);
9641
- this._video.removeEventListener(
9642
- "loadedmetadata",
9643
- this.onLoadedmetadata
9644
- );
9614
+ this._video.removeEventListener("loadedmetadata", this.onLoadedmetadata);
9645
9615
  this._video.removeEventListener("loadstart", this.onLoadstart);
9646
9616
  this._video.removeEventListener("pause", this.onPause);
9647
9617
  this._video.removeEventListener("play", this.onPlay);
@@ -9752,14 +9722,8 @@ class RanPlayer extends HTMLElement {
9752
9722
  const rect = this._progress.getBoundingClientRect();
9753
9723
  const offsetX = e.clientX - rect.left - 9;
9754
9724
  const percentage = range(offsetX / this._progress.offsetWidth);
9755
- this._progressWrapValue.style.setProperty(
9756
- "transform",
9757
- `scaleX(${percentage})`
9758
- );
9759
- this._progressDot.style.setProperty(
9760
- "transform",
9761
- `translateX(${percentage * this._progress.offsetWidth}px)`
9762
- );
9725
+ this._progressWrapValue.style.setProperty("transform", `scaleX(${percentage})`);
9726
+ this._progressDot.style.setProperty("transform", `translateX(${percentage * this._progress.offsetWidth}px)`);
9763
9727
  this.moveProgress.percentage = Math.floor(percentage * 100) / 100;
9764
9728
  });
9765
9729
  /**
@@ -9811,10 +9775,7 @@ class RanPlayer extends HTMLElement {
9811
9775
  const currentTime = this.getCurrentTime();
9812
9776
  this.ctx.currentTime = currentTime;
9813
9777
  const { duration } = this.ctx;
9814
- this._progressWrapValue.style.setProperty(
9815
- "transform",
9816
- `scaleX(${currentTime / duration})`
9817
- );
9778
+ this._progressWrapValue.style.setProperty("transform", `scaleX(${currentTime / duration})`);
9818
9779
  this._progressDot.style.setProperty(
9819
9780
  "transform",
9820
9781
  `translateX(${currentTime / duration * this._progress.offsetWidth}px)`
@@ -9871,7 +9832,7 @@ class RanPlayer extends HTMLElement {
9871
9832
  }
9872
9833
  });
9873
9834
  /**
9874
- * @description: 点击player-btn,触发的事件
9835
+ * @description: 点击 player-btn,触发的事件
9875
9836
  * @param {*} void
9876
9837
  * @return {*}
9877
9838
  */
@@ -9925,24 +9886,14 @@ class RanPlayer extends HTMLElement {
9925
9886
  const rect = this._progress.getBoundingClientRect();
9926
9887
  const offsetX = e.clientX - rect.left;
9927
9888
  if (this._playerTipText.innerText) {
9928
- this._playerTip.style.setProperty(
9929
- "transform",
9930
- `translate(calc(${offsetX}px - 50%),-20px)`
9931
- );
9889
+ this._playerTip.style.setProperty("transform", `translate(calc(${offsetX}px - 50%),-20px)`);
9932
9890
  } else {
9933
- this._playerTip.style.setProperty(
9934
- "transform",
9935
- `translateX(calc(${offsetX}px - 50%))`
9936
- );
9891
+ this._playerTip.style.setProperty("transform", `translateX(calc(${offsetX}px - 50%))`);
9937
9892
  }
9938
- this._playerTipTime.innerText = timeFormat(
9939
- offsetX / this._progress.clientWidth * this.ctx.duration
9940
- );
9893
+ this._playerTipTime.innerText = timeFormat(offsetX / this._progress.clientWidth * this.ctx.duration);
9941
9894
  });
9942
9895
  __publicField(this, "progressMouseLeave", (e) => {
9943
- if (e.target.classList.contains(
9944
- "ran-player-controller-progress-wrap-dot"
9945
- )) {
9896
+ if (e.target.classList.contains("ran-player-controller-progress-wrap-dot")) {
9946
9897
  return;
9947
9898
  }
9948
9899
  this._playerTip.style.setProperty("opacity", "0");
@@ -9952,29 +9903,18 @@ class RanPlayer extends HTMLElement {
9952
9903
  this._playerTip.style.setProperty("opacity", "1");
9953
9904
  const offsetX = e.clientX - rect.left;
9954
9905
  if (this._playerTipText.innerText) {
9955
- this._playerTip.style.setProperty(
9956
- "transform",
9957
- `translate(calc(${offsetX}px - 50%),-20px)`
9958
- );
9906
+ this._playerTip.style.setProperty("transform", `translate(calc(${offsetX}px - 50%),-20px)`);
9959
9907
  } else {
9960
- this._playerTip.style.setProperty(
9961
- "transform",
9962
- `translateX(calc(${offsetX}px - 50%))`
9963
- );
9908
+ this._playerTip.style.setProperty("transform", `translateX(calc(${offsetX}px - 50%))`);
9964
9909
  }
9965
- this._playerTipTime.innerText = timeFormat(
9966
- offsetX / this._progress.clientWidth * this.ctx.duration
9967
- );
9910
+ this._playerTipTime.innerText = timeFormat(offsetX / this._progress.clientWidth * this.ctx.duration);
9968
9911
  });
9969
9912
  __publicField(this, "changePlayerVolume", () => {
9970
9913
  if (!this._video)
9971
9914
  return;
9972
9915
  const { volume } = this.ctx;
9973
9916
  if (volume > 0) {
9974
- addClassToElement(
9975
- this._playControllerBottomSpeedIcon,
9976
- "ran-player-controller-bottom-right-volume-icon-mute"
9977
- );
9917
+ addClassToElement(this._playControllerBottomSpeedIcon, "ran-player-controller-bottom-right-volume-icon-mute");
9978
9918
  removeClassToElement(
9979
9919
  this._playControllerBottomSpeedIcon,
9980
9920
  "ran-player-controller-bottom-right-volume-icon-volume"
@@ -9983,18 +9923,9 @@ class RanPlayer extends HTMLElement {
9983
9923
  this.setVolume(0);
9984
9924
  this.change("volume", 0);
9985
9925
  } else {
9986
- addClassToElement(
9987
- this._playControllerBottomSpeedIcon,
9988
- "ran-player-controller-bottom-right-volume-icon-volume"
9989
- );
9990
- removeClassToElement(
9991
- this._playControllerBottomSpeedIcon,
9992
- "ran-player-controller-bottom-right-volume-icon-mute"
9993
- );
9994
- this._playControllerBottomVolumeProgress.setAttribute(
9995
- "percent",
9996
- `${this._volume || 0.5}`
9997
- );
9926
+ addClassToElement(this._playControllerBottomSpeedIcon, "ran-player-controller-bottom-right-volume-icon-volume");
9927
+ removeClassToElement(this._playControllerBottomSpeedIcon, "ran-player-controller-bottom-right-volume-icon-mute");
9928
+ this._playControllerBottomVolumeProgress.setAttribute("percent", `${this._volume || 0.5}`);
9998
9929
  this.setVolume(0.5);
9999
9930
  this.change("volume", this._volume || 0.5);
10000
9931
  }
@@ -10005,15 +9936,9 @@ class RanPlayer extends HTMLElement {
10005
9936
  this._video.style.setProperty("width", `${width}px`);
10006
9937
  this._video.style.setProperty("height", `${height}px`);
10007
9938
  if (document.body.clientWidth < 500) {
10008
- this._playControllerBottomVolume.style.setProperty(
10009
- "display",
10010
- "none"
10011
- );
9939
+ this._playControllerBottomVolume.style.setProperty("display", "none");
10012
9940
  } else {
10013
- this._playControllerBottomVolume.style.setProperty(
10014
- "display",
10015
- "flex"
10016
- );
9941
+ this._playControllerBottomVolume.style.setProperty("display", "flex");
10017
9942
  }
10018
9943
  }
10019
9944
  this.updateCurrentProgress();
@@ -10087,6 +10012,7 @@ class RanPlayer extends HTMLElement {
10087
10012
  this._video.pause();
10088
10013
  }
10089
10014
  });
10015
+ this.innerHTML = "";
10090
10016
  this._player = document.createElement("div");
10091
10017
  this._container = document.createElement("div");
10092
10018
  this._slot = document.createElement("slot");
@@ -10099,82 +10025,34 @@ class RanPlayer extends HTMLElement {
10099
10025
  this._playerControllerBottomRight = document.createElement("div");
10100
10026
  this._playerControllerBottomLeft = document.createElement("div");
10101
10027
  this._player.setAttribute("class", "ran-player");
10102
- this._player.setAttribute(
10103
- "id",
10104
- "ran-player" + `${performance.now()}`.replace(".", "")
10105
- );
10028
+ this._player.setAttribute("id", "ran-player" + `${performance.now()}`.replace(".", ""));
10106
10029
  this._playerBtn.setAttribute("class", "ran-player-play-btn");
10107
10030
  this._progress.setAttribute("class", "ran-player-controller-progress");
10108
- this._progressWrap.setAttribute(
10109
- "class",
10110
- "ran-player-controller-progress-wrap"
10111
- );
10112
- this._progressWrapValue.setAttribute(
10113
- "class",
10114
- "ran-player-controller-progress-wrap-value"
10115
- );
10116
- this._progressDot.setAttribute(
10117
- "class",
10118
- "ran-player-controller-progress-dot"
10119
- );
10120
- this._playerControllerBottom.setAttribute(
10121
- "class",
10122
- "ran-player-controller-bottom"
10123
- );
10124
- this._playerControllerBottomRight.setAttribute(
10125
- "class",
10126
- "ran-player-controller-bottom-right"
10127
- );
10128
- this._playerControllerBottomLeft.setAttribute(
10129
- "class",
10130
- "ran-player-controller-bottom-left"
10131
- );
10031
+ this._progressWrap.setAttribute("class", "ran-player-controller-progress-wrap");
10032
+ this._progressWrapValue.setAttribute("class", "ran-player-controller-progress-wrap-value");
10033
+ this._progressDot.setAttribute("class", "ran-player-controller-progress-dot");
10034
+ this._playerControllerBottom.setAttribute("class", "ran-player-controller-bottom");
10035
+ this._playerControllerBottomRight.setAttribute("class", "ran-player-controller-bottom-right");
10036
+ this._playerControllerBottomLeft.setAttribute("class", "ran-player-controller-bottom-left");
10132
10037
  this._playerControllerBottomPlayBtn = document.createElement("div");
10133
- this._playerControllerBottomPlayBtn.setAttribute(
10134
- "class",
10135
- "ran-player-controller-bottom-left-btn"
10136
- );
10038
+ this._playerControllerBottomPlayBtn.setAttribute("class", "ran-player-controller-bottom-left-btn");
10137
10039
  this._playerControllerBottomTimeCurrent = document.createElement("div");
10138
- this._playerControllerBottomTimeCurrent.setAttribute(
10139
- "class",
10140
- "ran-player-controller-bottom-left-time-current"
10141
- );
10040
+ this._playerControllerBottomTimeCurrent.setAttribute("class", "ran-player-controller-bottom-left-time-current");
10142
10041
  this._playerControllerBottomTimeDivide = document.createElement("div");
10143
- this._playerControllerBottomTimeDivide.setAttribute(
10144
- "class",
10145
- "ran-player-controller-bottom-left-time-divide"
10146
- );
10042
+ this._playerControllerBottomTimeDivide.setAttribute("class", "ran-player-controller-bottom-left-time-divide");
10147
10043
  this._playerControllerBottomTimeDuration = document.createElement("div");
10148
- this._playerControllerBottomTimeDuration.setAttribute(
10149
- "class",
10150
- "ran-player-controller-bottom-left-time-duration"
10151
- );
10044
+ this._playerControllerBottomTimeDuration.setAttribute("class", "ran-player-controller-bottom-left-time-duration");
10152
10045
  this._playControllerBottomSpeed = document.createElement("div");
10153
- this._playControllerBottomSpeed.setAttribute(
10154
- "class",
10155
- "ran-player-controller-bottom-right-speed"
10156
- );
10046
+ this._playControllerBottomSpeed.setAttribute("class", "ran-player-controller-bottom-right-speed");
10157
10047
  this._playControllerBottomSpeedPopover = document.createElement("r-select");
10158
10048
  this._playControllerBottomSpeedPopover.setAttribute("value", "1");
10159
- this._playControllerBottomSpeedPopover.setAttribute(
10160
- "action",
10161
- "hover,click"
10162
- );
10049
+ this._playControllerBottomSpeedPopover.setAttribute("action", "hover,click");
10163
10050
  this._playControllerBottomSpeedPopover.setAttribute("type", "text");
10164
10051
  this._playControllerBottomSpeedPopover.setAttribute("placement", "top");
10165
10052
  const id = this._player.getAttribute("id");
10166
- id && this._playControllerBottomSpeedPopover.setAttribute(
10167
- "getPopupContainerId",
10168
- id
10169
- );
10170
- this._playControllerBottomSpeedPopover.setAttribute(
10171
- "dropdownclass",
10172
- "video-speed-dropdown"
10173
- );
10174
- this._playControllerBottomSpeedPopover.addEventListener(
10175
- "change",
10176
- this.changeSpeed
10177
- );
10053
+ id && this._playControllerBottomSpeedPopover.setAttribute("getPopupContainerId", id);
10054
+ this._playControllerBottomSpeedPopover.setAttribute("dropdownclass", "video-speed-dropdown");
10055
+ this._playControllerBottomSpeedPopover.addEventListener("change", this.changeSpeed);
10178
10056
  const Fragment = document.createDocumentFragment();
10179
10057
  SPEED.forEach((item) => {
10180
10058
  const { label, value } = item;
@@ -10184,14 +10062,9 @@ class RanPlayer extends HTMLElement {
10184
10062
  Fragment.appendChild(option);
10185
10063
  });
10186
10064
  this._playControllerBottomSpeedPopover.appendChild(Fragment);
10187
- this._playControllerBottomSpeed.appendChild(
10188
- this._playControllerBottomSpeedPopover
10189
- );
10065
+ this._playControllerBottomSpeed.appendChild(this._playControllerBottomSpeedPopover);
10190
10066
  this._playControllerBottomVolume = document.createElement("div");
10191
- this._playControllerBottomVolume.setAttribute(
10192
- "class",
10193
- "ran-player-controller-bottom-right-volume"
10194
- );
10067
+ this._playControllerBottomVolume.setAttribute("class", "ran-player-controller-bottom-right-volume");
10195
10068
  this._playControllerBottomVolumeProgress = document.createElement("r-progress");
10196
10069
  this._playControllerBottomVolumeProgress.setAttribute(
10197
10070
  "class",
@@ -10205,56 +10078,28 @@ class RanPlayer extends HTMLElement {
10205
10078
  "ran-player-controller-bottom-right-volume-icon ran-player-controller-bottom-right-volume-icon-volume"
10206
10079
  );
10207
10080
  this._playControllerBottomClarity = document.createElement("div");
10208
- this._playControllerBottomClarity.setAttribute(
10209
- "class",
10210
- "ran-player-controller-bottom-right-clarity"
10211
- );
10081
+ this._playControllerBottomClarity.setAttribute("class", "ran-player-controller-bottom-right-clarity");
10212
10082
  this._playControllerBottomRightFullScreen = document.createElement("div");
10213
- this._playControllerBottomRightFullScreen.setAttribute(
10214
- "class",
10215
- "ran-player-controller-bottom-right-full"
10216
- );
10083
+ this._playControllerBottomRightFullScreen.setAttribute("class", "ran-player-controller-bottom-right-full");
10217
10084
  this._playerController = document.createElement("div");
10218
10085
  this._playerController.setAttribute("class", "ran-player-controller");
10219
10086
  this._playerTip = document.createElement("div");
10220
10087
  this._playerTip.setAttribute("class", "ran-player-controller-tip");
10221
10088
  this._playerTipTime = document.createElement("div");
10222
- this._playerTipTime.setAttribute(
10223
- "class",
10224
- "ran-player-controller-tip-time"
10225
- );
10089
+ this._playerTipTime.setAttribute("class", "ran-player-controller-tip-time");
10226
10090
  this._playerTipText = document.createElement("div");
10227
- this._playerTipText.setAttribute(
10228
- "class",
10229
- "ran-player-controller-tip-text"
10230
- );
10231
- this._playerTip.appendChild(
10232
- createDocumentFragment([this._playerTipTime, this._playerTipText])
10233
- );
10091
+ this._playerTipText.setAttribute("class", "ran-player-controller-tip-text");
10092
+ this._playerTip.appendChild(createDocumentFragment([this._playerTipTime, this._playerTipText]));
10234
10093
  this._playerController.appendChild(
10235
- createDocumentFragment([
10236
- this._playerTip,
10237
- this._progress,
10238
- this._playerControllerBottom
10239
- ])
10094
+ createDocumentFragment([this._playerTip, this._progress, this._playerControllerBottom])
10240
10095
  );
10241
10096
  this._player.appendChild(
10242
- createDocumentFragment([
10243
- this._container,
10244
- this._slot,
10245
- this._playerBtn,
10246
- this._playerController
10247
- ])
10097
+ createDocumentFragment([this._container, this._slot, this._playerBtn, this._playerController])
10248
10098
  );
10249
10099
  this._progressWrap.appendChild(this._progressWrapValue);
10250
- this._progress.appendChild(
10251
- createDocumentFragment([this._progressWrap, this._progressDot])
10252
- );
10100
+ this._progress.appendChild(createDocumentFragment([this._progressWrap, this._progressDot]));
10253
10101
  this._playerControllerBottom.appendChild(
10254
- createDocumentFragment([
10255
- this._playerControllerBottomLeft,
10256
- this._playerControllerBottomRight
10257
- ])
10102
+ createDocumentFragment([this._playerControllerBottomLeft, this._playerControllerBottomRight])
10258
10103
  );
10259
10104
  this._playerControllerBottomLeft.appendChild(
10260
10105
  createDocumentFragment([
@@ -10265,10 +10110,7 @@ class RanPlayer extends HTMLElement {
10265
10110
  ])
10266
10111
  );
10267
10112
  this._playControllerBottomVolume.appendChild(
10268
- createDocumentFragment([
10269
- this._playControllerBottomSpeedIcon,
10270
- this._playControllerBottomVolumeProgress
10271
- ])
10113
+ createDocumentFragment([this._playControllerBottomSpeedIcon, this._playControllerBottomVolumeProgress])
10272
10114
  );
10273
10115
  this._playerControllerBottomRight.appendChild(
10274
10116
  createDocumentFragment([
@@ -10308,7 +10150,7 @@ class RanPlayer extends HTMLElement {
10308
10150
  };
10309
10151
  }
10310
10152
  static get observedAttributes() {
10311
- return ["src", "volume", "currentTime", "playbackRate"];
10153
+ return ["src", "volume", "currentTime", "playbackRate", "debug"];
10312
10154
  }
10313
10155
  get src() {
10314
10156
  return this.getAttribute("src") || "";
@@ -10316,6 +10158,12 @@ class RanPlayer extends HTMLElement {
10316
10158
  set src(value) {
10317
10159
  this.setAttribute("src", value || "");
10318
10160
  }
10161
+ get debug() {
10162
+ return this.getAttribute("debug") || "";
10163
+ }
10164
+ set debug(value) {
10165
+ this.setAttribute("debug", value || "");
10166
+ }
10319
10167
  get volume() {
10320
10168
  return this.getAttribute("volume") || "";
10321
10169
  }
@@ -10335,87 +10183,39 @@ class RanPlayer extends HTMLElement {
10335
10183
  this.setAttribute("playbackRate", value || "");
10336
10184
  }
10337
10185
  connectedCallback() {
10338
- this._container.addEventListener(
10339
- "click",
10340
- this.dispatchClickPlayerContainerAction
10341
- );
10342
- this._playerBtn.addEventListener(
10343
- "click",
10344
- this.dispatchClickPlayerBtnAction
10345
- );
10186
+ this._container.addEventListener("click", this.dispatchClickPlayerContainerAction);
10187
+ this._playerBtn.addEventListener("click", this.dispatchClickPlayerBtnAction);
10346
10188
  this.addEventListener("keydown", this.SpaceKeyDown);
10347
- this._progressDot.addEventListener(
10348
- "mousedown",
10349
- this.progressDotMouseDown
10350
- );
10351
- this._playerControllerBottomPlayBtn.addEventListener(
10352
- "click",
10353
- this.dispatchClickPlayerBtnAction
10354
- );
10189
+ this._progressDot.addEventListener("mousedown", this.progressDotMouseDown);
10190
+ this._playerControllerBottomPlayBtn.addEventListener("click", this.dispatchClickPlayerBtnAction);
10355
10191
  this._progress.addEventListener("click", this.progressClick);
10356
10192
  this._progress.addEventListener("mouseenter", this.progressMouseEnter);
10357
10193
  this._progress.addEventListener("mousemove", this.progressMouseMove);
10358
10194
  this._progress.addEventListener("mouseleave", this.progressMouseLeave);
10359
10195
  this._player.addEventListener("mousemove", this.progressDotMouseMove);
10360
10196
  this._player.addEventListener("mouseup", this.progressDotMouseUp);
10361
- this._playControllerBottomVolumeProgress.addEventListener(
10362
- "change",
10363
- this.changeVolumeProgress
10364
- );
10365
- this._playControllerBottomRightFullScreen.addEventListener(
10366
- "click",
10367
- this.openFullScreen
10368
- );
10369
- this._playControllerBottomSpeedIcon.addEventListener(
10370
- "click",
10371
- this.changePlayerVolume
10372
- );
10197
+ this._playControllerBottomVolumeProgress.addEventListener("change", this.changeVolumeProgress);
10198
+ this._playControllerBottomRightFullScreen.addEventListener("click", this.openFullScreen);
10199
+ this._playControllerBottomSpeedIcon.addEventListener("click", this.changePlayerVolume);
10373
10200
  document.addEventListener("fullscreenchange", this.fullScreenChange);
10374
10201
  window.addEventListener("resize", this.resize);
10375
10202
  this.updatePlayer();
10376
10203
  }
10377
10204
  disconnectCallback() {
10378
- this._container.removeEventListener(
10379
- "click",
10380
- this.dispatchClickPlayerContainerAction
10381
- );
10382
- this._playerBtn.removeEventListener(
10383
- "click",
10384
- this.dispatchClickPlayerBtnAction
10385
- );
10386
- this._playerControllerBottomPlayBtn.removeEventListener(
10387
- "click",
10388
- this.dispatchClickPlayerBtnAction
10389
- );
10205
+ this._container.removeEventListener("click", this.dispatchClickPlayerContainerAction);
10206
+ this._playerBtn.removeEventListener("click", this.dispatchClickPlayerBtnAction);
10207
+ this._playerControllerBottomPlayBtn.removeEventListener("click", this.dispatchClickPlayerBtnAction);
10390
10208
  this.cancelAnimationFrame();
10391
10209
  this.removeEventListener("keydown", this.SpaceKeyDown);
10392
10210
  this._progress.removeEventListener("click", this.progressClick);
10393
- this._progress.removeEventListener(
10394
- "mouseenter",
10395
- this.progressMouseEnter
10396
- );
10211
+ this._progress.removeEventListener("mouseenter", this.progressMouseEnter);
10397
10212
  this._progress.removeEventListener("mousemove", this.progressMouseMove);
10398
- this._progress.removeEventListener(
10399
- "mouseleave",
10400
- this.progressMouseLeave
10401
- );
10402
- this._progressDot.removeEventListener(
10403
- "mousedown",
10404
- this.progressDotMouseDown
10405
- );
10406
- this._player.removeEventListener(
10407
- "mousemove",
10408
- this.progressDotMouseMove
10409
- );
10213
+ this._progress.removeEventListener("mouseleave", this.progressMouseLeave);
10214
+ this._progressDot.removeEventListener("mousedown", this.progressDotMouseDown);
10215
+ this._player.removeEventListener("mousemove", this.progressDotMouseMove);
10410
10216
  this._player.removeEventListener("mouseup", this.progressDotMouseUp);
10411
- this._playControllerBottomVolumeProgress.removeEventListener(
10412
- "change",
10413
- this.changeVolumeProgress
10414
- );
10415
- this._playControllerBottomRightFullScreen.removeEventListener(
10416
- "click",
10417
- this.openFullScreen
10418
- );
10217
+ this._playControllerBottomVolumeProgress.removeEventListener("change", this.changeVolumeProgress);
10218
+ this._playControllerBottomRightFullScreen.removeEventListener("click", this.openFullScreen);
10419
10219
  window.removeEventListener("resize", this.resize);
10420
10220
  document.removeEventListener("fullscreenchange", this.fullScreenChange);
10421
10221
  }