@revideo/player 0.2.1-alpha.892 → 0.2.1

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 (2) hide show
  1. package/dist/main.js +13 -13
  2. package/package.json +3 -3
package/dist/main.js CHANGED
@@ -56,9 +56,9 @@ class x extends HTMLElement {
56
56
  e(this, "stage", new M());
57
57
  e(this, "timeline");
58
58
  e(this, "handleTimelineChange", (t) => {
59
- var n, o;
59
+ var s, o;
60
60
  const a = t.target, i = parseFloat(a.value);
61
- ((n = this.player) == null ? void 0 : n.playback.duration) && ((o = this.player) == null || o.requestSeek(i));
61
+ ((s = this.player) == null ? void 0 : s.playback.duration) && ((o = this.player) == null || o.requestSeek(i));
62
62
  });
63
63
  e(this, "handleMouseMove", () => {
64
64
  this.mouseMoveId && clearTimeout(this.mouseMoveId), this.hover && !this.playing && this.setPlaying(!0), this.mouseMoveId = window.setTimeout(() => {
@@ -97,10 +97,10 @@ class x extends HTMLElement {
97
97
  this.player.playback.duration
98
98
  );
99
99
  if (i) {
100
- const s = this.player.status.secondsToFrames(a);
101
- this.timeline.value = s.toString();
102
- const n = `linear-gradient(to right, rgb(180, 180, 180) 0%, rgb(180, 180, 180) ${100 * s / this.player.status.secondsToFrames(i)}%, white ${100 * s / this.player.status.secondsToFrames(i)}%, white 100%)`;
103
- this.timeline.style.background = n, this.timeline.style.setProperty("--webkit-track", n), this.timeline.style.setProperty("--moz-track", n), this.timeline.style.setProperty("--ms-track", n);
100
+ const n = this.player.status.secondsToFrames(a);
101
+ this.timeline.value = n.toString();
102
+ const s = `linear-gradient(to right, rgb(180, 180, 180) 0%, rgb(180, 180, 180) ${100 * n / this.player.status.secondsToFrames(i)}%, white ${100 * n / this.player.status.secondsToFrames(i)}%, white 100%)`;
103
+ this.timeline.style.background = s, this.timeline.style.setProperty("--webkit-track", s), this.timeline.style.setProperty("--moz-track", s), this.timeline.style.setProperty("--ms-track", s);
104
104
  const o = this.formatTime(a), c = this.formatTime(i), l = this.root.querySelector(".current-time");
105
105
  l && (l.textContent = `${o} / ${c}`);
106
106
  }
@@ -151,11 +151,11 @@ class x extends HTMLElement {
151
151
  this.overlay.className = `overlay state-${this.state}`, this.canvas.className = `canvas state-${this.state}`, this.overlay.classList.toggle("playing", this.playing), this.overlay.classList.toggle("auto", this.auto), this.overlay.classList.toggle("hover", this.mouseMoveId !== null), this.connected && (this.mouseMoveId !== null || !this.playing ? this.dataset.overlay = "" : delete this.dataset.overlay);
152
152
  }
153
153
  async updateSource(t) {
154
- var s, n, o, c;
154
+ var n, s, o, c;
155
155
  this.setState(
156
156
  "initial"
157
157
  /* Initial */
158
- ), (s = this.abortController) == null || s.abort(), this.abortController = new AbortController();
158
+ ), (n = this.abortController) == null || n.abort(), this.abortController = new AbortController();
159
159
  let a;
160
160
  try {
161
161
  const l = import(
@@ -176,13 +176,13 @@ class x extends HTMLElement {
176
176
  }
177
177
  this.defaultSettings = a.meta.getFullRenderingSettings();
178
178
  const i = new m(a);
179
- i.setVariables(this.variables), this.finished = !1, (n = this.player) == null || n.onRender.unsubscribe(this.render), (o = this.player) == null || o.togglePlayback(!1), (c = this.player) == null || c.deactivate(), this.project = a, this.player = i, this.updateSettings(), this.player.onRender.subscribe(this.render), this.player.togglePlayback(this.playing), this.setState(
179
+ i.setVariables(this.variables), this.finished = !1, (s = this.player) == null || s.onRender.unsubscribe(this.render), (o = this.player) == null || o.togglePlayback(!1), (c = this.player) == null || c.deactivate(), this.project = a, this.player = i, this.updateSettings(), this.player.onRender.subscribe(this.render), this.player.togglePlayback(this.playing), this.setState(
180
180
  "ready"
181
181
  /* Ready */
182
182
  );
183
183
  }
184
184
  attributeChangedCallback(t, a, i) {
185
- var s;
185
+ var n, s;
186
186
  switch (t) {
187
187
  case "auto":
188
188
  this.setPlaying(this.playing);
@@ -196,7 +196,7 @@ class x extends HTMLElement {
196
196
  this.updateSettings();
197
197
  break;
198
198
  case "variables":
199
- (s = this.player) == null || s.setVariables(this.variables), this.player.requestSeek(this.player.playback.frame);
199
+ (n = this.player) == null || n.setVariables(this.variables), (s = this.player) == null || s.requestSeek(this.player.playback.frame);
200
200
  }
201
201
  }
202
202
  disconnectedCallback() {
@@ -216,8 +216,8 @@ class x extends HTMLElement {
216
216
  this.stage.configure(t), this.player.configure(t);
217
217
  }
218
218
  formatTime(t) {
219
- const a = Math.floor(t / 60), i = Math.floor(t % 60), s = a.toString().padStart(2, "0"), n = i.toString().padStart(2, "0");
220
- return `${s}:${n}`;
219
+ const a = Math.floor(t / 60), i = Math.floor(t % 60), n = a.toString().padStart(2, "0"), s = i.toString().padStart(2, "0");
220
+ return `${n}:${s}`;
221
221
  }
222
222
  }
223
223
  customElements.get(d) || customElements.define(d, x);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revideo/player",
3
- "version": "0.2.1-alpha.892+474c60e",
3
+ "version": "0.2.1",
4
4
  "description": "A custom element for displaying animations made with revideo",
5
5
  "main": "dist/main.js",
6
6
  "types": "types/main.d.ts",
@@ -22,9 +22,9 @@
22
22
  "types"
23
23
  ],
24
24
  "devDependencies": {
25
- "@revideo/core": "^0.2.0",
25
+ "@revideo/core": "^0.2.1",
26
26
  "sass": "^1.58.0",
27
27
  "terser": "^5.16.1"
28
28
  },
29
- "gitHead": "474c60ece59ba496cfe5e9053449b30fa03ba4c0"
29
+ "gitHead": "86f2aeca06c57979aedf2e41744913207877b55f"
30
30
  }