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

React wrapper for peaks.js? #342

Closed larrywal closed 1 year ago

larrywal commented 3 years ago

Has anyone created something for this? Right now I'm using refs to interact with Peaks.js in my react app, but would love to have a react control.

chrisn commented 3 years ago

There's a demo of how to use Peaks.js in React here: https://github.com/chrisn/peaksjs-react-example

larrywal commented 3 years ago

Thanks! So helpful. From looking through, I think for just a basic waveform rendering, I can take waveform.jsx and use it directly...

I do need to use seek and zoom, but if I pass those in to waveform as properties, and then in componentDidUpdate, if the file hasn't changed but the zoom/seek have, I could just call those functions directly on the element.

Sound right?

rowild commented 3 years ago

@chrisn Any chance for a Vue example?

suterma commented 2 years ago

@rowild Giovanni Candeo has a working vue.js example: https://github.com/candeogi/peaks-vue-demo It's very bare-bones but shows some basic options.