Merge pull request #844 from jitsi/device-selection-rework
Device selection rework
This commit is contained in:
commit
84983c341e
|
@ -1424,7 +1424,7 @@ export default {
|
||||||
.then(([stream]) => {
|
.then(([stream]) => {
|
||||||
this.useVideoStream(stream);
|
this.useVideoStream(stream);
|
||||||
console.log('switched local video device');
|
console.log('switched local video device');
|
||||||
APP.settings.setCameraDeviceId(cameraDeviceId);
|
APP.settings.setCameraDeviceId(cameraDeviceId, true);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
APP.UI.showDeviceErrorDialog(null, err);
|
APP.UI.showDeviceErrorDialog(null, err);
|
||||||
|
@ -1446,7 +1446,7 @@ export default {
|
||||||
.then(([stream]) => {
|
.then(([stream]) => {
|
||||||
this.useAudioStream(stream);
|
this.useAudioStream(stream);
|
||||||
console.log('switched local audio device');
|
console.log('switched local audio device');
|
||||||
APP.settings.setMicDeviceId(micDeviceId);
|
APP.settings.setMicDeviceId(micDeviceId, true);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
APP.UI.showDeviceErrorDialog(err, null);
|
APP.UI.showDeviceErrorDialog(err, null);
|
||||||
|
@ -1541,13 +1541,13 @@ export default {
|
||||||
// storage and settings menu. This is a workaround until
|
// storage and settings menu. This is a workaround until
|
||||||
// getConstraints() method will be implemented in browsers.
|
// getConstraints() method will be implemented in browsers.
|
||||||
if (localAudio) {
|
if (localAudio) {
|
||||||
localAudio._setRealDeviceIdFromDeviceList(devices);
|
APP.settings.setMicDeviceId(
|
||||||
APP.settings.setMicDeviceId(localAudio.getDeviceId());
|
localAudio.getDeviceId(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localVideo) {
|
if (localVideo) {
|
||||||
localVideo._setRealDeviceIdFromDeviceList(devices);
|
APP.settings.setCameraDeviceId(
|
||||||
APP.settings.setCameraDeviceId(localVideo.getDeviceId());
|
localVideo.getDeviceId(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mediaDeviceHelper.setCurrentMediaDevices(devices);
|
mediaDeviceHelper.setCurrentMediaDevices(devices);
|
||||||
|
|
|
@ -174,10 +174,12 @@ export default {
|
||||||
* Set device id of the camera which is currently in use.
|
* Set device id of the camera which is currently in use.
|
||||||
* Empty string stands for default device.
|
* Empty string stands for default device.
|
||||||
* @param {string} newId new camera device id
|
* @param {string} newId new camera device id
|
||||||
|
* @param {boolean} whether we need to store the value
|
||||||
*/
|
*/
|
||||||
setCameraDeviceId: function (newId = '') {
|
setCameraDeviceId: function (newId, store) {
|
||||||
cameraDeviceId = newId;
|
cameraDeviceId = newId;
|
||||||
window.localStorage.cameraDeviceId = newId;
|
if (store)
|
||||||
|
window.localStorage.cameraDeviceId = newId;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -192,10 +194,12 @@ export default {
|
||||||
* Set device id of the microphone which is currently in use.
|
* Set device id of the microphone which is currently in use.
|
||||||
* Empty string stands for default device.
|
* Empty string stands for default device.
|
||||||
* @param {string} newId new microphone device id
|
* @param {string} newId new microphone device id
|
||||||
|
* @param {boolean} whether we need to store the value
|
||||||
*/
|
*/
|
||||||
setMicDeviceId: function (newId = '') {
|
setMicDeviceId: function (newId, store) {
|
||||||
micDeviceId = newId;
|
micDeviceId = newId;
|
||||||
window.localStorage.micDeviceId = newId;
|
if (store)
|
||||||
|
window.localStorage.micDeviceId = newId;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue