publishStream method

Future<void> publishStream(
  1. bool value
)

Implementation

Future<void> publishStream(bool value) async {
  try {
    if (value) {
      audioTrack?.start();
    } else {
      audioTrack?.stop();
    }
  } catch (error) {
    log('could not publish audio: $error');
  }
  await room?.localParticipant?.setMicrophoneEnabled(value);
  await room?.localParticipant?.setCameraEnabled(false);
}