@waveform-playlist/browser 13.1.0 → 13.1.1
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.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -4122,12 +4122,7 @@ var WaveformPlaylistProvider = ({
|
|
|
4122
4122
|
return ((_b2 = audioStartPositionRef.current) != null ? _b2 : 0) + elapsed;
|
|
4123
4123
|
}, []);
|
|
4124
4124
|
const toVisualTime = useCallback19((rawTime) => {
|
|
4125
|
-
|
|
4126
|
-
const audioCtx = getGlobalAudioContext4();
|
|
4127
|
-
const latency = "outputLatency" in audioCtx ? audioCtx.outputLatency : 0;
|
|
4128
|
-
const lookAhead = (_b2 = (_a2 = engineRef.current) == null ? void 0 : _a2.lookAhead) != null ? _b2 : 0;
|
|
4129
|
-
const visual = rawTime - latency - lookAhead;
|
|
4130
|
-
return Number.isFinite(visual) ? Math.max(0, visual) : 0;
|
|
4125
|
+
return Number.isFinite(rawTime) ? Math.max(0, rawTime) : 0;
|
|
4131
4126
|
}, []);
|
|
4132
4127
|
const setCurrentTimeRefs = useCallback19(
|
|
4133
4128
|
(rawTime) => {
|
|
@@ -4147,14 +4142,10 @@ var WaveformPlaylistProvider = ({
|
|
|
4147
4142
|
frameCallbacksRef.current.delete(id);
|
|
4148
4143
|
}, []);
|
|
4149
4144
|
const startAnimationLoop = useCallback19(() => {
|
|
4150
|
-
const audioCtx = getGlobalAudioContext4();
|
|
4151
4145
|
const updateTime = () => {
|
|
4152
|
-
var _a2, _b2;
|
|
4153
4146
|
const time = getPlaybackTime();
|
|
4154
4147
|
currentTimeRef.current = time;
|
|
4155
|
-
const
|
|
4156
|
-
const lookAhead = (_b2 = (_a2 = engineRef.current) == null ? void 0 : _a2.lookAhead) != null ? _b2 : 0;
|
|
4157
|
-
const visualRaw = time - latency - lookAhead;
|
|
4148
|
+
const visualRaw = engineRef.current ? engineRef.current.getAudibleTime() : time;
|
|
4158
4149
|
const visualTime = Number.isFinite(visualRaw) ? Math.max(0, visualRaw) : 0;
|
|
4159
4150
|
visualTimeRef.current = visualTime;
|
|
4160
4151
|
const sr = sampleRateRef.current;
|