gapless 4.4.1 → 4.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gapless",
3
- "version": "4.4.1",
3
+ "version": "4.4.2",
4
4
  "description": "Gapless audio playback javascript plugin",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -27,22 +27,22 @@
27
27
  "author": "Daniel Saewitz",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@playwright/test": "^1.60.0",
30
+ "@playwright/test": "^1.63.0",
31
31
  "@switz/eslint-config": "^13.1.0",
32
- "@vitest/coverage-v8": "^4.1.8",
33
- "eslint": "^10.4.1",
34
- "happy-dom": "^20.10.2",
35
- "playwright": "^1.60.0",
32
+ "@vitest/coverage-v8": "^5.0.1",
33
+ "eslint": "^10.11.0",
34
+ "happy-dom": "^20.14.5",
35
+ "playwright": "^1.63.0",
36
36
  "tsup": "^8.5.1",
37
- "typescript": "^6.0.3",
38
- "vitest": "^4.1.8"
37
+ "typescript": "^7.0.2",
38
+ "vitest": "^5.0.1"
39
39
  },
40
40
  "dependencies": {
41
- "xstate": "^5.32.0"
41
+ "xstate": "^5.33.2"
42
42
  },
43
43
  "scripts": {
44
44
  "test": "vitest run",
45
- "build": "tsup",
45
+ "build": "tsup && tsc -p tsconfig.build.json",
46
46
  "build:demo": "pnpm --dir demo build",
47
47
  "dev": "pnpm --dir demo dev",
48
48
  "types": "tsc --noEmit",
package/src/Track.ts CHANGED
@@ -637,7 +637,11 @@ export class Track {
637
637
  private _crossoverHtml5ToWebAudio(wasPlaying: boolean): void {
638
638
  if (!this.ctx || !this.audioBuffer || !this.gainNode) return;
639
639
 
640
- const offset = this.audio.currentTime;
640
+ const htmlTime = this.audio.currentTime;
641
+ const offset =
642
+ isFinite(this.pausedAtTrackTime) && this.pausedAtTrackTime > htmlTime
643
+ ? this.pausedAtTrackTime
644
+ : htmlTime;
641
645
  this.pausedAtTrackTime = isFinite(offset) ? offset : 0;
642
646
 
643
647
  if (!wasPlaying) {