bbc / peaks.js

JavaScript UI component for interacting with audio waveforms
https://waveform.prototyping.bbc.co.uk
GNU Lesser General Public License v3.0
3.2k stars 279 forks source link

Questions about segment overlays and segmentOptions #496

Closed zzADRiANzz closed 1 year ago

zzADRiANzz commented 1 year ago

Hi. I'm trying to add background colors to segments, but I'm not sure if this is a currently built in feature with peaks.js or not.

Something like this. This is an image I found from another thread asking for something similar, but it's old so I was wondering if there were any updates on this. image

In the API.md under the Configuration section I see segmentOptions, and it looks like maybe the overlay option is what I need. Is overlay in this context what I'm looking for? Also, what are markers on a segment?

I can't test to see what the overlay and markers options do because for some reason anywhere I add segmentOptions it never seems to work. I was wondering if anyone knew why that might be, thanks.

zzADRiANzz commented 1 year ago

Never mind, I realize now that the API documentation seems to use code that doesn't work for the newest officially released version of peaks.js, v2.1.0, which is what I was using.

After updating my project to use the newest beta version of peaks.js v3.0.0-beta.11 I am now able to make use of the code in the API documentation related to styling segments.