This message was deleted.
# helpdesk
s
This message was deleted.
b
I found the source code for
enableCameraAndMicrophone()
Copy code
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)
Ah, found the solution - I can set this when I create a room with
Copy code
new Room({
      videoCaptureDefaults: { ... },
      audioCaptureDefaults: { ... },
    });
d
yup! setting a default would be the way to go