audio-recorder-polyfill icon indicating copy to clipboard operation
audio-recorder-polyfill copied to clipboard

Add more information on how to install

Open Juanvulcano opened this issue 5 years ago • 2 comments

Hi I'm sorry,

I don't have a lot of JS experience and don't find the documentation very clear on how to install. I followed the instructions, installed with npm. I have a simple html site.

When trying to load the polyfill-js I get: Reference error require is not defined

Is just doing: npm install --save audio-recorder-polyfill enough?

Also where would this code go on a simple html site?

entry: { app: './src/app.js', polyfill: './src/polyfill.js' }

This is the code I'm using for app.js navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => { recorder = new MediaRecorder(stream) recorder.addEventListener('dataavailable', e => { audio.src = URL.createObjectURL(e.data) }) recorder.start() })

I installed Parcel but I'm even more confused now as well.

Juanvulcano avatar Feb 21 '20 10:02 Juanvulcano

The entry line is assuming that you are using webpack. You need to reference the bundle javascript in your html file. It will contain all the javascript code that you can run. To do so, you can use webpack/parcel or any other bundler.

jrm2k6 avatar Feb 24 '20 22:02 jrm2k6

@jrm2k6 thanks. I will be glad for PR to fix a doc and make it more clear,

ai avatar Feb 25 '20 17:02 ai