@waveform-playlist/browser 15.3.3 → 15.3.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 +17 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -0
- package/dist/index.mjs.map +1 -1
- package/dist/tone.js.map +1 -1
- package/dist/tone.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -1968,6 +1968,7 @@ var WaveformPlaylistProvider = ({
|
|
|
1968
1968
|
const playbackStartTimeRef = (0, import_react17.useRef)(0);
|
|
1969
1969
|
const audioStartPositionRef = (0, import_react17.useRef)(0);
|
|
1970
1970
|
const playbackEndTimeRef = (0, import_react17.useRef)(null);
|
|
1971
|
+
const suppressEngineStopMirrorRef = (0, import_react17.useRef)(false);
|
|
1971
1972
|
const scrollContainerRef = (0, import_react17.useRef)(null);
|
|
1972
1973
|
const isAutomaticScrollRef = (0, import_react17.useRef)(false);
|
|
1973
1974
|
const frameCallbacksRef = (0, import_react17.useRef)(/* @__PURE__ */ new Map());
|
|
@@ -2176,7 +2177,9 @@ var WaveformPlaylistProvider = ({
|
|
|
2176
2177
|
const wasPlaying = isPlayingRef.current;
|
|
2177
2178
|
const resumePosition = currentTimeRef.current;
|
|
2178
2179
|
if (engineRef.current && wasPlaying) {
|
|
2180
|
+
suppressEngineStopMirrorRef.current = true;
|
|
2179
2181
|
engineRef.current.stop();
|
|
2182
|
+
suppressEngineStopMirrorRef.current = false;
|
|
2180
2183
|
stopAnimationFrameLoop();
|
|
2181
2184
|
pendingResumeRef.current = { position: resumePosition };
|
|
2182
2185
|
}
|
|
@@ -2276,6 +2279,14 @@ var WaveformPlaylistProvider = ({
|
|
|
2276
2279
|
}
|
|
2277
2280
|
}
|
|
2278
2281
|
});
|
|
2282
|
+
engine.on("stop", () => {
|
|
2283
|
+
if (suppressEngineStopMirrorRef.current) return;
|
|
2284
|
+
setIsPlaying(false);
|
|
2285
|
+
stopAnimationFrameLoop();
|
|
2286
|
+
const stoppedAt = engine.getCurrentTime();
|
|
2287
|
+
setCurrentTimeRefs(stoppedAt);
|
|
2288
|
+
setCurrentTime(stoppedAt);
|
|
2289
|
+
});
|
|
2279
2290
|
engine.setTracks(tracksWithState);
|
|
2280
2291
|
suppressTracksMirroring = false;
|
|
2281
2292
|
lastTracksVersionRef.current = engine.getState().tracksVersion;
|
|
@@ -2573,7 +2584,9 @@ var WaveformPlaylistProvider = ({
|
|
|
2573
2584
|
if (isPlaying && animationFrameRef.current && engineRef.current) {
|
|
2574
2585
|
if (continuousPlay) {
|
|
2575
2586
|
const currentPos = currentTimeRef.current;
|
|
2587
|
+
suppressEngineStopMirrorRef.current = true;
|
|
2576
2588
|
engineRef.current.stop();
|
|
2589
|
+
suppressEngineStopMirrorRef.current = false;
|
|
2577
2590
|
stopAnimationLoop();
|
|
2578
2591
|
const timeNow = getAudioContextTime();
|
|
2579
2592
|
playbackStartTimeRef.current = timeNow;
|
|
@@ -2628,7 +2641,9 @@ var WaveformPlaylistProvider = ({
|
|
|
2628
2641
|
const actualStartTime = startTime != null ? startTime : currentTimeRef.current;
|
|
2629
2642
|
playStartPositionRef.current = actualStartTime;
|
|
2630
2643
|
setCurrentTimeRefs(actualStartTime);
|
|
2644
|
+
suppressEngineStopMirrorRef.current = true;
|
|
2631
2645
|
engineRef.current.stop();
|
|
2646
|
+
suppressEngineStopMirrorRef.current = false;
|
|
2632
2647
|
engineRef.current.seek(actualStartTime);
|
|
2633
2648
|
stopAnimationLoop();
|
|
2634
2649
|
const startTimeNow = getAudioContextTime();
|
|
@@ -2743,7 +2758,9 @@ var WaveformPlaylistProvider = ({
|
|
|
2743
2758
|
setCurrentTimeRefs(start);
|
|
2744
2759
|
setCurrentTime(start);
|
|
2745
2760
|
if (isPlaying && engineRef.current) {
|
|
2761
|
+
suppressEngineStopMirrorRef.current = true;
|
|
2746
2762
|
engineRef.current.stop();
|
|
2763
|
+
suppressEngineStopMirrorRef.current = false;
|
|
2747
2764
|
engineRef.current.seek(start);
|
|
2748
2765
|
engineRef.current.play(start);
|
|
2749
2766
|
}
|