new MoClient(options)
Mo SDK
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 参数对象 Properties
|
Methods
-
addCallback(name, callback)
-
设置回调接口
Parameters:
Name Type Description namestring 回调名
callbackfunction 回调函数
-
init(serviceInitParams, meetingInitParams, loginCallback)
-
初始化接口
Parameters:
Name Type Description serviceInitParamsobject service参数对象
Properties
Name Type Description app_keystring 认证的软件key
app_secretstring 认证软件key对应的value
usernamestring 登录用户名
passwordstring 登录密码
aps_paramsobject aps登录参数
meetingInitParamsobject 日志参数
Properties
Name Type Description krtcSdkLogParamobject krtcsdk log参数
Properties
Name Type Description enableLogboolean 是否开启
logPathstring 路径
krtcSdkInitParamobject 音视频初始化参数
Properties
Name Type Description customVideoCaptureboolean 启用或关闭自定义视频采集
customVideoRenderboolean 启用或关闭自定义视频渲染
customAudioCaptureboolean 启用或关闭自定义音频采集
customAudioPlayoutboolean 启用或关闭自定义音频输出
customVideoEncodeboolean 启用或关闭自定义视频编码
customVideoDecodeboolean 启用或关闭自定义视频解码
loginCallbackfunction 登录结果回调. 0: Success, 1: Error
-
<async> login(login_params) → {promise}
-
完整登录流程 getKrtcSdkToken > loginKrtc > getAccountToken > login > loginAps
Parameters:
Name Type Description login_paramsobject 登录参数对象
Properties
Name Type Description user_idstring 用户id
krtcsdk_login_paramsobject 参数对象
Properties
Name Type Description serverAddrstring 服务器地址
idstring 用户id
nickNamestring 用户昵称
oauth_consumer_keystring 认证的软件key
oauth_consumer_secretstring 认证软件key对应的value
usernamestring 登录用户名
passwordstring 登录密码
aps_paramsobject aps登录信息
Properties
Name Type Description Versionstring 终端版本号
IsSecuritynumber 是否支持账号安全规则,0:否,1:是 默认值:0
DeviceTypestring 必填,终端型号
ApsLocalIpstring 必填,APS的本地IP地址
UserNamestring 必填,登录账号
PassWordstring 必填,登录密码,需要使用MD5加密
OemMarkstring 运营商信息
PreferredApsIpstring 优选APS地址,即界面配置的登陆地址(域名需解析成IP)
SNstring 终端SN序列号(适用于硬终端
MainTypestring 设备主型号
SubTypestring 设备子型号
IsAnonymousstring 是否匿名登录,非匿名登录不要添加此参数,匿名登陆填写True
Returns:
返回一个promise
- Type
- promise
Moyun SDK