Video Conference Kit
  • iOS
  • Android
  • Web
  • Flutter : Dart
  • React Native
  • Overview
  • Quick start
  • Customize prebuilt features
    • Overview
    • Set avatar for users
    • Add custom components to user view
    • Configure video layouts
    • Hide components
    • Customize the menu bar
    • Set a leave confirmation dialog
    • Turn off cam and mic when joining meeting
    • Implement an audio-only conference
  • Advanced features
    • Screen sharing
  • Documentation
  • Video Conference Kit
  • Customize prebuilt features
  • Turn off cam and mic when joining meeting

Turn off cam and mic when joining meeting

Last updated:2023-06-02 14:32

When starting a conference, the Video Conference Kit (ZegoUIKitPrebuiltVideoConference) turns on the camera, and microphone, and uses the speaker as the audio output device by default.

To change this default configuration, for example, turn off the camera when you start a conference or don't use the speaker (If the speaker is not used, the system's default audio output device, such as ear speaker, headset, Bluetooth, etc., will be used.), you can modify the following configurations:

  1. turnOnCameraWhenJoining: Whether to turn on the camera when the conference starts. true: turn on (by default). false: turn off.
  2. turnOnMicrophoneWhenJoining: Whether to turn on the camera when the conference starts. true: turn on (by default). false: turn off.
  3. useSpeakerWhenJoining: Whether to use the speaker when the conference starts. true: use the speaker (by default). false: use the system's default audio output device, such as an ear speaker, headset, Bluetooth, etc.

Here is the reference code:

class VideoConferencePage extends StatelessWidget {
  const VideoConferencePage({Key? key, required this.conferenceID}) : super(key: key);
  final String conferenceID;

  @override
  Widget build(BuildContext context) {
    return ZegoUIKitPrebuiltVideoConference (
      appID: YourAppID,
      appSign: YourAppSign,
      userID: userID,
      userName: userID,
      conferenceID: conferenceID,

      // Modify your custom configurations here.
      config: ZegoUIKitPrebuiltVideoConferenceConfig(
        turnOnCameraWhenJoining: false,
        turnOnMicrophoneWhenJoining:false,
        useSpeakerWhenJoining: true,
      ),
    );
  }
}
Page Directory