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

setSource mediaUrl optional #352

Closed Christilut closed 3 years ago

Christilut commented 3 years ago

Removed the required for mediaUrl in the setSource method.

If no mediaUrl is present, it will run playerCanPlayHandler since no callback is made otherwise.

See #351

chrisn commented 3 years ago

Thank you! We'll need to add some test cases around this. The mediaUrl should be optional only if you're using an external player object. If you're using the HTMLMediaElement based player then it should still be required.

Christilut commented 3 years ago

I've changed the typings so that mediaElement is no longer required since it's not used when using an arraybuffer.

I'll add some tests soon.

chrisn commented 3 years ago

Would you mind putting this change on a branch, please?