You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additional documentation for the LiveKit SDK can be found at https://docs.livekit.io/references/client-sdks/
128
132
133
+
## Audio sessions
134
+
135
+
As seen in the above example, we've introduced a new class `AudioSession` that helps
136
+
to manage the audio session on native platforms. This class wraps either [AudioManager](https://developer.android.com/reference/android/media/AudioManager) on Android, or [AVAudioSession](https://developer.apple.com/documentation/avfaudio/avaudiosession) on iOS.
137
+
138
+
You can customize the configuration of the audio session with `configureAudio`.
139
+
140
+
```js
141
+
useEffect(() => {
142
+
let connect =async () => {
143
+
// configure audio session prior to starting it.
144
+
awaitAudioSession.configureAudio({
145
+
android: {
146
+
preferredOutputList: ['earpiece'],
147
+
// See [AudioManager](https://developer.android.com/reference/android/media/AudioManager)
148
+
// for details on audio and focus modes.
149
+
audioMode:'normal',
150
+
audioFocusMode:'gain',
151
+
},
152
+
ios: {
153
+
defaultOutput:'earpiece',
154
+
},
155
+
});
156
+
awaitAudioSession.startAudioSession();
157
+
awaitroom.connect(url, token, {});
158
+
};
159
+
connect();
160
+
return () => {
161
+
room.disconnect();
162
+
AudioSession.stopAudioSession();
163
+
};
164
+
}, [url, token, room]);
165
+
```
166
+
129
167
## Screenshare
130
168
131
169
Enabling screenshare requires extra installation steps:
@@ -196,7 +234,9 @@ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the
0 commit comments