Skip to content

Commit

Permalink
Sample app to acquire audio and video at the same time. (livekit#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao committed Jan 2, 2023
1 parent fc6a015 commit 8bba712
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions example/sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ const appActions = {
.on(RoomEvent.SignalConnected, async () => {
const signalConnectionTime = Date.now() - startTime;
appendLog(`signal connection established in ${signalConnectionTime}ms`);
// speed up publishing by starting to publish before it's fully connected
// publishing is accepted as soon as signal connection has established
if (shouldPublish) {
await Promise.all([
room.localParticipant.setCameraEnabled(true),
room.localParticipant.setMicrophoneEnabled(true),
]);
await room.localParticipant.enableCameraAndMicrophone();
appendLog(`tracks published in ${Date.now() - startTime}ms`);
updateButtonsForPublishState();
}
});
Expand Down

0 comments on commit 8bba712

Please sign in to comment.