fixup docs

This commit is contained in:
Timo K.
2026-10-08 13:53:57 +02:00
parent 4790af08a4
commit ca4f0cdeae
3 changed files with 18 additions and 15 deletions
+5 -7
View File
@@ -6,7 +6,6 @@ Please see LICENSE in the repository root for full details.
*/
import {
ConnectionState as LivekitConnectionState,
type LocalTrackPublication,
ParticipantEvent,
type Room as LivekitRoom,
@@ -207,13 +206,12 @@ export class Publisher {
return [...this.room.localParticipant.trackPublications.values()];
}
/** A room that is not connected yet takes the device from its options instead. */
/**
* Works on a room that is still connecting too: LiveKit keeps the device
* in the room's options and gives it to every participant that arrives.
*/
public async setAudioOutputDevice(deviceId: string): Promise<void> {
if (
this.room.state !== LivekitConnectionState.Connected ||
this.room.getActiveDevice("audiooutput") === deviceId
)
return;
if (this.room.getActiveDevice("audiooutput") === deviceId) return;
await this.room.switchActiveDevice("audiooutput", deviceId);
}
}