Unify the initial audio and video settings with and without local media

When "startWithoutLocalMedia" is called there is never audio nor video
(otherwise "startLocalMedia" would have been called instead), so there
is no need to call "isAudioEnabled" nor "isVideoEnabled". Moreover,
"initAudioVideoSettings" performs the same setup as the custom handling
in "startWithoutLocalMedia", so that custom handling can be replaced by
a call to "initAudioVideoSettings".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2018-12-05 16:10:24 +01:00
Родитель a4e0a6e2e8
Коммит 6ed774e1f3
2 изменённых файлов: 3 добавлений и 12 удалений

Просмотреть файл

@ -787,23 +787,14 @@
localMediaChannel.trigger('startLocalMedia');
},
startWithoutLocalMedia: function(isAudioEnabled, isVideoEnabled) {
startWithoutLocalMedia: function(configuration) {
if (this.callbackAfterMedia) {
this.callbackAfterMedia(null);
this.callbackAfterMedia = null;
}
$('.videoView').removeClass('hidden');
this.disableAudio();
if (!isAudioEnabled) {
this.hasNoAudio();
}
this.disableVideo();
if (!isVideoEnabled) {
this.hasNoVideo();
}
this.initAudioVideoSettings(configuration);
if (OCA.SpreedMe.webrtc.capabilities.support) {
localMediaChannel.trigger('startWithoutLocalMedia');

Просмотреть файл

@ -1024,7 +1024,7 @@ var spreedPeerConnectionTable = [];
console.log('Error while accessing microphone & camera: ', error.message || error.name);
}
app.startWithoutLocalMedia(webrtc.webrtc.isAudioEnabled(), webrtc.webrtc.isVideoEnabled());
app.startWithoutLocalMedia({audio: false, video: false});
OC.Notification.show(message, {
type: 'error',
timeout: 15,