peaks.js icon indicating copy to clipboard operation
peaks.js copied to clipboard

Allow configuration of where segments are displayed

Open lowpitch opened this issue 11 years ago • 1 comments

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);

lowpitch avatar Sep 27 '14 23:09 lowpitch

@chrisn this should be closed and superseded by #87

thom4parisot avatar Dec 21 '16 13:12 thom4parisot

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,

chrisn avatar Jun 17 '23 11:06 chrisn