Skip to content

Commit 6dfd35c

Browse files
Merge pull request #221 from nextcloud/issue-160-no-camera
Use app with no-camera devices
2 parents 34b2942 + 88fd82e commit 6dfd35c

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

js/app.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,17 @@
401401

402402
uiChannel.trigger('document:click', event);
403403
},
404-
initAudioVideoSettings: function() {
404+
initAudioVideoSettings: function(configuration) {
405405
if (OCA.SpreedMe.app.audioDisabled) {
406406
OCA.SpreedMe.app.disableAudio();
407407
}
408408

409-
if (OCA.SpreedMe.app.videoDisabled) {
409+
if (configuration.video !== false) {
410+
if (OCA.SpreedMe.app.videoDisabled) {
411+
OCA.SpreedMe.app.disableVideo();
412+
}
413+
} else {
414+
OCA.SpreedMe.app.videoWasEnabledAtLeastOnce = false;
410415
OCA.SpreedMe.app.disableVideo();
411416
}
412417
},

js/simplewebrtc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5360,7 +5360,7 @@
53605360
self.emit('localStream', stream);
53615361
} else {
53625362
// Fallback for users without a camera
5363-
if (self.config.audioFallback && err.name === 'DevicesNotFoundError' && constraints.video !== false) {
5363+
if (self.config.audioFallback && (err.name === 'DevicesNotFoundError' || err.name === 'NotFoundError') && constraints.video !== false) {
53645364
constraints.video = false;
53655365
self.start(constraints, cb);
53665366
return;
@@ -14183,7 +14183,7 @@
1418314183
if (err) {
1418414184
self.emit('localMediaError', err);
1418514185
} else {
14186-
self.emit('localMediaStarted');
14186+
self.emit('localMediaStarted', self.config.media);
1418714187
attachMediaStream(stream, self.getLocalVideoContainer(), self.config.localVideo);
1418814188
}
1418914189
});

js/webrtc.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ var spreedMappingTable = [];
117117
}
118118
},
119119
autoAdjustMic: false,
120+
audioFallback: true,
120121
detectSpeakingEvents: true,
121122
connection: OCA.SpreedMe.XhrConnection,
122123
enableDataChannels: true,
@@ -267,8 +268,8 @@ var spreedMappingTable = [];
267268
});
268269
});
269270

270-
OCA.SpreedMe.webrtc.on('localMediaStarted', function () {
271-
OCA.SpreedMe.app.initAudioVideoSettings();
271+
OCA.SpreedMe.webrtc.on('localMediaStarted', function (configuration) {
272+
OCA.SpreedMe.app.initAudioVideoSettings(configuration);
272273
});
273274

274275
OCA.SpreedMe.webrtc.on('localMediaError', function(error) {

0 commit comments

Comments
 (0)