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

Media Source Extensions #131

Open antferr opened 9 years ago

antferr commented 9 years ago

It support Media Source Extensions? Dynamic Adaptive Streaming over HTTP (DASH) for stream?

thom4parisot commented 9 years ago

Well, if the media is playable by the browser, I don't see any reason for it not to work.

If you want not rely on WebAudio to decode your audio file, and then use audiowaveform, you would probably want to extract the audio track of your choice to generate the waveform file.

In case of problem, feel free to provide an example of MSE/EME audio/video element defeating the use of Peaks and we can help you to sort out the problem.

gregorym commented 7 years ago

The current implementation does not work with MSE because the code expects a src on the Audio element, and with MSE, the Audio src is empty.

thom4parisot commented 7 years ago

@gregorym would your use case work by providing an object url to the media element?

Eg:

const mediaSource = new MediaSource();

document.querySelector('audio').src = window.URL.createObjectURL(mediaSource);

Otherwise any help or guidance on how your code works would help progress on this point.