logo
On this page

How to implement switching camera/video screen/microphone/audio/speaker?

2023-03-01
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:iOS / Android / macOS / Windows / Flutter / Electron / ReactNative / uni-app / Unity3D

Express SDK provides you with a series of interfaces to enable and disable related devices. The specific descriptions are as follows:

DeviceInterfaceDescriptionPrecautions
CameraenableCameraEnable or disable the camera on your (local device).
  • enableCamera will truly switch the camera device, so frequent use is not recommended.
  • When you need to release the camera device, you can call this interface.
Video ScreenmutePublishStreamVideoWhen pushing stream, whether to send video data. true means not to send.
  • When the broadcaster does not want to publish their own screen, you can call this interface.
  • This interface will not truly switch the device, nor will it truly stop pushing stream.
mutePlayStreamVideoWhen playing stream, whether to play video data in a certain stream. true means not to play.- When the audience does not want to see a certain person's screen, you can call this interface.- This interface will not truly stop playing stream.
MicrophoneenableAudioCaptureDeviceEnable or disable the microphone on your (local device).
  • The difference from muteMicrophone is that this interface will truly enable or disable the microphone device.
  • If you need to switch frequently, it is recommended to use the muteMicrophone interface.
AudiomuteMicrophoneWhether to mute your (local device) microphone.The difference from enableAudioCaptureDevice is that muteMicrophone does not truly turn off the microphone, but only replaces the audio data collected by the device with silent data.
mutePublishStreamAudioWhen pushing stream, whether to send audio data. true means not to send.
  • When the broadcaster does not want to publish their own voice, you can use this interface.
  • This interface will not truly switch the device, nor will it truly stop pushing stream.
mutePlayStreamAudioWhen playing stream, whether to play audio data in a certain stream. true means not to play.- When the audience does not want to hear a certain person's voice, you can use this interface.- This interface will not truly stop playing stream.
Speaker/HeadphonemuteSpeakerWhether to mute your (local device) speaker/headphone.After muting, all sounds from the SDK will not be played, including stream pulling, media player, etc.

Previous

How to cross-compile Linux v4l-utils dependency library?

Next

How to implement screen sharing through custom capture?