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

147
Views
Agora no puede cambiar la cámara obteniendo: No se pueden leer las propiedades de undefined (leyendo 'deviceId')

Estoy tratando de usar Agora.io. Todo estaba funcionando como debería. Hasta que agregue el cambio entre cámaras. Estoy tratando de cambiar entre cámaras gracias al siguiente código. Pero el problema es que aparece este error: Uncaught TypeError: Cannot read properties of undefined (reading 'deviceId')

La línea de error está en changeStreamSource() :

 deviceId = devices.cameras[deviceIndex].deviceId;

¿Puedes guiarme en esto?

 function changeStreamSource (deviceIndex, deviceType) { console.log('Switching stream sources for: ' + deviceType); var deviceId; var existingStream = false; if (deviceType === "video") { deviceId = devices.cameras[deviceIndex].deviceId; } localStreams.camera.stream.switchDevice(deviceType, deviceId, function(){ console.log('successfully switched to new device with id: ' + JSON.stringify(deviceId)); // set the active device ids if(deviceType === "audio") { localStreams.camera.micId = deviceId; } else if (deviceType === "video") { localStreams.camera.camId = deviceId; } else { console.log("unable to determine deviceType: " + deviceType); } }, function(){ console.log('failed to switch to new device with id: ' + JSON.stringify(deviceId)); }); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

devices no está definido en su código. Puede obtener una lista de dispositivos utilizando el método AgoraRTC.getDevices .

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!