volume device info: support bluetooth headphones

This commit is contained in:
end-4
2024-03-07 15:08:22 +07:00
parent 76289cad71
commit de93991034
@@ -64,7 +64,8 @@ export default () => {
}, },
nameSetup: (self) => Utils.timeout(1, () => { nameSetup: (self) => Utils.timeout(1, () => {
const updateAudioDevice = (self) => { const updateAudioDevice = (self) => {
const usingHeadphones = (Audio.speaker?.stream?.port)?.includes('Headphones'); console.log(Audio.speaker?.stream?.port);
const usingHeadphones = (Audio.speaker?.stream?.port)?.toLowerCase().includes('headphone');
if (volumeIndicator.attribute.headphones === undefined || if (volumeIndicator.attribute.headphones === undefined ||
volumeIndicator.attribute.headphones !== usingHeadphones) { volumeIndicator.attribute.headphones !== usingHeadphones) {
volumeIndicator.attribute.headphones = usingHeadphones; volumeIndicator.attribute.headphones = usingHeadphones;