Browse Source

Always try to use microphone if camera failed

When getting the local media it is first tried to get both microphone
and camera and, if that fails, then it is tried to get only the
microphone.

However, this was done only when certain errors happened while trying to
get both the microphone and the camera. Now, no matter the error, it is
tried too to get only the microphone; if the media is still unavailable
it will fail again, but this should help with some further scenarios not
covered yet in the previously handled errors in which camera is not
available but microphone is.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/3775/head
Daniel Calviño Sánchez 6 years ago
parent
commit
4e9bb46e42
  1. 2
      src/utils/webrtc/simplewebrtc/localmedia.js

2
src/utils/webrtc/simplewebrtc/localmedia.js

@ -134,7 +134,7 @@ LocalMedia.prototype.start = function(mediaConstraints, cb) {
}).catch(function(err) {
// Fallback for users without a camera or with a camera that can not be
// accessed.
if (self.config.audioFallback && (err.name === 'NotFoundError' || err.name === 'NotReadableError') && constraints.video !== false) {
if (self.config.audioFallback && constraints.video !== false) {
constraints.video = false
self.start(constraints, cb)
return

Loading…
Cancel
Save