被 com.juphoon.cloud.JCCallImpl 继承.
|
abstract boolean | call (String userId, boolean video, @Nullable CallParam callParam) |
|
abstract boolean | term (@NonNull JCCallItem item, @CallReason int reason, String description) |
|
abstract boolean | answer (@NonNull JCCallItem item, boolean video) |
|
abstract boolean | mute (@NonNull JCCallItem item) |
|
abstract boolean | muteSpeaker (@NonNull JCCallItem item, boolean mute) |
|
abstract boolean | muteMicrophone (@NonNull JCCallItem item, boolean mute) |
|
abstract boolean | hold (@NonNull JCCallItem item) |
|
abstract boolean | audioRecord (@NonNull JCCallItem item, boolean enable, String filePath) |
|
abstract boolean | videoRecord (@NonNull JCCallItem item, boolean enable, boolean remote, int width, int height, String filePath, boolean bothAudio) |
|
abstract boolean | becomeActive (@NonNull JCCallItem item) |
|
abstract boolean | enableUploadVideoStream (@NonNull JCCallItem item) |
|
abstract List< JCCallItem > | getCallItems () |
|
abstract JCCallItem | getActiveCallItem () |
|
abstract boolean | sendMessage (@NonNull JCCallItem item, String type, String content) |
|
abstract String | getStatistics () |
|
abstract void | updateMediaConfig (@NonNull MediaConfig mediaConfig) |
|
abstract MediaConfig | getMediaConfig () |
|
abstract boolean | sendDtmf (@NonNull JCCallItem item, @DtmfValue int value) |
|
◆ create()
创建 JCCall 对象
JCCall 的所有接口函数,如无特殊说明,都建议在主线程调用
- 注解
-
- 参数
-
- 返回
- JCCall 对象
- 异常
-
JCClient、JCMediaDevice、JCCallCallback 任意参数传空就会抛出异常 | |
◆ destroy()
static void com.juphoon.cloud.JCCall.destroy |
( |
| ) |
|
|
inlinestatic |
◆ call()
abstract boolean com.juphoon.cloud.JCCall.call |
( |
String |
userId, |
|
|
boolean |
video, |
|
|
@Nullable CallParam |
callParam |
|
) |
| |
|
abstract |
发起一对一呼叫
若发起的是音频呼叫,需要保证本地不存视频通话,并且本地通话数未达到最大通话数,最大通话数为:maxCallNum 。
若发起的是视频呼叫,需要保证本地不存在通话。
发起呼叫成功后,会收到 onCallItemAdd 通知
以下两种情况会收到 onCallItemRemove 通知:
- 本端发起视频呼叫时,对方已存在通话
- 本端发起音频呼叫时,对方已存在视频通话
- 注解
- 在调用此接口时确保用户的登录状态为已登录
- 参数
-
userId | 对方的用户标识,不能为空 |
video | 是否视频呼叫
|
callParam | 通话参数对象,此参数可为空,详细定义见: CallParam |
- 返回
- 是否正常调用
◆ term()
abstract boolean com.juphoon.cloud.JCCall.term |
( |
@NonNull JCCallItem |
item, |
|
|
@CallReason int |
reason, |
|
|
String |
description |
|
) |
| |
|
abstract |
挂断
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象 |
reason | 挂断原因,参见:挂断原因 |
description | 挂断描述 |
- 返回
- 是否正常调用
◆ answer()
abstract boolean com.juphoon.cloud.JCCall.answer |
( |
@NonNull JCCallItem |
item, |
|
|
boolean |
video |
|
) |
| |
|
abstract |
◆ mute()
abstract boolean com.juphoon.cloud.JCCall.mute |
( |
@NonNull JCCallItem |
item | ) |
|
|
abstract |
开启/取消音频输入静音
- 弃用:
- 从 v2.7.1 废弃。Juphoon 不建议你使用。如果你想开启/取消音频输入静音,请改用 muteMicrophone 方法
开启后对端将听不到本端的声音。内部会根据 getMute 来决定开启/取消静音
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象,此对象的通话状态必须为通话中 |
- 返回
- 是否正常调用
◆ muteSpeaker()
abstract boolean com.juphoon.cloud.JCCall.muteSpeaker |
( |
@NonNull JCCallItem |
item, |
|
|
boolean |
mute |
|
) |
| |
|
abstract |
开启/取消音频输出静音
开启后本端将听不到远端的声音
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象,此对象的通话状态必须为通话中 |
mute | 是否静音 |
- 返回
- 是否正常调用
◆ muteMicrophone()
abstract boolean com.juphoon.cloud.JCCall.muteMicrophone |
( |
@NonNull JCCallItem |
item, |
|
|
boolean |
mute |
|
) |
| |
|
abstract |
开启/取消音频输入静音
开启后对端将听不到本端的声音
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象,此对象的通话状态必须为通话中 |
mute | 是否静音 |
- 返回
- 是否正常调用
◆ hold()
abstract boolean com.juphoon.cloud.JCCall.hold |
( |
@NonNull JCCallItem |
item | ) |
|
|
abstract |
开启/取消呼叫保持
开启呼叫保持后,通话将被挂起。内部会根据 getHold 来决定开启/取消呼叫保持
- 注解
- 只针对音频,如果是视频通话则要上层处理视频逻辑
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象,此对象的通话状态必须为通话中 |
- 返回
- 是否正常调用
◆ audioRecord()
abstract boolean com.juphoon.cloud.JCCall.audioRecord |
( |
@NonNull JCCallItem |
item, |
|
|
boolean |
enable, |
|
|
String |
filePath |
|
) |
| |
|
abstract |
开启/关闭通话录音
开启通话录音,需要保证没有在录音也没有在录制视频
关闭通话录音,需要保证当前通话正在录音
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象 |
enable | 开启关闭录音
|
filePath | 录音文件的本地保存路径,由用户自行指定,需精确到文件名,例如:/sdcard/emulated/0/audio.wav,请确保目录存在且可写。内部默认以 wav 格式录制 |
- 返回
- 是否正常调用
◆ videoRecord()
abstract boolean com.juphoon.cloud.JCCall.videoRecord |
( |
@NonNull JCCallItem |
item, |
|
|
boolean |
enable, |
|
|
boolean |
remote, |
|
|
int |
width, |
|
|
int |
height, |
|
|
String |
filePath, |
|
|
boolean |
bothAudio |
|
) |
| |
|
abstract |
开启/关闭视频通话录制
开启视频录制,需要保证 1、没有在录音 2、若是录制远端视频,要保证没有在录制远端视频,并且远端在上传视频流 3、若是录制本端视频,要保证没有在录制本端视频,并且本端在上传视频流。
关闭视频录制,需要保证 1、若是关闭远端视频,要保证正在录制远端视频 2、若是关闭本端视频,要保证正在录制本端视频
- 参数
-
item | JCCallItem 对象,不能为空,并且本地缓存的通话列表中要包含此对象 |
enable | 是否开启视频通话录制
|
remote | 是否录制远端视频源
- true: 录制远端视频
- false: 录制本端视频
|
width | 录制视频宽像素 |
height | 录制视频高像素 |
filePath | 录制视频文件的本地保存路径,由用户自行指定,需精确到文件名及格式,例如:/sdcard/emulated/0/video.mp4。请确保目录存在且可写。 |
bothAudio | 是否录制两端音频
- true: 录制两端音频
- false: 录制视频端音频。也就是说 remote 为 true 就录制远端音频,remote 为 false 录制本端音频。
|
- 返回
- 是否正常调用
◆ becomeActive()
abstract boolean com.juphoon.cloud.JCCall.becomeActive |
( |
@NonNull JCCallItem |
item | ) |
|
|
abstract |
◆ enableUploadVideoStream()
abstract boolean com.juphoon.cloud.JCCall.enableUploadVideoStream |
( |
@NonNull JCCallItem |
item | ) |
|
|
abstract |
◆ getCallItems()
abstract List< JCCallItem > com.juphoon.cloud.JCCall.getCallItems |
( |
| ) |
|
|
abstract |
◆ getActiveCallItem()
abstract JCCallItem com.juphoon.cloud.JCCall.getActiveCallItem |
( |
| ) |
|
|
abstract |
◆ sendMessage()
abstract boolean com.juphoon.cloud.JCCall.sendMessage |
( |
@NonNull JCCallItem |
item, |
|
|
String |
type, |
|
|
String |
content |
|
) |
| |
|
abstract |
通过通话建立的通道发送数据
此接口调用成功后,消息接收方会收到 onMessageReceive 回调,通过此回调可以获取消息的文本类型和文本内容
- 参数
-
item | 需要发送数据的 JCCallItem 对象 |
type | 文本消息类型,用户可以自定义,例如text,xml等 |
content | 文本内容 |
- 返回
- 是否正常调用
◆ getStatistics()
abstract String com.juphoon.cloud.JCCall.getStatistics |
( |
| ) |
|
|
abstract |
获得当前通话统计信息
统计信息以Json字符串形式返回,其中包含 "Audio"、"Video"、"Mtp" 三个键值
- 返回
- 当前通话统计信息
◆ updateMediaConfig()
abstract void com.juphoon.cloud.JCCall.updateMediaConfig |
( |
@NonNull MediaConfig |
mediaConfig | ) |
|
|
abstract |
◆ getMediaConfig()
abstract MediaConfig com.juphoon.cloud.JCCall.getMediaConfig |
( |
| ) |
|
|
abstract |
◆ sendDtmf()
abstract boolean com.juphoon.cloud.JCCall.sendDtmf |
( |
@NonNull JCCallItem |
item, |
|
|
@DtmfValue int |
value |
|
) |
| |
|
abstract |
◆ DIRECTION_IN
final int com.juphoon.cloud.JCCall.DIRECTION_IN = 0 |
|
static |
◆ DIRECTION_OUT
final int com.juphoon.cloud.JCCall.DIRECTION_OUT = 1 |
|
static |
◆ STATE_INIT
final int com.juphoon.cloud.JCCall.STATE_INIT = 0 |
|
static |
◆ STATE_PENDING
final int com.juphoon.cloud.JCCall.STATE_PENDING = 1 |
|
static |
◆ STATE_CONNECTING
final int com.juphoon.cloud.JCCall.STATE_CONNECTING = 2 |
|
static |
◆ STATE_TALKING
final int com.juphoon.cloud.JCCall.STATE_TALKING = 3 |
|
static |
◆ STATE_OK
final int com.juphoon.cloud.JCCall.STATE_OK = 4 |
|
static |
◆ STATE_CANCEL
final int com.juphoon.cloud.JCCall.STATE_CANCEL = 5 |
|
static |
◆ STATE_CANCELED
final int com.juphoon.cloud.JCCall.STATE_CANCELED = 6 |
|
static |
◆ STATE_MISSED
final int com.juphoon.cloud.JCCall.STATE_MISSED = 7 |
|
static |
◆ STATE_ERROR
final int com.juphoon.cloud.JCCall.STATE_ERROR = 8 |
|
static |
◆ NET_STATUS_NA
final int com.juphoon.cloud.JCCall.NET_STATUS_NA = -100 |
|
static |
◆ NET_STATUS_DISCONNECTED
final int com.juphoon.cloud.JCCall.NET_STATUS_DISCONNECTED = -3 |
|
static |
◆ NET_STATUS_VERY_BAD
final int com.juphoon.cloud.JCCall.NET_STATUS_VERY_BAD = -2 |
|
static |
◆ NET_STATUS_BAD
final int com.juphoon.cloud.JCCall.NET_STATUS_BAD = -1 |
|
static |
◆ NET_STATUS_NORMAL
final int com.juphoon.cloud.JCCall.NET_STATUS_NORMAL = 0 |
|
static |
◆ NET_STATUS_GOOD
final int com.juphoon.cloud.JCCall.NET_STATUS_GOOD = 1 |
|
static |
◆ NET_STATUS_VERY_GOOD
final int com.juphoon.cloud.JCCall.NET_STATUS_VERY_GOOD = 2 |
|
static |
◆ DTMF_0
final int com.juphoon.cloud.JCCall.DTMF_0 = MtcCallConstants.EN_MTC_CALL_DTMF_0 |
|
static |
◆ DTMF_1
final int com.juphoon.cloud.JCCall.DTMF_1 = MtcCallConstants.EN_MTC_CALL_DTMF_1 |
|
static |
◆ DTMF_2
final int com.juphoon.cloud.JCCall.DTMF_2 = MtcCallConstants.EN_MTC_CALL_DTMF_2 |
|
static |
◆ DTMF_3
final int com.juphoon.cloud.JCCall.DTMF_3 = MtcCallConstants.EN_MTC_CALL_DTMF_3 |
|
static |
◆ DTMF_4
final int com.juphoon.cloud.JCCall.DTMF_4 = MtcCallConstants.EN_MTC_CALL_DTMF_4 |
|
static |
◆ DTMF_5
final int com.juphoon.cloud.JCCall.DTMF_5 = MtcCallConstants.EN_MTC_CALL_DTMF_5 |
|
static |
◆ DTMF_6
final int com.juphoon.cloud.JCCall.DTMF_6 = MtcCallConstants.EN_MTC_CALL_DTMF_6 |
|
static |
◆ DTMF_7
final int com.juphoon.cloud.JCCall.DTMF_7 = MtcCallConstants.EN_MTC_CALL_DTMF_7 |
|
static |
◆ DTMF_8
final int com.juphoon.cloud.JCCall.DTMF_8 = MtcCallConstants.EN_MTC_CALL_DTMF_8 |
|
static |
◆ DTMF_9
final int com.juphoon.cloud.JCCall.DTMF_9 = MtcCallConstants.EN_MTC_CALL_DTMF_9 |
|
static |
◆ DTMF_STAR
final int com.juphoon.cloud.JCCall.DTMF_STAR = MtcCallConstants.EN_MTC_CALL_DTMF_STAR |
|
static |
◆ DTMF_POUND
final int com.juphoon.cloud.JCCall.DTMF_POUND = MtcCallConstants.EN_MTC_CALL_DTMF_POUND |
|
static |
◆ DTMF_A
final int com.juphoon.cloud.JCCall.DTMF_A = MtcCallConstants.EN_MTC_CALL_DTMF_A |
|
static |
◆ DTMF_B
final int com.juphoon.cloud.JCCall.DTMF_B = MtcCallConstants.EN_MTC_CALL_DTMF_B |
|
static |
◆ DTMF_C
final int com.juphoon.cloud.JCCall.DTMF_C = MtcCallConstants.EN_MTC_CALL_DTMF_C |
|
static |
◆ DTMF_D
final int com.juphoon.cloud.JCCall.DTMF_D = MtcCallConstants.EN_MTC_CALL_DTMF_D |
|
static |
◆ maxCallNum
int com.juphoon.cloud.JCCall.maxCallNum = 1 |
最大通话数,默认值为1
- 注解
- 当通话数到达最大通话数后,调用 call 接口呼出会失败,收到来电会自动拒绝
◆ termWhenNetDisconnected
boolean com.juphoon.cloud.JCCall.termWhenNetDisconnected = false |
该类的文档由以下文件生成:
- cloud/src/main/call/com/juphoon/cloud/JCCall.java