chrisguttandin/extendable-media-recorder

It have js version like extendable-media-recorder.js?

Opened this issue · 5 comments

Hi Chris,
I'm having a hard time using the MediaRecorder API, I was happy to find your library, but it seems to only work with node.js.
I have a project with .Netcore 3.1, can you build a javascript version? It's like extendable-media-recorder.js or something like that.
thank you very much.

Hi @ruon1804,

the library is meant to run in the browser. It doesn't work with Node.js. But Node.js is currently required to bundle the library for the browser.

However it's possible to use a 3rd party service for that as well. Would the following work for you?

#651 (comment)

Thanks for your respond.
I tried following that thread, but it gives me the following error:

Uncaught SyntaxError: The requested module 'https://dev.jspm.io/npm:extendable-media-recorder' does not provide an export named 'MediaRecorder'.

Can you check it again?

Oh, they must have changed something in the way they process the code on the server. The following seems to work.

<script type="module">
    import extendableMediaRecorder from 'https://dev.jspm.io/npm:extendable-media-recorder';
    import extendableMediaRecorderWavEncoder from 'https://dev.jspm.io/npm:extendable-media-recorder-wav-encoder';

    const { MediaRecorder, register } = extendableMediaRecorder;
    const { connect } = extendableMediaRecorderWavEncoder;

    // ...
</script>

@chrisguttandin I tried to code your code in the browser but I get this error:

 Uncaught SyntaxError: The requested module 'https://dev.jspm.io/npm:extendable-media-recorder' does not provide an export named 'default' (at test3.html:12:16)

I also detect that the browser loads 49 relevant js files. could you some how build a single js file for extendableMediaRecorder and extendableMediaRecorderWavEncoder ?

Hi @bachvtuan, looks like JSPM handles packages differently now. The following should work.

<script type="module">
    import { MediaRecorder, register } from 'https://dev.jspm.io/npm:extendable-media-recorder';
    import { connect } from 'https://dev.jspm.io/npm:extendable-media-recorder-wav-encoder';

    // ...
</script>

Providing a fully bundled file is something I want to do again. I just had no time for doing it so far.