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.21k stars 280 forks source link

Way to customise the segment's bounds #551

Open vivekd95 opened 4 days ago

vivekd95 commented 4 days ago

Hi, @chrisn

As you can notice in the attached screenshot, that segment reveals its timestamp for both bounds (start time and end time). Could you let me know if we can update the background color and font color of this text? If so, please guide me through it. If not, I think this is a good option for the users. 

image

chrisn commented 1 day ago

One way to do this is to use the createSegmentMarker option and write your own custom marker code, which could be a modified version of DefaultSegmentMarker.

Alternately, we could add more options. At the moment, the color can't be changed (it's hard-coded here).

There is a bug here, though, which I'll fix. The marker timestamp font should be controlled by the existing fontFamily, fontSize, and fontStyle options, and these aren't being applied.