|
JRTCSDK-Java v2401.0
视频客服 API 文档
|
Public 成员函数 | |
| void | onLogin (boolean result, @JRTCEnum.ReasonCode int reason) |
| void | onLogout (@JRTCEnum.ReasonCode int reason) |
| void | onClientStateChanged (@JRTCClient.ClientState int state, @JRTCClient.ClientState int oldState) |
| void | onOnlineMessageSendResult (boolean result, int operatorId) |
| void | onOnlineMessageReceived (String message, String userId) |
| void | onSDKEvent (JRTCSDKEvent event) |
| void | onP2PSessionCreate (JRTCClient.JRTCP2PSession session, boolean result) |
| void | onP2PSessionConnect (JRTCClient.JRTCP2PSession session, boolean result) |
| void | onP2PSessionClose (JRTCClient.JRTCP2PSession session) |
| void | onP2PMessageReceived (JRTCClient.JRTCP2PSession session, String receiveMsg) |
| void | onGetUploadUrlResponse (boolean result, String token, String url, String fileId, long offset) |
| void | onRequestFileUploadInfoResponse (int operatorId, boolean result, String url, String token, long requestTimestamp, String extraInfo, long fileSize, int offset, String fileType, String serverOid, String reason) |
| void | onCompleteFileUploadResponse (int operatorId, boolean result, String fileName, String extraInfo, String fileType, String reason) |
| void | onGetUploadFileInfoResponse (int operatorId, boolean result, List< JRTCUploadFileInfo > uploadFileInfoList, String extraInfo, String reason) |
| void | onFileUploadPlatformNotify (boolean result, String serialId, JRTCUploadFileInfo uploadFileInfo) |
登录登出相关事件回调
| void onClientStateChanged | ( | @JRTCClient.ClientState int | state, |
| @JRTCClient.ClientState int | oldState | ||
| ) |
登录状态变化通知
| state | 当前状态值 |
| oldState | 之前状态值 |
| void onCompleteFileUploadResponse | ( | int | operatorId, |
| boolean | result, | ||
| String | fileName, | ||
| String | extraInfo, | ||
| String | fileType, | ||
| String | reason | ||
| ) |
文件上传完成确认响应
| operatorId | 操作id,对应 completeFileUpload 的返回值 |
| result | 请求是否成功
|
| fileName | 服务器合并后的文件名 |
| extraInfo | 随路参数 |
| fileType | 文件类型 |
| reason | 请求失败原因描述,当 result 为 false 时有效 |
| void onFileUploadPlatformNotify | ( | boolean | result, |
| String | serialId, | ||
| JRTCUploadFileInfo | uploadFileInfo | ||
| ) |
文件上传到影像平台结果通知
| result | 上传是否成功
|
| serialId | 业务id,如果是通话业务相关文件,对应的是 callId |
| uploadFileInfo | 文件信息对象 |
| void onGetUploadFileInfoResponse | ( | int | operatorId, |
| boolean | result, | ||
| List< JRTCUploadFileInfo > | uploadFileInfoList, | ||
| String | extraInfo, | ||
| String | reason | ||
| ) |
获取上传文件信息列表响应
| operatorId | 操作id,对应 getUploadFileInfo 的返回值 |
| result | 请求是否成功
|
| uploadFileInfoList | 文件信息对象列表,当 result 为 true 时有效 |
| extraInfo | 随路参数,当 result 为 true 时有效 |
| reason | 请求失败原因描述,当 result 为 false 时有效 |
| void onGetUploadUrlResponse | ( | boolean | result, |
| String | token, | ||
| String | url, | ||
| String | fileId, | ||
| long | offset | ||
| ) |
获取文件上传地址等信息回调
| result | 获取结果
|
| token | 校验用的token |
| url | 文件上传地址 |
| fileId | 文件id |
| offset | 文件续传位置 |
getUploadUrl 接口,然后通过此回调的 url 再上传至服务器。 requestFileUploadInfo 替换获取文件上传信息 | void onLogin | ( | boolean | result, |
| @JRTCEnum.ReasonCode int | reason | ||
| ) |
登录结果回调
| result | true 表示登录成功,false 表示登录失败 |
| reason | 当 result 为 false 时该值有效 |
| void onLogout | ( | @JRTCEnum.ReasonCode int | reason | ) |
登出回调
| reason | 登出原因 |
| void onOnlineMessageReceived | ( | String | message, |
| String | userId | ||
| ) |
收到在线消息回调
| message | 消息内容 |
| userId | 对方用户ID |
| void onOnlineMessageSendResult | ( | boolean | result, |
| int | operatorId | ||
| ) |
在线消息发送结果回调
| result | 发送结果是否成功
|
| operatorId | 操作id,对应 sendOnlineMessage 的返回值 |
| void onP2PMessageReceived | ( | JRTCClient.JRTCP2PSession | session, |
| String | receiveMsg | ||
| ) |
收到 P2P 会话消息
| session | 会话对象 |
| receiveMsg | 接收到的消息内容 |
| void onP2PSessionClose | ( | JRTCClient.JRTCP2PSession | session | ) |
P2P 会话关闭
| session | 会话对象 |
| void onP2PSessionConnect | ( | JRTCClient.JRTCP2PSession | session, |
| boolean | result | ||
| ) |
P2P 会话连接结果
| session | 会话对象 |
| result | 创建结果 |
| void onP2PSessionCreate | ( | JRTCClient.JRTCP2PSession | session, |
| boolean | result | ||
| ) |
P2P 会话创建结果
| session | 会话对象 |
| result | 创建结果 |
| void onRequestFileUploadInfoResponse | ( | int | operatorId, |
| boolean | result, | ||
| String | url, | ||
| String | token, | ||
| long | requestTimestamp, | ||
| String | extraInfo, | ||
| long | fileSize, | ||
| int | offset, | ||
| String | fileType, | ||
| String | serverOid, | ||
| String | reason | ||
| ) |
获取文件上传或断点续传信息响应
| operatorId | 操作id,对应 requestFileUploadInfo 的返回值 |
| result | 请求是否成功
|
| url | 上传地址,分片录制文件上传场景,首次请求分片上传信息时有效 |
| token | 文件上传所需token,用于校验上传合法性,需要在上传文件的时候携带 |
| requestTimestamp | 本次请求发起时间戳,用于控制上传地址有效期,需要在上传文件的时候携带 |
| extraInfo | 随路参数 |
| fileSize | 文件大小 |
| offset | 偏移量 |
| fileType | 文件类型 |
| serverOid | 上传目标服务Oid |
| reason | 请求失败原因描述,当 result 为 false 时有效 |
| void onSDKEvent | ( | JRTCSDKEvent | event | ) |
上报事件回调
| event | 事件对象 |