Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
No se puede leer la propiedad de undefined (leyendo 'getusermedia') en AWS EC2

Implementé una aplicación django en AWS EC2 para grabar audio desde un altavoz. Aquí está mi código para grabar secuencias de audio;

 let log = console.log.bind(console), id = val => document.getElementById(val), ul = id('ul'), gUMbtn = id('gUMbtn'), start = id('start'), stop = id('stop'), stream, recorder, counter=1, chunks, media; gUMbtn.onclick = e => { let mv = id('mediaVideo'), mediaOptions = { audio: { tag: 'audio', type: 'audio/wav', ext: '.wav', gUM: {audio: true} } }; media = mediaOptions.audio; navigator.mediaDevices.getUserMedia(media.gUM).then(_stream => { stream = _stream; id('gUMArea').style.display = 'none'; id('btns').style.display = 'inherit'; start.removeAttribute('disabled'); recorder = new MediaRecorder(stream); recorder.ondataavailable = e => { chunks.push(e.data); if(recorder.state == 'inactive'){ makeLink(); } }; log('got media successfully'); }).catch(log); } start.onclick = e => { start.disabled = true; stop.removeAttribute('disabled'); chunks=[]; recorder.start(); } stop.onclick = e => { stop.disabled = true; recorder.stop(); start.removeAttribute('disabled'); } function makeLink(){ let blob = new Blob(chunks, {type: media.type }) , url = URL.createObjectURL(blob) , li = document.createElement('li') , mt = document.createElement(media.tag) , hf = document.createElement('a') ; mt.controls = true; mt.src = url; hf.href = url; hf.download = `${counter}${media.ext}`; hf.innerHTML = `donwload ${hf.download}`; li.appendChild(mt); li.appendChild(hf); ul.innerHTML = ""; ul.appendChild(li); }

Cuando ejecuto ese código en el servidor, dice "Error de tipo no detectado: no se pueden leer las propiedades de undefined (leyendo 'getUserMedia')"

Si alguien ha experimentado esto antes, por favor, ¡écheme una mano!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Cuando alojé la aplicación en un https, funcionó bien. En realidad, el dispositivo de medios no está definido en http.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!