File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
packages/core/src/components Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @livekit/components-core " : patch
3
+ ---
4
+
5
+ fix(core): prevent audio output switching on safari based browsers
Original file line number Diff line number Diff line change 4
4
type LocalVideoTrack ,
5
5
type Room ,
6
6
type LocalTrack ,
7
+ getBrowser ,
7
8
} from 'livekit-client' ;
8
9
import { BehaviorSubject } from 'rxjs' ;
9
10
import { log } from '../logger' ;
@@ -35,6 +36,11 @@ export function setupDeviceSelector(
35
36
id === 'default' && localTrack . mediaStreamTrack . label . startsWith ( 'Default' ) ? id : actualId ,
36
37
) ;
37
38
} else if ( room ) {
39
+ const browser = getBrowser ( ) ;
40
+ if ( kind === 'audiooutput' && ( browser ?. name === 'Safari' || browser ?. os === 'iOS' ) ) {
41
+ log . warn ( `Switching audio output device is not supported on Safari and iOS.` ) ;
42
+ return ;
43
+ }
38
44
log . debug ( `Switching active device of kind "${ kind } " with id ${ id } .` ) ;
39
45
await room . switchActiveDevice ( kind , id , options . exact ) ;
40
46
const actualDeviceId : string | undefined = room . getActiveDevice ( kind ) ?? id ;
You can’t perform that action at this time.
0 commit comments