@xtia/timeline 1.1.10 → 1.1.11

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.
@@ -87,8 +87,11 @@ export class Timeline {
87
87
  this._progression = null;
88
88
  if (endAction == "loop")
89
89
  endAction = "restart";
90
- if (autoplay !== false) {
91
- this.play(typeof autoplay == "number" ? autoplay : default_fps);
90
+ if (autoplay === true) {
91
+ this.play();
92
+ }
93
+ else if (typeof autoplay == "number") {
94
+ this.play(autoplay);
92
95
  }
93
96
  if (typeof endAction == "object"
94
97
  && "restartAt" in endAction) {
@@ -334,9 +337,9 @@ export class Timeline {
334
337
  this.playWithInterval(arg ?? default_fps);
335
338
  }
336
339
  playWithInterval(fps) {
337
- let previousTime = Date.now();
340
+ let previousTime = performance.now();
338
341
  const interval = setInterval(() => {
339
- const newTime = Date.now();
342
+ const newTime = performance.now();
340
343
  const elapsed = newTime - previousTime;
341
344
  previousTime = newTime;
342
345
  let delta = elapsed * this.timeScale;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtia/timeline",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "repository": {
5
5
  "url": "https://github.com/tiadrop/timeline",
6
6
  "type": "github"