RegionsPlugin Chrome fires "region-out" event immediately on region.play() with MediaElement backend
Bug description
When backend is set to MediaElement or not specified, the "region-out" event fires immediately when calling region.play(). It works fine in Safari, or when backend is set to WebAudio.
Environment
- Browser: Chrome on Mac
Minimal code snippet
const onPlaySegment = useCallback((idx: number) => {
const region = regionsPlugin.current.regions[idx];
region.play();
regionsPlugin.current.once('region-out', () => {
// this fires before the region actually starts playing
wavesurfer.current.pause();
});
}, [regionsPlugin, wavesurfer]);
I'd also really love a playOnce option in regions to just play the region from start to end so I don't need to manually stop the audio.
Likely related to the browser briefly seeking backwards when starting playback.
Same here!
The "region-out" event is fired immediately when region.play().
This is happening on Chrome with Mac, but works fine on Firefox.
Any idea how to hack it on Chrome? Any idea if this will be solved soon?
Thanks! I love this library 👍
Same here! The "region-out" event is fired immediately when region.play(). This is happening on Chrome with Mac, but works fine on Firefox.
Any idea how to hack it on Chrome? Any idea if this will be solved soon?
Thanks! I love this library 👍
Try setting backend: WebAudio in the wavesurfer settings, that's working for me for now!
Having Same issue! The "region-out" event is fired immediately when region.play(). I have tried by setting backend: WebAudio still having same error.
@jaredgei It works for me too! Thanks 👍