@revideo/player 0.2.1-alpha.892 → 0.2.1-alpha.893
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/main.js +13 -13
- package/package.json +2 -2
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
|
|
59
|
+
var s, o;
|
|
60
60
|
const a = t.target, i = parseFloat(a.value);
|
|
61
|
-
((
|
|
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
|
|
101
|
-
this.timeline.value =
|
|
102
|
-
const
|
|
103
|
-
this.timeline.style.background =
|
|
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
|
|
154
|
+
var n, s, o, c;
|
|
155
155
|
this.setState(
|
|
156
156
|
"initial"
|
|
157
157
|
/* Initial */
|
|
158
|
-
), (
|
|
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, (
|
|
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
|
-
(
|
|
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),
|
|
220
|
-
return `${
|
|
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.
|
|
3
|
+
"version": "0.2.1-alpha.893+f8b9891",
|
|
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",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"sass": "^1.58.0",
|
|
27
27
|
"terser": "^5.16.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f8b989153516e05ee39011bcd853fdf7fd6a2f35"
|
|
30
30
|
}
|