diff options
author | Joas Schilling <coding@schilljs.com> | 2017-01-18 17:14:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-18 17:14:21 +0300 |
commit | 6dfd35ccbbdcb6ca0144887295d766bcd4848e60 (patch) | |
tree | c15cce76f102664e54aa1334e8a1fc62398d7a1e | |
parent | 34b2942a0bdcff26ca69016a390105772283f388 (diff) | |
parent | 88fd82e99dad9ddabe3f1150700c041892f97f35 (diff) |
Merge pull request #221 from nextcloud/issue-160-no-camera
Use app with no-camera devices
-rw-r--r-- | js/app.js | 9 | ||||
-rw-r--r-- | js/simplewebrtc.js | 4 | ||||
-rw-r--r-- | js/webrtc.js | 5 |
3 files changed, 12 insertions, 6 deletions
@@ -401,12 +401,17 @@ uiChannel.trigger('document:click', event); }, - initAudioVideoSettings: function() { + initAudioVideoSettings: function(configuration) { if (OCA.SpreedMe.app.audioDisabled) { OCA.SpreedMe.app.disableAudio(); } - if (OCA.SpreedMe.app.videoDisabled) { + if (configuration.video !== false) { + if (OCA.SpreedMe.app.videoDisabled) { + OCA.SpreedMe.app.disableVideo(); + } + } else { + OCA.SpreedMe.app.videoWasEnabledAtLeastOnce = false; OCA.SpreedMe.app.disableVideo(); } }, diff --git a/js/simplewebrtc.js b/js/simplewebrtc.js index 144a4648a..ac9a78d4d 100644 --- a/js/simplewebrtc.js +++ b/js/simplewebrtc.js @@ -5360,7 +5360,7 @@ self.emit('localStream', stream); } else { // Fallback for users without a camera - if (self.config.audioFallback && err.name === 'DevicesNotFoundError' && constraints.video !== false) { + if (self.config.audioFallback && (err.name === 'DevicesNotFoundError' || err.name === 'NotFoundError') && constraints.video !== false) { constraints.video = false; self.start(constraints, cb); return; @@ -14183,7 +14183,7 @@ if (err) { self.emit('localMediaError', err); } else { - self.emit('localMediaStarted'); + self.emit('localMediaStarted', self.config.media); attachMediaStream(stream, self.getLocalVideoContainer(), self.config.localVideo); } }); diff --git a/js/webrtc.js b/js/webrtc.js index 6b69fc46b..06e8dd5cb 100644 --- a/js/webrtc.js +++ b/js/webrtc.js @@ -117,6 +117,7 @@ var spreedMappingTable = []; } }, autoAdjustMic: false, + audioFallback: true, detectSpeakingEvents: true, connection: OCA.SpreedMe.XhrConnection, enableDataChannels: true, @@ -267,8 +268,8 @@ var spreedMappingTable = []; }); }); - OCA.SpreedMe.webrtc.on('localMediaStarted', function () { - OCA.SpreedMe.app.initAudioVideoSettings(); + OCA.SpreedMe.webrtc.on('localMediaStarted', function (configuration) { + OCA.SpreedMe.app.initAudioVideoSettings(configuration); }); OCA.SpreedMe.webrtc.on('localMediaError', function(error) { |