Single Region update option problems #4172
Schwankenson
started this conversation in
General
Replies: 2 comments
-
That's a bug, good catch! I'll create an issue for it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @katspaugh, thank you! DId you see that there is more missing region update stuff (see my monkeypatch function, it contains everything)
All things which are done on region create and then not updated on setOptions. Maybe there is more. Region updates did not seem to be in focus when region plugin was developed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug description
I`m loading new audiodata in my wavesurfer with loadBlob function. I want the regions to stay there for performance reason: I then do a time update for them with something like:
This time update is not shown correctly. Regions are a bit time shifted. I do not want to clear and reset all regions because of performance. I have a lot of regions in my wavesurfer instance.
So I checked the code and found out, that the totalDuration is set in the SingleRegion constructor and is not updated on wavesurfer audiodata reload.
UPDATE: When setting start and end the same value, and making the region a marker with this, the update does not work as well. Styles are initialized in initElement function. And most of them not updated later.
Suggested solution
In the region plugin constructor there could be something like this:
And the initElement should be split in a
initElement
andupdateElementStyles
. TheupdateElementStyles
should then be called after region option update.My monkeypatch:
Why do you not make a pull request
Oops—my brain’s currently locked in project-mode and refuses to RSVP to any side quests. Pull request? Not today, silly rabbit! 🐰 I’ll hop back to it once this sprint is in the bag.
Beta Was this translation helpful? Give feedback.
All reactions