public abstract class AVChatManagerLite
extends java.lang.Object
A unified interface for audio and video calls. All interfaces must run on the main thread.
Android JELLY_BEAN
or later is required All required permissions are granted before calling. Check permissions using AVChatManager.checkPermission(Context)
.
Only one session is supported at the same time. If multiple calls comes, you must choose a preferred session and hang out rest calls If system phone call rings or a system phone is connected, it is recommended to hang up the network call.
For the setting of outgoing and incoming timeouts for network calls, use a timer to respond calls. The timeout setting in the SDK has been deprecated and will be removed.
VoIP calls are divided into two categories, P2P calls and group calls.
All audio and video calls have observers: observeAVChatState(AVChatStateObserverLite, boolean)
P2P calls include signaling and audio and video operations. Signaling handles session initiation, answering, rejecting, and hanging up. Interfaces:
call2(String, AVChatType, AVChatNotifyOption, AVChatCallback)
initiate a call. accept2(long, AVChatCallback)
accept a call. hangUp2(long, AVChatCallback)
hang up a call sendControlCommand(long, byte, AVChatCallback)
Send control commands. Users can define custom commands We recommend you switch audio and video calls using this interface Observer for P2P calls:
observeIncomingCall(Observer, boolean)
Observer for incoming calls observeCalleeAckNotification(Observer, boolean)
Observer for callee responses observeControlNotification(Observer, boolean)
Observer for all control commands observeHangUpNotification(Observer, boolean)
Observer for callee hang up observeOnlineAckNotification(Observer, boolean)
Observer for response from other devices Group calls and interactive live streams belong to this mode This mode does not include all signaling operations, and is customized by the upper layer of the app client. This mode only includes joining and leaving a room, and audio and video operations. Interfaces:
createRoom(String, String, AVChatCallback)
Create a room for group calls joinRoom2(String, AVChatType, AVChatCallback)
Join a group room leaveRoom2(String, AVChatCallback)
Leave a room Interactive live broadcast and group conferencing procdure:
createRoom(String, String, AVChatCallback)
. If a host creates a room, the server reserves a room name. The room is valid for 30 days if it is not used. The used room will be recycled after all users leave the room. observeAVChatState(AVChatStateObserverLite, boolean)
enableRtc()
. setChannelProfile(int)
. AVChatParameters.KEY_SESSION_LIVE_MODE
, AVChatParameters.KEY_SESSION_LIVE_URL
. enableVideo()
. setupVideoCapturer(AVChatVideoCapturer)
. setupLocalVideoRender(IVideoRender, boolean, int)
. setParameter(AVChatParameters.Key, Object)
, setParameters(AVChatParameters)
. enableVideo()
. joinRoom2(String, AVChatType, AVChatCallback)
. stopVideoPreview()
disableVideo()
()} leaveRoom2(String, AVChatCallback)
disableRtc()
。 P2P video call procdure:
observeAVChatState(AVChatStateObserverLite, boolean)
enableRtc()
. setChannelProfile(int)
. enableVideo()
. setupVideoCapturer(AVChatVideoCapturer)
. setupLocalVideoRender(IVideoRender, boolean, int)
setParameter(AVChatParameters.Key, Object)
, setParameters(AVChatParameters)
. enableVideo()
. call2(String, AVChatType, AVChatNotifyOption, AVChatCallback)
, accept2(long, AVChatCallback)
. stopVideoPreview()
disableVideo()
()} hangUp2(long, AVChatCallback)
. disableRtc()
。 Constructor and Description |
---|
AVChatManagerLite() |
Modifier and Type | Method and Description |
---|---|
abstract void |
accept2(long chatId,
AVChatCallback<java.lang.Void> callback)
Answer P2P calls on the Signaling layer
|
abstract void |
call2(java.lang.String account,
AVChatType callType,
AVChatNotifyOption notifyOption,
AVChatCallback<AVChatData> callback)
Initiates a P2P call using Signaling
|
abstract void |
createRoom(java.lang.String roomName,
java.lang.String extraMessage,
AVChatCallback<AVChatChannelInfo> callback)
Create a group call room
|
abstract void |
createRoom(java.lang.String roomName,
java.lang.String extraMessage,
java.util.List<AVChatLiveTaskConfig> liveConfigList,
AVChatCallback<AVChatChannelInfo> callback)
Create a group room and set parameters for live streaming
|
abstract boolean |
disableRtc()
Close the RTC engine
|
abstract boolean |
disableVideo()
Deactivate the video module
|
abstract boolean |
enableRtc()
activate the RTC engine
|
abstract boolean |
enableRtc(AVChatEngineConfig config)
activate the RTC engine
|
abstract boolean |
enableRtc(AVChatServerAddresses serverAddresses)
Deprecated.
enableRtc(AVChatEngineConfig) is recommended |
abstract boolean |
enableRtc(int osType)
Deprecated.
enableRtc(AVChatEngineConfig) is recommended |
abstract boolean |
enableRtc(int osType,
boolean lowEnergy)
Deprecated.
enableRtc(AVChatEngineConfig) is recommended |
abstract boolean |
enableRtc(int osType,
boolean lowEnergy,
AVChatServerAddresses address)
Deprecated.
enableRtc(AVChatEngineConfig) is recommended |
abstract boolean |
enableVideo()
Activate the video module
|
abstract long |
getCurrentChatId()
Get the session ID
|
static AVChatManagerLite |
getInstance()
Get basic audio and video call
|
abstract <T> T |
getParameter(AVChatParameters.Key<T> key)
Get parameters
For information about parameter types, see
AVChatParameters.Key#type() . |
abstract AVChatParameters |
getParameters(AVChatParameters params)
Get parameters
For information about parameter types, see
AVChatParameters.Key#type() . |
abstract java.lang.Long |
getUidByAccount(java.lang.String account)
Get uid using account
|
abstract void |
hangUp2(long chatId,
AVChatCallback<java.lang.Void> callback)
Hang up or reject a call in Signaling
|
abstract boolean |
isAllRemoteAudioMuted()
Mute remote audio streams
|
abstract boolean |
isLocalAudioMuted()
Check if local audio is muted
|
abstract boolean |
isLocalVideoMuted()
Check if the local video is published.
|
abstract boolean |
isMicrophoneMute()
Check if the microphone is muted
|
abstract boolean |
isRemoteAudioMuted(java.lang.String account)
Mute or unmute remote audio streams
|
abstract boolean |
isRemoteVideoMuted(java.lang.String account)
Check if remote video streams are muted
|
abstract void |
joinRoom2(java.lang.String roomName,
AVChatType callType,
AVChatCallback<AVChatData> callback)
Join a group room
|
abstract void |
leaveRoom2(java.lang.String roomName,
AVChatCallback<java.lang.Void> callback)
Leave a group room
|
abstract void |
muteAllRemoteAudio(boolean muted)
Mute or unmute all remote audio streams
|
abstract void |
muteLocalAudio(boolean muted)
Mute or unmute local audio
|
abstract void |
muteLocalVideo(boolean muted)
Deprecated.
|
abstract void |
muteRemoteAudio(java.lang.String account,
boolean muted)
Mute or unmute the remote audio stream
|
abstract void |
muteRemoteVideo(java.lang.String account,
boolean muted)
|
abstract void |
observeAVChatState(AVChatStateObserverLite observer,
boolean register)
Register or unregister the observer for call states
All call states are notified using
AVChatStateObserverLite . |
abstract void |
observeCalleeAckNotification(Observer<AVChatCalleeAckEvent> observer,
boolean register)
Register or unregister the observer for callee responses (answer, reject, or busy)
|
abstract void |
observeControlNotification(Observer<AVChatControlEvent> observer,
boolean register)
Register or unregister the observer for call control messages (switching between audio and video calls)
|
abstract void |
observeHangUpNotification(Observer<AVChatCommonEvent> observer,
boolean register)
Register or unregister the observer for hanging up calls
|
abstract void |
observeIncomingCall(Observer<AVChatData> observer,
boolean register)
Register or unregister the observer for incoming calls
When receiving a call, the upper-layer will be notified of the call info.
|
abstract void |
observeOnlineAckNotification(Observer<AVChatOnlineAckEvent> observer,
boolean register)
Register or unregister the observer for responses from other devices of the callee.
|
abstract void |
rate(int rate,
java.lang.String description)
Rate the current call
|
abstract void |
selectAudioDevice(int audioDevice)
Select the audio device
The availabe devices are returned by
AVChatStateObserverLite.onAudioDeviceChanged(int, java.util.Set<java.lang.Integer>, boolean) |
abstract void |
sendControlCommand(long chatId,
byte controlCommand,
AVChatCallback<java.lang.Void> callback)
Common signaling for message sending
|
abstract boolean |
setChannelProfile(int profile)
Voice call mode settings
|
abstract void |
setMicrophoneMute(boolean mute)
Mute or unmute the microphone
|
abstract <T> void |
setParameter(AVChatParameters.Key<T> key,
T value)
Set parameteers.
|
abstract void |
setParameters(AVChatParameters params)
Set parameters.
|
abstract void |
setSpeaker(boolean enable)
set the speaker
|
abstract boolean |
setupLocalVideoRender(IVideoRender render,
boolean mirror,
int scalingType)
Sets a local video canvas.
|
abstract boolean |
setupRemoteVideoRender(java.lang.String account,
IVideoRender render,
boolean mirror,
int scalingType)
Set the canvas for a remote video stream.
|
abstract boolean |
setupVideoCapturer(AVChatVideoCapturer videoCapturer)
Video data feed
|
abstract boolean |
setVideoQualityStrategy(int strategy)
Video quality policy setting
|
abstract boolean |
speakerEnabled()
Check if the speaker is enabled
|
abstract boolean |
startVideoPreview()
Enable the local video preview
|
abstract boolean |
stopVideoPreview()
Close the local video preview
|
public static AVChatManagerLite getInstance()
Get basic audio and video call
Basic audio and video call To use audio mixing and recording, use the AVChatManager
interface.
AVChatManagerLite
public abstract boolean enableRtc()
activate the RTC engine
Before starting an audio and video call, you must call this interface to activate the audio and video call engine.
Otherwise, all subsequent interface calls will throw exceptions. If the method call succeeds, call disableRtc()
to release the resources used by the engine. Otherwise tresource leaks may occur
true
: success. false
: failuredisableRtc()
@Deprecated public abstract boolean enableRtc(int osType)
enableRtc(AVChatEngineConfig)
is recommendedactivate the RTC engine
Before starting an audio and video call, you must call this interface to activate the audio and video call engine.
Otherwise, all subsequent interface calls will throw exceptions. If the method call succeeds, call disableRtc()
to release the resources used by the engine. Otherwise tresource leaks may occur
osType
- AVChatOSCategory
true
: success. false
: failure.disableRtc()
@Deprecated public abstract boolean enableRtc(AVChatServerAddresses serverAddresses)
enableRtc(AVChatEngineConfig)
is recommendedactivate the RTC engine
Before starting an audio and video call, you must call this interface to activate the audio and video call engine.
Otherwise, all subsequent interface calls will throw exceptions. If the method call succeeds, call disableRtc()
to release the resources used by the engine. Otherwise tresource leaks may occur
serverAddresses
- On-premises server addresstrue
: success. false
: failure.disableRtc()
@Deprecated public abstract boolean enableRtc(int osType, boolean lowEnergy)
enableRtc(AVChatEngineConfig)
is recommendedactivate the RTC engine
Before starting an audio and video call, you must call this interface to activate the audio and video call engine.
Otherwise, all subsequent interface calls will throw exceptions. If the method call succeeds, call disableRtc()
to release the resources used by the engine. Otherwise tresource leaks may occur
osType
- AVChatOSCategory
lowEnergy
- specify whether to enable the low energy modetrue
: success. false
: failure.disableRtc()
@Deprecated public abstract boolean enableRtc(int osType, boolean lowEnergy, AVChatServerAddresses address)
enableRtc(AVChatEngineConfig)
is recommendedactivate the RTC engine
Before starting an audio and video call, you must call this interface to activate the audio and video call engine.
Otherwise, all subsequent interface calls will throw exceptions. If the method call succeeds, call disableRtc()
to release the resources used by the engine. Otherwise tresource leaks may occur
osType
- AVChatOSCategory
lowEnergy
- specify whether to enable the low energy modeaddress
- On-premises server addresstrue
: success. false
: failure.disableRtc()
public abstract boolean enableRtc(AVChatEngineConfig config)
activate the RTC engine
Before starting an audio and video call, you must call this interface to activate the audio and video call engine.
Otherwise, all subsequent interface calls will throw exceptions. If the method call succeeds, call disableRtc()
to release the resources used by the engine. Otherwise tresource leaks may occur
config
- engine configuration, such as: osType, lowEnergy, serverAddresses, encryptType, and encryptKey AVChatEngineConfig.Builder
true
: success. false
: failure.disableRtc()
public abstract boolean disableRtc()
Close the RTC engine
After ending an audio and video call, you must call this interface to close the audio and video call engine to release resources. After closing the audio and video engine, all subsequent calls will fail or throw exceptions
true
: success. false
: failure.enableRtc()
public abstract boolean enableVideo()
Activate the video module
If you have video content during the call, you must activate the video module before calling the video interface.
Call disableVideo()
to close the video module before the call ends.
The interface allows you to switch audio and video call modes during the call
The signaling layer can be notified by using sendControlCommand(long, byte, AVChatCallback)
Switch the current mode of the peer. By default the video module is not activated.
true
: success. false
: failure.disableVideo()
public abstract boolean disableVideo()
Deactivate the video module
Deactivate the video module The engine will switch to the audio call mode if you call the interface during a call. To notify the peer on the signaling layer, call
sendControlCommand(long, byte, AVChatCallback)
.
true
: success. false
: failure.enableVideo()
public abstract void call2(java.lang.String account, AVChatType callType, AVChatNotifyOption notifyOption, AVChatCallback<AVChatData> callback)
Initiates a P2P call using Signaling
Initiate a call at the signaling layer. After calling this interface, the peer will receive the corresponding session notification. During the call, the upper layer needs to implement a timer. When the peer does not answer after a certain period of time
call hangUp2(long, AVChatCallback)
to hang out the call.
Essential fields for initiating calls:
AVChatNotifyOption.extendMessage
extension fields. The callee can receive the information in the field. AVChatNotifyOption.forceKeepCalling
Keep calling even if the peer is offline. Otherwise it will return failure. Before initiating a call from the signaling layer, you must call the following interfaces:
enableRtc()
- optional. Set the local preview canvas ,{@link AVChatManagerLite#setupLocalVideoRender(IVideoRender, boolean, int)}
- optional. Enable the video preview, {@link AVChatManagerLite#startVideoPreview()}
- Optional, call settings @link AVChatManagerLite#setParameters(AVChatParameters)
,account
- peer accountcallType
- call type: audio and videonotifyOption
- optional notification parametercallback
- callback that returns AVChatData
accept2(long, AVChatCallback)
,
hangUp2(long, AVChatCallback)
public abstract void accept2(long chatId, AVChatCallback<java.lang.Void> callback)
Answer P2P calls on the Signaling layer
Register observeIncomingCall(Observer, boolean)
when an app starts. If other users
make calls, the current user will get notification for missed calls. The notification may show up on the screen. To answer the call, you can invoke the interface. If you want to reject the call, invoke
hangUp2(long, AVChatCallback)
.
After answering the call, the engine will automatically connect to the pre-defined media server. The result will be notified using
AVChatStateObserverLite.onJoinedChannel(int, String, String, int)
.
Before initiating a call from the signaling layer, you must call the following interfaces:
enableRtc()
- optional. Set the local preview canvas ,{@link AVChatManagerLite#setupLocalVideoRender(IVideoRender, boolean, int)}
- optional. Enable the video preview, {@link AVChatManagerLite#startVideoPreview()}
- Optional, call settings @link AVChatManagerLite#setParameters(AVChatParameters)
,chatId
- session IDcallback
- callback that returns whether the local audio and video device is successfully started after answering the call.
onSuccess: success; onFailed indicates failure. Error code -1: failed to initialize the engine and need to retry.
Note: The audio and video engine destructor takes time to release resources for the call. Keep more than 2 seconds between the last call and the current call. Otherwise it may fail to initialize the engine when answering (code = -1).call2(String, AVChatType, AVChatNotifyOption, AVChatCallback)
,
hangUp2(long, AVChatCallback)
public abstract void hangUp2(long chatId, AVChatCallback<java.lang.Void> callback)
Hang up or reject a call in Signaling
Register observeIncomingCall(Observer, boolean)
when an app starts. If other users
make calls, the current user will get notification for missed calls. The notification may show up on the screen. To Reject the call, you can invoke the interface. If you want to Answer the call, invoke
accept2(long, AVChatCallback)
。
If this interface is called during the call, the call will be hung up, and the peer will receive the notification.
This interface only hangs up the call in the signaling layer. If you want to destroy the engine to release resources, you must call the following interfaces:
disableVideo()
}
disableRtc()
chatId
- session ID. Session IDs are used in notifications for initiating or receiving a call. When hanging up, you must specify a session ID. If the session ID has not been returned during the call, pass in 0 to hang up the calling session.callback
- callbackcall2(String, AVChatType, AVChatNotifyOption, AVChatCallback)
,
accept2(long, AVChatCallback)
public abstract void createRoom(java.lang.String roomName, java.lang.String extraMessage, AVChatCallback<AVChatChannelInfo> callback)
Create a group call room
If you want to use group conferencing and interactive live streaming, you must create a group room using this interface,
and call joinRoom2(String, AVChatType, AVChatCallback)
to join the room
If a room is created, it will always be reserved. The validity period is one month. The room will expires after the validity period.
If a room is already created, it will return failure when creating it again, indicating that the room already exists.
The time for creating a room is not limited by the audio and video call process, and you can book your group conference room at any time. After the room is created, all participants will be notified to join this room,
You will get notified by AVChatStateObserverLite.onUserJoined(String)
for the participants
roomName
- room nameextraMessage
- Custom extension message. Users who join the room will receive the messagecallback
- callback for creating a roomAVChatResCode.ERROR_CREATE_ROOM_ALREADY_EXIST
,
createRoom(String, String, AVChatCallback)
,
joinRoom2(String, AVChatType, AVChatCallback)
,
leaveRoom2(String, AVChatCallback)
public abstract void createRoom(java.lang.String roomName, java.lang.String extraMessage, java.util.List<AVChatLiveTaskConfig> liveConfigList, AVChatCallback<AVChatChannelInfo> callback)
Create a group room and set parameters for live streaming
If you want to use group conferencing and interactive live streaming, you must create a group room using this interface,
and call joinRoom2(String, AVChatType, AVChatCallback)
to join the room
If a room is created, it will always be reserved. The validity period is one month. The room will expires after the validity period.
If a room is already created, it will return failure when creating it again, indicating that the room already exists.
The time for creating a room is not limited by the audio and video call process, and you can book your group conference room at any time. After the room is created, all participants will be notified to join this room,
You will get notified by AVChatStateObserverLite.onUserJoined(String)
for the participants
roomName
- room nameextraMessage
- Custom extension message. Users who join the room will receive the messageliveConfigList
- The live streaming configuration. You can configure multiple Configuration files and publish multiple different streams. If you do not need to push streaming, enter null. AVChatParameters.KEY_SESSION_LIVE_MODE
callback
- callback for creating a roomAVChatLiveTaskConfig
,
AVChatParameters.KEY_SESSION_LIVE_MODE
,
AVChatResCode.ERROR_CREATE_ROOM_ALREADY_EXIST
,
createRoom(String, String, List, AVChatCallback)
,
joinRoom2(String, AVChatType, AVChatCallback)
,
leaveRoom2(String, AVChatCallback)
public abstract void joinRoom2(java.lang.String roomName, AVChatType callType, AVChatCallback<AVChatData> callback)
Join a group room
Before joining a group room, you must call the following interfaces:
enableRtc()
- optional. Set the local preview canvas ,{@link AVChatManagerLite#setupLocalVideoRender(IVideoRender, boolean, int)}
- optional. Enable the video preview, {@link AVChatManagerLite#startVideoPreview()}
- Optional, call settings @link AVChatManagerLite#setParameters(AVChatParameters)
,If you join the meeting successfully, you will get notified by AVChatStateObserverLite.onUserJoined(String)
for the existing users in the meeting room.
Leave the room by calling leaveRoom2(String, AVChatCallback)
Other participants will not get notified from signaling but the media layer using AVChatStateObserverLite.onUserJoined(String)
.
For interactive live streaming, you must set the following parameters setParameter(AVChatParameters.Key, Object)
:
AVChatParameters.KEY_SESSION_LIVE_MODE
AVChatParameters.KEY_SESSION_LIVE_URL
roomName
- room namecallType
- call typecallback
- callback for joining a roomcreateRoom(String, String, AVChatCallback)
,
leaveRoom2(String, AVChatCallback)
public abstract void leaveRoom2(java.lang.String roomName, AVChatCallback<java.lang.Void> callback)
Leave a group room
This interface only allows users to leave the room. If you want to destroy the engine to release resources, you must call the following interfaces:
disableVideo()
}
disableRtc()
Other participants will not get notified from Signaling but the media layer using AVChatStateObserverLite.onUserLeave(String, int)
.
roomName
- room namecallback
- callback for leaving a roomcreateRoom(String, String, AVChatCallback)
,
joinRoom2(String, AVChatType, AVChatCallback)
public abstract void sendControlCommand(long chatId, byte controlCommand, AVChatCallback<java.lang.Void> callback)
Common signaling for message sending
During a call, you can send signaling messages to notify other participants in the room.
If observeControlNotification(Observer, boolean)
is registered, participants will
receive your message.
SDK provides some common signaling controls. For more information, see AVChatControlCommand
. You can use the commands for sending and switching the call mode.
If you want to use your commands, you can define custom commands in AVChatControlCommand.NOTIFY_CUSTOM_BASE
.
The sending and receiving commands by signaling only transfer messages in pass-through mode and will not affect any logic inside the SDK. To respond to the received command, call other engine interfaces.
chatId
- session IDcontrolCommand
- control command valuecallback
- callbackAVChatControlCommand
public abstract long getCurrentChatId()
Get the session ID
Each session has a unique ID, and the SDK only allows one session at a time. If a session is ongoing, you can get the session ID using this interface.
call2(String, AVChatType, AVChatNotifyOption, AVChatCallback)
accept2(long, AVChatCallback)
returns the current session ID when the callback is triggered
public abstract java.lang.Long getUidByAccount(java.lang.String account)
public abstract boolean setChannelProfile(int profile)
Voice call mode settings
You can set the voice profile before the call. Two voice modes are supported.
AVChatChannelProfile.CHANNEL_PROFILE_DEFAULT
default audio profileAVChatChannelProfile.CHANNEL_PROFILE_HIGH_QUALITY_MUSIC
HD audio modeNote: The HD music profile is used only for earpieces. If the HD music profile is used in other uses cases, the sound quality may degraded.
profile
- Audio profiletrue
: success. false
: failure.AVChatChannelProfile
public abstract boolean setVideoQualityStrategy(int strategy)
Video quality policy setting
Video quality supports three modes:
strategy
- strategy type AVChatVideoQualityStrategy
true
: success. false
: failure.AVChatVideoQualityStrategy
public abstract boolean setupVideoCapturer(AVChatVideoCapturer videoCapturer)
Video data feed
A video data source must be specified for making a video call. This method must be called before startVideoPreview()
.
The SDK supports multiple video data sources:
AVChatVideoCapturerFactory.createCameraPolicyCapturer(boolean)
to create a camera data source. AVChatExternalVideoCapturer
. videoCapturer
- Video data feedtrue
: success. false
: failure.AVChatCameraCapturer
,
AVChatVideoCapturerFactory.createCameraPolicyCapturer(boolean)
,
AVChatExternalVideoCapturer
public abstract boolean startVideoPreview()
Enable the local video preview
Before enabling the video preview, you must call enableVideo()
to open the video module and set the video data source using setupVideoCapturer(AVChatVideoCapturer)
.
If you need to render video content, call setupLocalVideoRender(IVideoRender, boolean, int)
to set the local preview canvas.
true
: success. false
: failure.public abstract boolean stopVideoPreview()
Close the local video preview
During a video call, you can use the video preview at any time. After calling this method, local video preview and video data sending will stop.
true
: success. false
: failure.public abstract void setParameters(AVChatParameters params) throws java.lang.IllegalArgumentException
AVChatParameters.Key#type()
.
For information about the runtime, see AVChatParameters.Key#runtime()
. runtime
allows operations during a call. If not, set the parameter before making a call.
For information about the values, see AVChatParameters.Key#writable()
. writable
allows you to set values. If not, values can only be readparams
- parameters to be setjava.lang.IllegalArgumentException
- Invalid values or exceptionsAVChatParameters
,
AVChatParameters.Key
,
AVChatMediaCodecMode
,
AVChatAudioEffectMode
public abstract <T> void setParameter(AVChatParameters.Key<T> key, T value) throws java.lang.IllegalArgumentException
AVChatParameters.Key#type()
.
For information about the runtime, see AVChatParameters.Key#runtime()
. runtime
allows operations during a call. If not, set the parameter before making a call.
For information about the values, see AVChatParameters.Key#writable()
. writable
allows you to set values. If not, values can only be readT
- data typekey
- parameter keyvalue
- valuejava.lang.IllegalArgumentException
- Invalid values or exceptionsAVChatParameters
,
AVChatParameters.Key
,
AVChatMediaCodecMode
,
AVChatAudioEffectMode
public abstract AVChatParameters getParameters(AVChatParameters params)
AVChatParameters.Key#type()
.
For information about the runtime, see AVChatParameters.Key#runtime()
. runtime
allows operations during a call. If not, set the parameter before making a call.
For information about the values, see AVChatParameters.Key#writable()
. writable
allows you to set values. If not, values can only be readparams
- the parameter required. null
: get all parametersAVChatParameters
,
AVChatParameters.Key
,
AVChatMediaCodecMode
,
AVChatAudioEffectMode
public abstract <T> T getParameter(AVChatParameters.Key<T> key)
AVChatParameters.Key#type()
.
For information about the runtime, see AVChatParameters.Key#runtime()
. runtime
allows operations during a call. If not, set the parameter before making a call.
For information about the values, see AVChatParameters.Key#writable()
. writable
allows you to set values. If not, values can only be readT
- parameter typekey
- parameter keyAVChatParameters
,
AVChatParameters.Key
,
AVChatMediaCodecMode
,
AVChatAudioEffectMode
public abstract boolean isLocalAudioMuted()
true
: muted. false
: unmuted.muteLocalAudio(boolean)
public abstract boolean isLocalVideoMuted()
true
: paused, false
: publishedpublic abstract void muteLocalAudio(boolean muted)
muted
- true
: muted. false
: unmuted@Deprecated public abstract void muteLocalVideo(boolean muted)
AVChatManager.publishVideo()
()} and AVChatManager.unpublishVideo()
muted
- true
: muted. false
unmutedpublic abstract void setSpeaker(boolean enable)
enable
- true
: enable the speaker. false
: disable the speakerpublic abstract boolean speakerEnabled()
true
: enabled. false
: disabledpublic abstract void setMicrophoneMute(boolean mute)
mute
- mute the microphonepublic abstract boolean isMicrophoneMute()
public abstract void muteRemoteAudio(java.lang.String account, boolean muted)
account
- User accountmuted
- true
: mute the remote audio stream. false
unmute the remote audio streampublic abstract void muteAllRemoteAudio(boolean muted)
muted
- true
: mute the remote audio stream. false
unmute the remote audio streampublic abstract void selectAudioDevice(int audioDevice)
AVChatStateObserverLite.onAudioDeviceChanged(int, java.util.Set<java.lang.Integer>, boolean)
audioDevice
- AVChatAudioDevice
@Deprecated public abstract void muteRemoteVideo(java.lang.String account, boolean muted)
AVChatManager.unsubscribeVideo(String account)
and AVChatManager.subscribeVideo(String account, int videoType)
account
- User accountmuted
- true
: mute remote video streams. false
unmute remote video streamspublic abstract boolean isRemoteAudioMuted(java.lang.String account)
account
- User accountpublic abstract boolean isAllRemoteAudioMuted()
public abstract boolean isRemoteVideoMuted(java.lang.String account)
account
- User accountpublic abstract boolean setupLocalVideoRender(IVideoRender render, boolean mirror, int scalingType)
AVChatStateObserver#onCallEstablished
.render
- canvas. AVChatSurfaceViewRenderer
, AVChatExternalVideoRender
, AVChatTextureViewRenderer
mirror
- render a mirror. The parameter is valid if the canvas is set to AVChatSurfaceViewRenderer
.scalingType
- Scaling type. The parameter is valid if the canvas is set to AVChatSurfaceViewRenderer
true
: success. false
: failure.AVChatVideoScalingType
public abstract boolean setupRemoteVideoRender(java.lang.String account, IVideoRender render, boolean mirror, int scalingType)
AVChatStateObserver#onUserJoined
.account
- user accountrender
- canvas, AVChatSurfaceViewRenderer
, AVChatExternalVideoRender
, AVChatTextureViewRenderer
mirror
- render a mirror. The parameter is valid if the canvas is set to AVChatSurfaceViewRenderer
.scalingType
- Scaling type. The parameter is valid if the canvas is set to AVChatSurfaceViewRenderer
true
: success. false
: failure.AVChatVideoScalingType
public abstract void observeIncomingCall(Observer<AVChatData> observer, boolean register)
accept2(long, AVChatCallback)
or hang up the call using hangUp2(long, AVChatCallback)
In most cases, when receiving a call, the upper layer mains a timer. If the call is not answered for a period, call
hangUp2(long, AVChatCallback)
to hang up the call.
When the user is answering a call and receives an incoming call, he needs to choose whether to answer the incoming call or continue the ongoing call. To answer the incoming call, invoke
hangUp2(long, AVChatCallback)
to hang up the ongoing call and accept the incoming call by accept2(long, AVChatCallback)
*
To continue the ongoing call and hang up the incoming call, you can send a busy indicator using sendControlCommand(long, byte, AVChatCallback)
,
then hang up the incoming call by hangUp2(long, AVChatCallback)
observer
- The observer. The parameter is the call inforegister
- true
: register the listener, false
: unregister the listenerpublic abstract void observeAVChatState(AVChatStateObserverLite observer, boolean register)
AVChatStateObserverLite
.observer
- The observer. The parameter is the call stateregister
- true
: register the listener, false
: unregister the listenerpublic abstract void observeCalleeAckNotification(Observer<AVChatCalleeAckEvent> observer, boolean register)
observer
- The observer. The parameter is the received notification messages.register
- true
: register the listener, false
: unregister the listenerpublic abstract void observeOnlineAckNotification(Observer<AVChatOnlineAckEvent> observer, boolean register)
observer
- The observer. The parameter is the notification for responses from other devices of the callee.register
- true
: register the listener, false
: unregister the listenerpublic abstract void observeHangUpNotification(Observer<AVChatCommonEvent> observer, boolean register)
observer
- The observer. The parameter is the notification for hang-upregister
- true
: register the listener, false
: unregister the listenerpublic abstract void observeControlNotification(Observer<AVChatControlEvent> observer, boolean register)
Notifications for Session control commands. Users can define custom private control commands.
observer
- The observer. The parameter is the call control message.register
- true
: register the listener, false
: unregister the listenerpublic abstract void rate(int rate, java.lang.String description)
rate
- 0~5 pointsdescription
- call info