steep-balloon-41261
12/19/2023, 8:22 AMbetter-hospital-53698
12/19/2023, 6:13 PMenableCameraAndMicrophone()
async enableCameraAndMicrophone() {
if (
this.pendingPublishing.has(Track.Source.Camera) ||
this.pendingPublishing.has(Track.Source.Microphone)
) {
// no-op it's already been requested
return;
}
this.pendingPublishing.add(Track.Source.Camera);
this.pendingPublishing.add(Track.Source.Microphone);
try {
const tracks: LocalTrack[] = await this.createTracks({
audio: true,
video: true,
});
await Promise.all(tracks.map((track) => this.publishTrack(track)));
} finally {
this.pendingPublishing.delete(Track.Source.Camera);
this.pendingPublishing.delete(Track.Source.Microphone);
}
}
It would be nice if the enableCameraAndMicrophone() were parameterized, but I can probably rip this out and modify it to be explicit about using the user facing camera. Good thing to add to the API though (and should be pretty simple)better-hospital-53698
12/19/2023, 6:24 PMnew Room({
videoCaptureDefaults: { ... },
audioCaptureDefaults: { ... },
});dry-elephant-14928
12/20/2023, 7:26 AM