Skip to content
Discussion options

You must be logged in to vote

in this case, you need to save the instance of the wavesurfer as a global ref, so the functions can be called imperatively from other event triggers. here is a partially working example, although getting the status (isReady/isPlaying) doesn't seem to work and i didn't have time to figure out why.

"""
1. Use the hook interface inside a normal div with MemoizationLeaf to create a component with a local wavesurfer variable.
2. Automatically generate an ID for the div if one is not provided so each instance can be handled separately.
3. Store the resulting wavesurfer instance in a global ref to allow other components to access it.
4. Expose a helper API to call methods on the wavesurfer insta…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pahamala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants