master
Vidocq 4 years ago
parent bcd05803e2
commit c96df58dea

@ -244,10 +244,12 @@ export default {
size: "0KB", size: "0KB",
length: 0, length: 0,
}, },
allOutputDevices: [{ allOutputDevices: [
deviceId: "default", {
label: "settings.permissionRequired" deviceId: "default",
}], label: "settings.permissionRequired",
},
],
withoutAudioPriviledge: true, withoutAudioPriviledge: true,
}; };
}, },
@ -399,25 +401,27 @@ export default {
}, },
methods: { methods: {
getAllOutputDevices() { getAllOutputDevices() {
navigator.mediaDevices. navigator.mediaDevices
getUserMedia({ audio: true }) .getUserMedia({ audio: true })
.then(() => { .then(() => {
this.withoutAudioPriviledge = false; this.withoutAudioPriviledge = false;
navigator.mediaDevices navigator.mediaDevices
.enumerateDevices() .enumerateDevices()
.then( .then(
(devices) => (devices) =>
(this.allOutputDevices = devices.filter( (this.allOutputDevices = devices.filter(
(device) => device.kind == "audiooutput" (device) => device.kind == "audiooutput"
)) ))
); );
}) })
.catch(() => { .catch(() => {
this.allOutputDevices = [{ this.allOutputDevices = [
{
deviceId: "default", deviceId: "default",
label: "settings.permissionDenied", label: "settings.permissionDenied",
}]; },
}) ];
});
}, },
logout() { logout() {
doLogout(); doLogout();

Loading…
Cancel
Save