@evercam/ui 0.0.23 → 0.0.24

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.
package/dist/index.mjs CHANGED
@@ -4417,9 +4417,9 @@ const J = new Intl.NumberFormat(void 0, {
4417
4417
  },
4418
4418
  initializePlayer() {
4419
4419
  const e = this.$refs.player;
4420
- e && e.muted && this.setMuted(!0), e && document.addEventListener("mouseup", (t) => {
4420
+ e && (e.muted && this.setMuted(!0), document.addEventListener("mouseup", (t) => {
4421
4421
  this.isScrubbing && this.toggleScrubbing(t);
4422
- }), document.addEventListener("keydown", this.handleKeyDown);
4422
+ }), document.addEventListener("keydown", this.handleKeyDown));
4423
4423
  },
4424
4424
  destroyPlayer() {
4425
4425
  window.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("mouseup", (e) => {
@@ -4469,10 +4469,10 @@ const J = new Intl.NumberFormat(void 0, {
4469
4469
  this.isLoading = !1;
4470
4470
  },
4471
4471
  play() {
4472
- if (this.$refs.player) {
4473
- const e = this.$refs.player;
4474
- e.play() !== void 0 && e.play().then(() => this.setPlaying(!0)).catch(console.error);
4475
- }
4472
+ const e = this.$refs.player;
4473
+ if (!e)
4474
+ return;
4475
+ e.play() !== void 0 && e.play().then(() => this.setPlaying(!0)).catch(console.error);
4476
4476
  },
4477
4477
  handleVolumeChange(e) {
4478
4478
  const t = this.$refs.player, r = e.target;
@@ -4482,7 +4482,8 @@ const J = new Intl.NumberFormat(void 0, {
4482
4482
  this.volume = e;
4483
4483
  },
4484
4484
  pause() {
4485
- this.$refs.player && (this.$refs.player.pause(), this.setPlaying(!1));
4485
+ const e = this.$refs.player;
4486
+ e && (e.pause(), this.setPlaying(!1));
4486
4487
  },
4487
4488
  togglePlay() {
4488
4489
  this.playing ? this.pause() : this.play();
@@ -4491,25 +4492,22 @@ const J = new Intl.NumberFormat(void 0, {
4491
4492
  this.playing = e;
4492
4493
  },
4493
4494
  seekToPercentage(e) {
4494
- if (this.$refs.player) {
4495
- const t = this.$refs.player, r = e / 100 * t.duration;
4496
- t.currentTime = r;
4497
- }
4495
+ const t = this.$refs.player;
4496
+ if (!t)
4497
+ return;
4498
+ const r = e / 100 * t.duration;
4499
+ t.currentTime = r;
4498
4500
  },
4499
4501
  convertTimeToDuration(e) {
4500
4502
  return [parseInt(e / 60 % 60, 10), parseInt(e % 60, 10)].join(":").replace(/\b(\d)\b/g, "0$1");
4501
4503
  },
4502
4504
  mute() {
4503
- if (this.$refs.player) {
4504
- const e = this.$refs.player;
4505
- e.muted = !0, this.setMuted(!0);
4506
- }
4505
+ const e = this.$refs.player;
4506
+ e && (e.muted = !0, this.setMuted(!0));
4507
4507
  },
4508
4508
  unmute() {
4509
- if (this.$refs.player) {
4510
- const e = this.$refs.player;
4511
- e.muted = !1, this.setMuted(!1);
4512
- }
4509
+ const e = this.$refs.player;
4510
+ e && (e.muted = !1, this.setMuted(!1));
4513
4511
  },
4514
4512
  toggleMute() {
4515
4513
  this.videoMuted ? this.unmute() : this.mute();
@@ -4537,14 +4535,14 @@ const J = new Intl.NumberFormat(void 0, {
4537
4535
  },
4538
4536
  handleTimeUpdate() {
4539
4537
  const e = this.$refs.player, t = this.$refs.timelineContainer;
4540
- if (e && t) {
4541
- this.currentTime = q(e.currentTime), this.realtime = e.currentTime;
4542
- const r = Number(this.realtime) / Number(this.videoDuration);
4543
- t.style.setProperty(
4544
- "--progress-position",
4545
- r.toString()
4546
- );
4547
- }
4538
+ if (!e || !t)
4539
+ return;
4540
+ this.currentTime = q(e.currentTime), this.realtime = e.currentTime;
4541
+ const r = Number(this.realtime) / Number(this.videoDuration);
4542
+ t.style.setProperty(
4543
+ "--progress-position",
4544
+ r.toString()
4545
+ );
4548
4546
  },
4549
4547
  handleTimelineUpdate(e) {
4550
4548
  const t = this.$refs.player;
@@ -4627,7 +4625,7 @@ var gt = function() {
4627
4625
  ht,
4628
4626
  !1,
4629
4627
  null,
4630
- "631af8ea",
4628
+ "e338fc91",
4631
4629
  null,
4632
4630
  null
4633
4631
  );