Learn how to mute audio, disable video, switch camera, share your screen, configure media settings, etc.
To manage audio & video streams QBRTCSession
provides QBMediaStreamManager
class.
QBMediaStreamManager
holds a user’s local audio & video tracks and provides a way to change the video capturer.
QBMediaStreamManager
is attached to QBRTCSession
lifecycle. According to QBRTCSession
lifecycle, you should use QBMediaStreamManager
only when QBRTCSession
is active or has been started.
Mute the audio by calling setEnabled()
or setAudioEnabled()
method. Using these methods, we can tell SDK to send/not send audio data either from a local or remote peer in the specified call session.
Turn off the video by calling setEnabled()
or setVideoEnabled()
method. Using these methods, we can tell SDK not to send video data either from a local or remote peer in the specified call session.
When a call session is started, the Camera Capturer is used by default. If you want to use it manually, you should set QBRTCCameraVideoCapturer
as Video Capturer.
Creating a new instance of QBRTCCameraVideoCapturer
throws the QBRTCCameraCapturerException
so you should handle this exception.
You can switch the video camera during a call. (Default: front camera)
You should use CameraSwitchHandler
to handle the camera switching process.
You can change framerate and frame size during an active call session using videoCapturer
.
To share the screen of your device with the opponents, follow the steps below:
Instead of CallActivity.this
, you can use the context of the activity where you are asking this permission.
You should pass the Intent (data) to startScreenSharing()
method to use it for setVideoCapturer()
.
QBRTCScreenCapturer
as Video Capturer.You are able to receive an information report about the current connection, audio, video tracks, and other useful information. To set a receiving time interval, use the code snippet below.
Then you should use the QBRTCStatsReportCallback
and add them.
The qbrtcStatsReport.audioReceivedCodec()
and qbrtcStatsReport.videoReceivedFps()
are not all you can get from the QBRTCStatsReport
. This is just the example.
Using QBRTCStatsReport
, you can define when your opponent is speaking by using the qbrtcStatsReport.getAudioReceiveOutputLevel()
parameter. This parameter is the microphone level from the participant’s audio track at the moment of collecting the statistics report.
You can change different settings for your calls using the QBRTCConfig
class. All of them are listed below.
If an opponent hasn’t answered you within an answer time interval, then the onUserNotAnswer()
callback will be returned. The answer time interval shows how much time an opponent has to answer your call. Set the answer time interval using the code snippet below.
By default, the answer time interval is 60 seconds.
Set maximum allowed time to repair a connection after it was lost. Set the disconnect time interval using the code snippet below.
By default, the disconnect time interval is 10 seconds.
Dialing time interval indicates how often to notify your opponents about your call. Set the dialing time interval using the code snippet below.
By default, the dialing time interval is 5 seconds.
Set the maximum number of opponents in a group call using the snippet below.
By default, the maximum number of opponents is 10.
You can customize a list of ICE servers. By default, WebRTC module will use internal ICE servers that are usually enough, but you can always set your own. WebRTC engine will choose the TURN relay with the lowest round-trip time. Thus, setting multiple TURN servers allows your application to scale-up in terms of bandwidth and number of users. Review our Setup guide to learn how to configure custom ICE servers.
You can use the QBRTCMediaConfig
class instance to configure a variety of media settings such as video/audio codecs, bitrate, fps, etc.
It’s possible to set a video codec. You can choose from the following values: H264, VP8, and VP9.
You can also set the custom video resolution to provide guarantees for the predictable behavior of the video stream.
Set an audio codec using the snippet below. You can choose from the following values: ISAC and OPUS. Default: ISAC.
It’s possible to set the custom bitrate to provide guarantees for the predictable behavior of the video stream.
Enable hardware acceleration if the device supports it. Default: false.
It’s possible to set the custom fps to provide guarantees for the predictable behavior of the video stream.
Enable a built-in acoustic echo cancellation if the device supports it. Default: true.
Enable open sound library for embedded systems (OpenSL ES audio) if the device supports it. Default: false.
Enable audio processing if the device supports it. Default: true.
Learn how to mute audio, disable video, switch camera, share your screen, configure media settings, etc.
To manage audio & video streams QBRTCSession
provides QBMediaStreamManager
class.
QBMediaStreamManager
holds a user’s local audio & video tracks and provides a way to change the video capturer.
QBMediaStreamManager
is attached to QBRTCSession
lifecycle. According to QBRTCSession
lifecycle, you should use QBMediaStreamManager
only when QBRTCSession
is active or has been started.
Mute the audio by calling setEnabled()
or setAudioEnabled()
method. Using these methods, we can tell SDK to send/not send audio data either from a local or remote peer in the specified call session.
Turn off the video by calling setEnabled()
or setVideoEnabled()
method. Using these methods, we can tell SDK not to send video data either from a local or remote peer in the specified call session.
When a call session is started, the Camera Capturer is used by default. If you want to use it manually, you should set QBRTCCameraVideoCapturer
as Video Capturer.
Creating a new instance of QBRTCCameraVideoCapturer
throws the QBRTCCameraCapturerException
so you should handle this exception.
You can switch the video camera during a call. (Default: front camera)
You should use CameraSwitchHandler
to handle the camera switching process.
You can change framerate and frame size during an active call session using videoCapturer
.
To share the screen of your device with the opponents, follow the steps below:
Instead of CallActivity.this
, you can use the context of the activity where you are asking this permission.
You should pass the Intent (data) to startScreenSharing()
method to use it for setVideoCapturer()
.
QBRTCScreenCapturer
as Video Capturer.You are able to receive an information report about the current connection, audio, video tracks, and other useful information. To set a receiving time interval, use the code snippet below.
Then you should use the QBRTCStatsReportCallback
and add them.
The qbrtcStatsReport.audioReceivedCodec()
and qbrtcStatsReport.videoReceivedFps()
are not all you can get from the QBRTCStatsReport
. This is just the example.
Using QBRTCStatsReport
, you can define when your opponent is speaking by using the qbrtcStatsReport.getAudioReceiveOutputLevel()
parameter. This parameter is the microphone level from the participant’s audio track at the moment of collecting the statistics report.
You can change different settings for your calls using the QBRTCConfig
class. All of them are listed below.
If an opponent hasn’t answered you within an answer time interval, then the onUserNotAnswer()
callback will be returned. The answer time interval shows how much time an opponent has to answer your call. Set the answer time interval using the code snippet below.
By default, the answer time interval is 60 seconds.
Set maximum allowed time to repair a connection after it was lost. Set the disconnect time interval using the code snippet below.
By default, the disconnect time interval is 10 seconds.
Dialing time interval indicates how often to notify your opponents about your call. Set the dialing time interval using the code snippet below.
By default, the dialing time interval is 5 seconds.
Set the maximum number of opponents in a group call using the snippet below.
By default, the maximum number of opponents is 10.
You can customize a list of ICE servers. By default, WebRTC module will use internal ICE servers that are usually enough, but you can always set your own. WebRTC engine will choose the TURN relay with the lowest round-trip time. Thus, setting multiple TURN servers allows your application to scale-up in terms of bandwidth and number of users. Review our Setup guide to learn how to configure custom ICE servers.
You can use the QBRTCMediaConfig
class instance to configure a variety of media settings such as video/audio codecs, bitrate, fps, etc.
It’s possible to set a video codec. You can choose from the following values: H264, VP8, and VP9.
You can also set the custom video resolution to provide guarantees for the predictable behavior of the video stream.
Set an audio codec using the snippet below. You can choose from the following values: ISAC and OPUS. Default: ISAC.
It’s possible to set the custom bitrate to provide guarantees for the predictable behavior of the video stream.
Enable hardware acceleration if the device supports it. Default: false.
It’s possible to set the custom fps to provide guarantees for the predictable behavior of the video stream.
Enable a built-in acoustic echo cancellation if the device supports it. Default: true.
Enable open sound library for embedded systems (OpenSL ES audio) if the device supports it. Default: false.
Enable audio processing if the device supports it. Default: true.