hyphenate_SDK3.0  3.6.1
hyphenatejavaIMSDK
| Public 成员函数 | 静态 Public 属性 | Protected 成员函数 | 所有成员列表
com.hyphenate.chat.EMCallManager类 参考

class  CallStateUnion
 
class  EMACallListenerDelegate
 
interface  EMCallPushProvider
 
interface  EMCameraDataProcessor
 

Public 成员函数

String getIncomingCallBroadcastAction ()
 
void setCameraDataProcessor (EMCameraDataProcessor processor)
 
void setPushProvider (EMCallPushProvider provider)
 
CallState getCallState ()
 
EMVideoCallHelper getVideoCallHelper ()
 
void makeVideoCall (String username) throws EMServiceNotReadyException
 
void makeVideoCall (String username, String ext) throws EMServiceNotReadyException
 
void makeVideoCall (String username, String ext, boolean recordOnServer, boolean mergeStream) throws EMServiceNotReadyException
 
void makeVoiceCall (String username) throws EMServiceNotReadyException
 
void makeVoiceCall (String username, String ext) throws EMServiceNotReadyException
 
void makeVoiceCall (String username, String ext, boolean recordOnServer, boolean mergeStream) throws EMServiceNotReadyException
 
void addCallStateChangeListener (EMCallStateChangeListener listener)
 
void removeCallStateChangeListener (EMCallStateChangeListener listener)
 
synchronized void setSurfaceView (EMCallSurfaceView localSurface, EMCallSurfaceView oppositeSurface)
 
void answerCall () throws EMNoActiveCallException
 
void rejectCall () throws EMNoActiveCallException
 
void endCall () throws EMNoActiveCallException
 
boolean isDirectCall ()
 
void pauseVoiceTransfer () throws HyphenateException
 
void resumeVoiceTransfer () throws HyphenateException
 
void pauseVideoTransfer () throws HyphenateException
 
void resumeVideoTransfer () throws HyphenateException
 
void muteRemoteAudio (boolean mute)
 
void muteRemoteVideo (boolean mute)
 
void setCameraFacing (int facing) throws HyphenateException
 
synchronized void switchCamera ()
 
int getCameraFacing ()
 
EMCallOptions getCallOptions ()
 
EMCallSession getCurrentCallSession ()
 
void inputExternalVideoData (byte[] data, int width, int height, int rotation)
 
void inputExternalVideoData (byte[] data, RtcConnection.FORMAT format, int width, int height, int rotation)
 

静态 Public 属性

static final String IncomingCallAction = ".action.incomingcall"
 

Protected 成员函数

 EMCallManager (EMClient client, EMACallManager manager)
 
void changeState (final CallState state, final CallError callError)
 

成员函数说明

◆ addCallStateChangeListener()

void com.hyphenate.chat.EMCallManager.addCallStateChangeListener ( EMCallStateChangeListener  listener)

设置通话状态监听

参数
listener

◆ answerCall()

void com.hyphenate.chat.EMCallManager.answerCall ( ) throws EMNoActiveCallException

接听通话

异常
EMNoActiveCallException

◆ endCall()

void com.hyphenate.chat.EMCallManager.endCall ( ) throws EMNoActiveCallException

挂断通话

异常
EMNoActiveCallException

◆ getCameraFacing()

int com.hyphenate.chat.EMCallManager.getCameraFacing ( )

获取当前正在使用的摄像头

返回
值可以是

◆ inputExternalVideoData() [1/2]

void com.hyphenate.chat.EMCallManager.inputExternalVideoData ( byte []  data,
int  width,
int  height,
int  rotation 
)

从外部直接输入视频数据, 仅支持NV21数据格式

参数
data
width
height
rotation

◆ inputExternalVideoData() [2/2]

void com.hyphenate.chat.EMCallManager.inputExternalVideoData ( byte []  data,
RtcConnection.FORMAT  format,
int  width,
int  height,
int  rotation 
)

从外部直接输入视频数据

参数
data
width
height
rotation

◆ isDirectCall()

boolean com.hyphenate.chat.EMCallManager.isDirectCall ( )

返回当前通话时是否为P2P直连

返回

◆ makeVideoCall() [1/3]

void com.hyphenate.chat.EMCallManager.makeVideoCall ( String  username) throws EMServiceNotReadyException

发起呼叫,进行视频通话请求,进行视频呼叫前,请先在Activity.onCreate中先执行setSurfaceView。

参数
username被呼叫的用户id
异常
EMServiceNotReadyException呼叫过程中遇到异常

◆ makeVideoCall() [2/3]

void com.hyphenate.chat.EMCallManager.makeVideoCall ( String  username,
String  ext 
) throws EMServiceNotReadyException

发起呼叫,进行视频通话请求,进行视频呼叫前,请先在Activity.onCreate中先执行setSurfaceView。

参数
username被呼叫的用户id
ext扩展字段,用户可以用来传输自定义的内容
异常
EMServiceNotReadyException呼叫过程中遇到异常

◆ makeVideoCall() [3/3]

void com.hyphenate.chat.EMCallManager.makeVideoCall ( String  username,
String  ext,
boolean  recordOnServer,
boolean  mergeStream 
) throws EMServiceNotReadyException

发起呼叫,进行视频通话请求,进行视频呼叫前,请先在Activity.onCreate中先执行setSurfaceView。

参数
username被呼叫的用户id
ext扩展字段,用户可以用来传输自定义的内容
recordOnServer是否在服务器端录制该通话
mergeStream服务器端录制时是否合并流
异常
EMServiceNotReadyException呼叫过程中遇到异常

◆ makeVoiceCall() [1/3]

void com.hyphenate.chat.EMCallManager.makeVoiceCall ( String  username) throws EMServiceNotReadyException

发起呼叫,进行语音通话请求

参数
username被呼叫的用户id
异常
EMServiceNotReadyException呼叫过程中遇到异常 如果IM没有连接,或者之前通话的连接没有断开,会抛出次异常

◆ makeVoiceCall() [2/3]

void com.hyphenate.chat.EMCallManager.makeVoiceCall ( String  username,
String  ext 
) throws EMServiceNotReadyException

发起呼叫,进行语音通话请求

参数
username被呼叫的用户id
ext扩展字段,用户可以用来传输自定义的内容
异常
EMServiceNotReadyException呼叫过程中遇到异常 如果IM没有连接,或者之前通话的连接没有断开,会抛出次异常

◆ makeVoiceCall() [3/3]

void com.hyphenate.chat.EMCallManager.makeVoiceCall ( String  username,
String  ext,
boolean  recordOnServer,
boolean  mergeStream 
) throws EMServiceNotReadyException

发起呼叫,进行语音通话请求

参数
username被呼叫的用户id
ext扩展字段,用户可以用来传输自定义的内容
recordOnServer是否在服务器端录制该通话
mergeStream服务器端录制时是否合并流
异常
EMServiceNotReadyException呼叫过程中遇到异常 如果IM没有连接,或者之前通话的连接没有断开,会抛出次异常

◆ muteRemoteAudio()

void com.hyphenate.chat.EMCallManager.muteRemoteAudio ( boolean  mute)

mute远端音频

◆ muteRemoteVideo()

void com.hyphenate.chat.EMCallManager.muteRemoteVideo ( boolean  mute)

~\chinese mute远端视频

◆ pauseVideoTransfer()

void com.hyphenate.chat.EMCallManager.pauseVideoTransfer ( ) throws HyphenateException

实时通话时停止视频数据传输

◆ pauseVoiceTransfer()

void com.hyphenate.chat.EMCallManager.pauseVoiceTransfer ( ) throws HyphenateException

实时通话时暂停语音数据传输

◆ rejectCall()

void com.hyphenate.chat.EMCallManager.rejectCall ( ) throws EMNoActiveCallException

拒绝接听

异常
EMNoActiveCallException

◆ removeCallStateChangeListener()

void com.hyphenate.chat.EMCallManager.removeCallStateChangeListener ( EMCallStateChangeListener  listener)

移除通话监听

参数
listener

◆ resumeVideoTransfer()

void com.hyphenate.chat.EMCallManager.resumeVideoTransfer ( ) throws HyphenateException

实时通话时恢复视频数据传输

◆ resumeVoiceTransfer()

void com.hyphenate.chat.EMCallManager.resumeVoiceTransfer ( ) throws HyphenateException

实时通话时恢复语音数据传输

◆ setCameraDataProcessor()

void com.hyphenate.chat.EMCallManager.setCameraDataProcessor ( EMCameraDataProcessor  processor)

Not implemented. This method will be removed in future versions.

参数
processor

◆ setCameraFacing()

void com.hyphenate.chat.EMCallManager.setCameraFacing ( int  facing) throws HyphenateException

开启相机拍摄

参数
facing参数可以是CameraInfo.CAMERA_FACING_BACK, 或者CameraInfo.CAMERA_FACING_FRONT
异常
HyphenateException如果cameraIndex不是CameraInfo.CAMERA_FACING_BACK,也不是CameraInfo.CAMERA_FACING_FRONT,会抛出异常.

◆ setSurfaceView()

synchronized void com.hyphenate.chat.EMCallManager.setSurfaceView ( EMCallSurfaceView  localSurface,
EMCallSurfaceView  oppositeSurface 
)

这里一定要在{Activity::onCreate()}方法中调用,防止无法准确获取到 surface 大小

参数
localSurface默认本地预览画面控件
oppositeSurface默认远端画面控件

该类的文档由以下文件生成: