peaks.js
peaks.js copied to clipboard
Allow configuration of where segments are displayed
This commit adds initialization options to peaks, allowing you to specify whether segments should appear in the Zoom View, the Overview, or both.
Reference issue #89
The default behaviour is for segments to appear in both views, so no existing code should be affected by this addition.
The following initialization object will tell peaks to only show segments in the Zoom View, and not in the Overview.
var options = {
container: document.getElementById('first-waveform-visualiser-container'),
mediaElement: document.querySelector('audio'),
dataUri: {
arraybuffer: '/test_data/sample.dat'
},
showSegmentsInZoomView: true,
showSegmentsInOverview: false
};
var peaksInstance = Peaks.init(options);
@chrisn this should be closed and superseded by #87
Sorry it's taken so long to get round to this... https://github.com/bbc/peaks.js/commit/53d3e6491418f7c9943729cabc220ded5aa2fd47 adds enableSegments and enablePoints options to completely disable rendering of points and segments in each view. Separately, we could add an API to toggle them on or off,