Skip to content

Commit dcb77a1

Browse files
authored
fix: ensure audio output switching is disabled for safari based browsers (livekit#1602)
1 parent b3cf0a6 commit dcb77a1

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/lovely-bears-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-client": patch
3+
---
4+
5+
fix: ensure audio output switching is disabled for safari based browsers

src/room/Room.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
13451345
(!supportsSetSinkId() && !this.options.webAudioMix) ||
13461346
(this.options.webAudioMix && this.audioContext && !('setSinkId' in this.audioContext))
13471347
) {
1348-
throw new Error('cannot switch audio output, setSinkId not supported');
1348+
throw new Error('cannot switch audio output, the current browser does not support it');
13491349
}
13501350
if (this.options.webAudioMix) {
13511351
// setting `default` for web audio output doesn't work, so we need to normalize the id before

src/room/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function isSVCCodec(codec?: string): boolean {
141141
}
142142

143143
export function supportsSetSinkId(elm?: HTMLMediaElement): boolean {
144-
if (!document) {
144+
if (!document || isSafariBased()) {
145145
return false;
146146
}
147147
if (!elm) {

0 commit comments

Comments
 (0)