Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ruon1804 opened this issue May 12, 2022 · 5 comments
Open

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

ruon1804 opened this issue May 12, 2022 · 5 comments

Comments

@ruon1804
Copy link

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.

@chrisguttandin
Copy link
Owner

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)

@ruon1804
Copy link
Author

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?

@chrisguttandin
Copy link
Owner

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>

@bachvtuan
Copy link

@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 ?

@chrisguttandin
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants