@waveform-playlist/playout 12.5.3 → 12.5.4

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/index.mjs CHANGED
@@ -1853,9 +1853,11 @@ function createToneAdapter(options) {
1853
1853
  getGlobalContext();
1854
1854
  let _playoutGeneration = 1;
1855
1855
  let playout = new TonePlayout({ effects: options?.effects });
1856
+ let _onPlaybackEnded = null;
1856
1857
  playout.setOnPlaybackComplete(() => {
1857
1858
  if (_playoutGeneration === 1) {
1858
1859
  _isPlaying = false;
1860
+ _onPlaybackEnded?.();
1859
1861
  }
1860
1862
  });
1861
1863
  let _isPlaying = false;
@@ -1988,6 +1990,7 @@ function createToneAdapter(options) {
1988
1990
  playout.setOnPlaybackComplete(() => {
1989
1991
  if (generation === _playoutGeneration) {
1990
1992
  _isPlaying = false;
1993
+ _onPlaybackEnded?.();
1991
1994
  }
1992
1995
  });
1993
1996
  }
@@ -2147,6 +2150,9 @@ function createToneAdapter(options) {
2147
2150
  isPlaying() {
2148
2151
  return _isPlaying;
2149
2152
  },
2153
+ onPlaybackEnded(callback) {
2154
+ _onPlaybackEnded = callback;
2155
+ },
2150
2156
  setMasterVolume(volume) {
2151
2157
  playout?.setMasterGain(volume);
2152
2158
  },
@@ -2278,6 +2284,7 @@ function createToneAdapter(options) {
2278
2284
  }
2279
2285
  playout = null;
2280
2286
  _isPlaying = false;
2287
+ _onPlaybackEnded = null;
2281
2288
  _currentTracks.clear();
2282
2289
  _midiTrackBuild.clear();
2283
2290
  }