@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.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1870,9 +1870,11 @@ function createToneAdapter(options) {
|
|
|
1870
1870
|
getGlobalContext();
|
|
1871
1871
|
let _playoutGeneration = 1;
|
|
1872
1872
|
let playout = new TonePlayout({ effects: options?.effects });
|
|
1873
|
+
let _onPlaybackEnded = null;
|
|
1873
1874
|
playout.setOnPlaybackComplete(() => {
|
|
1874
1875
|
if (_playoutGeneration === 1) {
|
|
1875
1876
|
_isPlaying = false;
|
|
1877
|
+
_onPlaybackEnded?.();
|
|
1876
1878
|
}
|
|
1877
1879
|
});
|
|
1878
1880
|
let _isPlaying = false;
|
|
@@ -2005,6 +2007,7 @@ function createToneAdapter(options) {
|
|
|
2005
2007
|
playout.setOnPlaybackComplete(() => {
|
|
2006
2008
|
if (generation === _playoutGeneration) {
|
|
2007
2009
|
_isPlaying = false;
|
|
2010
|
+
_onPlaybackEnded?.();
|
|
2008
2011
|
}
|
|
2009
2012
|
});
|
|
2010
2013
|
}
|
|
@@ -2164,6 +2167,9 @@ function createToneAdapter(options) {
|
|
|
2164
2167
|
isPlaying() {
|
|
2165
2168
|
return _isPlaying;
|
|
2166
2169
|
},
|
|
2170
|
+
onPlaybackEnded(callback) {
|
|
2171
|
+
_onPlaybackEnded = callback;
|
|
2172
|
+
},
|
|
2167
2173
|
setMasterVolume(volume) {
|
|
2168
2174
|
playout?.setMasterGain(volume);
|
|
2169
2175
|
},
|
|
@@ -2295,6 +2301,7 @@ function createToneAdapter(options) {
|
|
|
2295
2301
|
}
|
|
2296
2302
|
playout = null;
|
|
2297
2303
|
_isPlaying = false;
|
|
2304
|
+
_onPlaybackEnded = null;
|
|
2298
2305
|
_currentTracks.clear();
|
|
2299
2306
|
_midiTrackBuild.clear();
|
|
2300
2307
|
}
|