Set available devices to empty map on safari.

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-08-04 17:02:02 +02:00
parent e14ad21c4e
commit 04bc4175f4
3 changed files with 8 additions and 4 deletions
+5 -1
View File
@@ -211,7 +211,7 @@ class AudioOutput
public readonly available$ = this.scope.behavior(
availableRawDevices$("audiooutput", this.usingNames$, this.scope).pipe(
map((availableRaw) => {
const available: Map<string, AudioOutputDeviceLabel> =
let available: Map<string, AudioOutputDeviceLabel> =
buildDeviceMap(availableRaw);
// Create a virtual default audio output for browsers that don't have one.
// Its device ID must be the empty string because that's what setSinkId
@@ -221,6 +221,10 @@ class AudioOutput
type: "default",
name: availableRaw[0]?.label || null,
});
if (navigator.userAgent.includes("Safari")) {
// set to empty map if we are on Safari, because it does not support setSinkId
available = new Map();
}
// Note: creating virtual default input devices would be another problem
// entirely, because requesting a media stream from deviceId "" won't
// automatically track the default device.