mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-11-26 02:09:51 +08:00
fix: open microphone whenever enter setting page | 删除获取麦克风权限 (#350)
* fix: bugs * delete getMediaUser Co-authored-by: qier222 <qier222@outlook.com>
This commit is contained in:
parent
ee77b34ee9
commit
fc0367c9b4
|
@ -119,7 +119,6 @@ export default {
|
|||
lossless: "Lossless",
|
||||
},
|
||||
deviceSelector: "Audio Output Device",
|
||||
permissionDenied: "Microphone Permission Denied",
|
||||
permissionRequired: "Microphone Permission Required",
|
||||
appearance: {
|
||||
text: "Appearance",
|
||||
|
|
|
@ -120,7 +120,6 @@ export default {
|
|||
lossless: "无损",
|
||||
},
|
||||
deviceSelector: "音频输出设备",
|
||||
permissionDenied: "无麦克风权限",
|
||||
permissionRequired: "需要麦克风权限",
|
||||
appearance: {
|
||||
text: "外观",
|
||||
|
|
|
@ -401,26 +401,23 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getAllOutputDevices() {
|
||||
navigator.mediaDevices
|
||||
.getUserMedia({ audio: true })
|
||||
.then(() => {
|
||||
navigator.mediaDevices.enumerateDevices().then((devices) => {
|
||||
this.allOutputDevices = devices.filter((device) => {
|
||||
return device.kind == "audiooutput";
|
||||
});
|
||||
if (
|
||||
this.allOutputDevices.length > 0 &&
|
||||
this.allOutputDevices[0].label !== ""
|
||||
) {
|
||||
this.withoutAudioPriviledge = false;
|
||||
navigator.mediaDevices
|
||||
.enumerateDevices()
|
||||
.then(
|
||||
(devices) =>
|
||||
(this.allOutputDevices = devices.filter(
|
||||
(device) => device.kind == "audiooutput"
|
||||
))
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
} else {
|
||||
this.allOutputDevices = [
|
||||
{
|
||||
deviceId: "default",
|
||||
label: "settings.permissionDenied",
|
||||
label: "settings.permissionRequired",
|
||||
},
|
||||
];
|
||||
}
|
||||
});
|
||||
},
|
||||
logout() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user