Class: MoClient

MoClient

MoClient
SDK入口


new MoClient(options)

Mo SDK

Parameters:
Name Type Description
options object

参数对象

Properties
Name Type Description
clientId string

终端标识ID(用于区分多实例,可在新建实例的时候传入,未设置则随机生成)

baseUrl string

基础的URL,用于平台登录,未设置则为空

e164 string

用户e164

apsUrl string

Aps URL,未设置则默认为baseUrl

moSeverUrl string

moyun sever的URL,用于krtcsdk登录,未设置则为空

Methods


addCallback(name, callback)

设置回调接口

Parameters:
Name Type Description
name string

回调名

callback function

回调函数


init(serviceInitParams, meetingInitParams, loginCallback)

初始化接口

Parameters:
Name Type Description
serviceInitParams object

service参数对象

Properties
Name Type Description
app_key string

认证的软件key

app_secret string

认证软件key对应的value

username string

登录用户名

password string

登录密码

aps_params object

aps登录参数

meetingInitParams object

日志参数

Properties
Name Type Description
krtcSdkLogParam object

krtcsdk log参数

Properties
Name Type Description
enableLog boolean

是否开启

logPath string

路径

krtcSdkInitParam object

音视频初始化参数

Properties
Name Type Description
customVideoCapture boolean

启用或关闭自定义视频采集

customVideoRender boolean

启用或关闭自定义视频渲染

customAudioCapture boolean

启用或关闭自定义音频采集

customAudioPlayout boolean

启用或关闭自定义音频输出

customVideoEncode boolean

启用或关闭自定义视频编码

customVideoDecode boolean

启用或关闭自定义视频解码

loginCallback function

登录结果回调. 0: Success, 1: Error


<async> login(login_params) → {promise}

完整登录流程 getKrtcSdkToken > loginKrtc > getAccountToken > login > loginAps

Parameters:
Name Type Description
login_params object

登录参数对象

Properties
Name Type Description
user_id string

用户id

krtcsdk_login_params object

参数对象

Properties
Name Type Description
serverAddr string

服务器地址

id string

用户id

nickName string

用户昵称

oauth_consumer_key string

认证的软件key

oauth_consumer_secret string

认证软件key对应的value

username string

登录用户名

password string

登录密码

aps_params object

aps登录信息

Properties
Name Type Description
Version string

终端版本号

IsSecurity number

是否支持账号安全规则,0:否,1:是 默认值:0

DeviceType string

必填,终端型号

ApsLocalIp string

必填,APS的本地IP地址

UserName string

必填,登录账号

PassWord string

必填,登录密码,需要使用MD5加密

OemMark string

运营商信息

PreferredApsIp string

优选APS地址,即界面配置的登陆地址(域名需解析成IP)

SN string

终端SN序列号(适用于硬终端

MainType string

设备主型号

SubType string

设备子型号

IsAnonymous string

是否匿名登录,非匿名登录不要添加此参数,匿名登陆填写True

Returns:

返回一个promise

Type
promise