gapless 4.0.7 → 4.0.8

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/package.json +1 -1
  2. package/src/Track.ts +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gapless",
3
- "version": "4.0.7",
3
+ "version": "4.0.8",
4
4
  "description": "Gapless audio playback javascript plugin",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
package/src/Track.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // ---------------------------------------------------------------------------
4
4
 
5
5
  import { createActor, fromPromise } from 'xstate';
6
- import { getAudioContext } from './utils/audioContext';
6
+ import { getAudioContext, resumeAudioContext } from './utils/audioContext';
7
7
  import { createTrackMachine } from './machines/track.machine';
8
8
  import { fetchDecodeMachine } from './machines/fetchDecode.machine';
9
9
  import type { TrackContext } from './machines/track.machine';
@@ -228,7 +228,9 @@ export class Track {
228
228
  if (this._actor.getSnapshot().value === 'idle') {
229
229
  this._actor.send({ type: 'PRELOAD' });
230
230
  }
231
- if (this.audioBuffer || !this.ctx) return;
231
+ if (this.audioBuffer) return;
232
+ resumeAudioContext();
233
+ if (!this.ctx) return;
232
234
  this._actor.send({ type: 'START_FETCH' });
233
235
  }
234
236