Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李勇
2017-01-20 10:02:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
10aea753377b138ead24c3d0ea9bbc5b0f9bd268
10aea753
1 parent
150ecd70
修改MCUClient API文档
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
253 行增加
和
80 行删除
docs/McuClient API.html
docs/McuClient API.md
docs/McuClient API.pdf
docs/McuClient API.html
查看文件 @
10aea75
...
...
@@ -304,7 +304,7 @@ img {
<p>
示例代码
</p>
<pre><code>
window.onload=function(){
//创建client
//创建client
,这是必须的第一步
const client=MCUClientEngine.createMcuClient();
//获取事件监听消息定义
const MessageTypes=MCUClientEngine.MessageTypes;
...
...
@@ -317,7 +317,7 @@ img {
<h3>
初始化
</h3>
<h4>
client.init(
configInfo
)
</h4>
<h4>
client.init(
paramInfo,onSuccess,mcuErrorEventHandler
)
</h4>
<p>
client创建完成之后第一步需要初始化。
</p>
...
...
@@ -330,14 +330,16 @@ img {
"userID":0,
};
//初始化
client.init(paramInfo,onSuccess,
onFailure
);
client.init(paramInfo,onSuccess,
mcuErrorEventHandler
);
function onSuccess(callbackData){
//初始化成功回调
//{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1}
};
function onFailure(callbackData){
//初始化失败回调
function mcuErrorEventHandler(callbackData){
//整个MCUClient中Error异常监听
//返回值callbackData的结构为{"code":errorCode,"reson":""}
//errorCode的列表在文档最后面的 ErrorCode错误码查询
};
</code></pre>
...
...
@@ -396,16 +398,16 @@ function onFailure(callbackData){
</td>
</tr>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
onFailure
</p></td>
<td><p
class=
"first last"
>
mcuErrorEventHandler
</p></td>
<td><p
class=
"first last"
>
Function
</p></td>
<td><p
class=
"first last"
><li>
(必选) Function
</p>
初始化失败回调函数
</p></td>
<td><p
class=
"first last"
><li>
(必选) Function
</p>
整个MCUClient中Error异常监听
</p></td>
</tr>
</tbody>
</table></div>
<h3>
加入会议
</h3>
<h4>
client.joinClass(paramInfo)
</h4>
<h4>
client.joinClass(paramInfo
,onSuccess
)
</h4>
<p>
client初始化成功之后,加入会议。
</p>
...
...
@@ -417,19 +419,11 @@ function onFailure(callbackData){
};
//加入会议
client.joinClass(paramInfo,onSuccess
,onFailure
);
client.joinClass(paramInfo,onSuccess);
function onSuccess(callbackData){
//加入会议成功回调
//{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1}
};
function onFailure(callbackData){
//加入会议失败回调
//MessageTypes.ERROR_PARAM 传入的参数错误
//MessageTypes.ERROR_CLASS_PASSWORD_WRONG 传入的参数错误
//MessageTypes.ERROR_CLASS_JOIN_FULL 课堂人数已满
//MessageTypes.ERROR_CLASS_PROTOCOL_WRONG 协议异常
//MessageTypes.ERROR_CLASS_MD5_WRONG MD5验证失败
//{"siteId":"h5test","confId":1292388778,"h5Module":0,"nodeId":1484789938,"topNodeID":101,"userRole":"normal","role":1,"isHost":false,"classRole":0,"userId":"0","userName":"cccccc","password":"222222","userType":8,"passwordRequired":true,"md5":"b36da144521b70d89e72993cd1117b5b","msType":1,"portal":"112.126.80.182:80","mcuDelay":3000,"MCUServerIP":"123.56.73.119","MCUServerPort":"7001","maxVideoChannels":1,"maxAudioChannels":1,"maxMediaChannels":2}
};
</code></pre>
...
...
@@ -471,17 +465,7 @@ function onFailure(callbackData){
<td><p
class=
"first last"
><li>
(必选) Function
</p>
成功回调函数
</p>
</td>
</tr>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
onFailure
</p></td>
<td><p
class=
"first last"
>
Function
</p></td>
<td><p
class=
"first last"
><li>
(必选) Function
</p>
失败回调函数,返回值:
</p>
//MessageTypes.ERROR_PARAM 传入的参数错误
//MessageTypes.ERROR_CLASS_PASSWORD_WRONG 传入的参数错误
//MessageTypes.ERROR_CLASS_JOIN_FULL 课堂人数已满
//MessageTypes.ERROR_CLASS_PROTOCOL_WRONG 协议异常
//MessageTypes.ERROR_CLASS_MD5_WRONG MD5验证失败
</td>
</tr>
</tbody>
</table></div>
...
...
@@ -491,6 +475,59 @@ function onFailure(callbackData){
<p>
离开会议
</p>
<h3>
获取当前的状态
</h3>
<h4>
client.currentStatus()
</h4>
<p>
获取当前的状态
</p>
<p>
示例代码
</p>
<pre><code>
var callbackData=client.currentStatus();
//返回一个对象
//{code:0,message:"XXXXXX"}
</code></pre>
<div
class=
"wy-table-responsive"
><table
border=
"1"
class=
"docutils"
>
<colgroup>
<col
width=
"10%"
>
<col
width=
"10%"
>
<col
width=
"80%"
>
</colgroup>
<tbody
valign=
"m"
>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
参数名称
</p></td>
<td><p
class=
"first last"
>
类型
</p></td>
<td><p
class=
"first last"
>
该对象包含以下属性
</p></td>
</tr>
<tr
class=
"row-even"
>
<td
rowspan=
"11"
>
callbackData
</td>
<td
rowspan=
"11"
><p
class=
"first last"
>
对象
</p></td>
</tr>
<tr
class=
"row-odd"
>
<tr
class=
"row-odd"
>
<td>
<ul>
<li>
code:Number
</p></li>
0 //SDK 未初始化
</p>
1 //未加入会议
</p>
2 //已经加入会议
</p>
3 //已经离开会议
</p>
4 //未知状态
</ul>
</td>
</tr>
<td>
<ul>
<li>
message:String
</p>
状态的描述,对应code,默认为空
</li>
</ul>
</td>
</tr>
</tbody>
</table></div>
<h3>
发送消息
</h3>
<h4>
client.sendChatMsg(paramInfo)
</h4>
...
...
@@ -513,7 +550,7 @@ client.sendChatMsg(paramInfo);
<col
width=
"10%"
>
<col
width=
"80%"
>
</colgroup>
<tbody
valign=
"
top
"
>
<tbody
valign=
"
M
"
>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
参数名称
</p></td>
<td><p
class=
"first last"
>
类型
</p></td>
...
...
@@ -546,21 +583,52 @@ client.sendChatMsg(paramInfo);
<h2>
client回调事件
</h2>
<h3>
显示
日志信息 事件回调
</h3>
<h3>
会议
日志信息 事件回调
</h3>
<p>
示例代码
</p>
<pre><code>
client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){
//.....
{
"repeatmonthweekweek": 0,
"endmode": 0,
"repeatweek": "",
"endcount": 1,
"errorCode": 0,
"cycle": 0,
"repeatmonthday": 0,
"frequency": 1,
"repeatday": 0,
"meetingName": "mcuClient",
"repeatmode": 0,
"finalenddate": "",
"meetingContent": "",
"beginTime": "2017-01-16 13:00:00",
"endTime": "2017-01-31 15:00:00",
"monthType": 0,
"category": "",
"repeatmonthweekday": 0,
"status": 1
</code></pre>
<p>
}
});
</p>
<h3>
会议有人加入 事件回调
</h3>
<p>
示例代码
</p>
<pre><code>
client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){
//返回值
//{"nodeId":1483947664,"nodeData":{"nodeId":1483947664,"name":"cccccc","role":1,"level":0,"audioRecords":[],"videoRecords":[],"status":null,"userData":{"qq":"","skype":"","mobile":""},"userId":"0","handUpTime":null,"deviceType":3,"mobileDirection":null}};
});
</code></pre>
<h3>
会议
人数查询
事件回调
</h3>
<h3>
会议
有人离开
事件回调
</h3>
<p>
示例代码
</p>
<pre><code>
client.on(MessageTypes.CLASS_SHOW_ROSTER_NUM,function(callbackData){
//.....
<pre><code>
client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){
//{"nodeId":1234}
});
</code></pre>
...
...
@@ -618,13 +686,34 @@ client.sendChatMsg(paramInfo);
});
</code></pre>
<h
3>
网络错误 事件回调
</h3
>
<h
r
/
>
<
p>
示例代码
</p
>
<
h2>
ErrorCode 错误码查询
</h2
>
<pre><code>
client.on(MessageTypes.NET_ERROR,function(callbackData){
//.....
});
<pre><code>
MessageTypes.ERR_NETWORK=10000;//网络错误
MessageTypes.ERR_UNKNOWN=10001;//未知错误
//会议初始化失败的几种情况
MessageTypes.ERR_CLASS_INIT_PAEAM=100;//初始化参数错误
MessageTypes.ERR_CLASS_INIT_NETWORK=101;//初始化网络错误
MessageTypes.ERR_CLASS_INIT_PROTOCOL=102;//初始化协议错误
MessageTypes.ERR_CLASS_INIT_FAILED=103;//初始化验证失败
//加入会议失败的几种情况
MessageTypes.ERR_CLASS_JOIN_NETWORK=200;//加入会议网络错误
MessageTypes.ERR_CLASS_JOIN_PROTOCOL=201;//加入会议化协议错误
MessageTypes.ERR_CLASS_JOIN_FAILED=202;//加入会议化异常错误
MessageTypes.ERR_CLASS_JOIN_PARAM=203;//加入会议参数错误
MessageTypes.ERR_CLASS_JOIN_FULL=204;//人数已满
MessageTypes.ERR_CLASS_MD5_WRONG=205;//MD5验证失败
MessageTypes.ERR_CLASS_PASSWORD_WRONG=206;//密码错误
MessageTypes.ERR_CLASS_JOIN_CONFILICT=207;//已经在其它地方登陆
MessageTypes.ERR_GET_CLASS_DETAIL=300;//获取classDetail失败
MessageTypes.ERR_GET_MEETING_PARAML=301;//获取MeetingParam失败
</code></pre>
</body>
...
...
docs/McuClient API.md
查看文件 @
10aea75
# McuClient API参考说明 #
</p>
----------
##创建McuClient对象 ##
...
...
@@ -9,7 +10,7 @@
示例代码
window.onload=function(){
//创建client
//创建client
,这是必须的第一步
const client=MCUClientEngine.createMcuClient();
//获取事件监听消息定义
const MessageTypes=MCUClientEngine.MessageTypes;
...
...
@@ -18,7 +19,7 @@
----------
## McuClient方法 ##
### 初始化 ###
#### client.init(
configInfo
) ####
#### client.init(
paramInfo,onSuccess,mcuErrorEventHandler
) ####
client创建完成之后第一步需要初始化。
示例代码
...
...
@@ -30,14 +31,16 @@ client创建完成之后第一步需要初始化。
"userID":0,
};
//初始化
client.init(paramInfo,onSuccess,
onFailure
);
client.init(paramInfo,onSuccess,
mcuErrorEventHandler
);
function onSuccess(callbackData){
//初始化成功回调
//{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1}
};
function onFailure(callbackData){
//初始化失败回调
function mcuErrorEventHandler(callbackData){
//整个MCUClient中Error异常监听
//返回值callbackData的结构为{"code":errorCode,"reson":""}
//errorCode的列表在文档最后面的 ErrorCode错误码查询
};
...
...
@@ -96,9 +99,9 @@ client创建完成之后第一步需要初始化。
</td>
</tr>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
onFailure
</p></td>
<td><p
class=
"first last"
>
mcuErrorEventHandler
</p></td>
<td><p
class=
"first last"
>
Function
</p></td>
<td><p
class=
"first last"
><li>
(必选) Function
</p>
初始化失败回调函数
</p></td>
<td><p
class=
"first last"
><li>
(必选) Function
</p>
整个MCUClient中Error异常监听
</p></td>
</tr>
</tbody>
</table></div>
...
...
@@ -106,7 +109,7 @@ client创建完成之后第一步需要初始化。
### 加入会议 ###
#### client.joinClass(paramInfo) ####
#### client.joinClass(paramInfo
,onSuccess
) ####
client初始化成功之后,加入会议。
示例代码
...
...
@@ -117,19 +120,11 @@ client初始化成功之后,加入会议。
};
//加入会议
client.joinClass(paramInfo,onSuccess
,onFailure
);
client.joinClass(paramInfo,onSuccess);
function onSuccess(callbackData){
//加入会议成功回调
//{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1}
};
function onFailure(callbackData){
//加入会议失败回调
//MessageTypes.ERROR_PARAM 传入的参数错误
//MessageTypes.ERROR_CLASS_PASSWORD_WRONG 传入的参数错误
//MessageTypes.ERROR_CLASS_JOIN_FULL 课堂人数已满
//MessageTypes.ERROR_CLASS_PROTOCOL_WRONG 协议异常
//MessageTypes.ERROR_CLASS_MD5_WRONG MD5验证失败
//{"siteId":"h5test","confId":1292388778,"h5Module":0,"nodeId":1484789938,"topNodeID":101,"userRole":"normal","role":1,"isHost":false,"classRole":0,"userId":"0","userName":"cccccc","password":"222222","userType":8,"passwordRequired":true,"md5":"b36da144521b70d89e72993cd1117b5b","msType":1,"portal":"112.126.80.182:80","mcuDelay":3000,"MCUServerIP":"123.56.73.119","MCUServerPort":"7001","maxVideoChannels":1,"maxAudioChannels":1,"maxMediaChannels":2}
};
...
...
@@ -171,17 +166,7 @@ client初始化成功之后,加入会议。
<td><p
class=
"first last"
><li>
(必选) Function
</p>
成功回调函数
</p>
</td>
</tr>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
onFailure
</p></td>
<td><p
class=
"first last"
>
Function
</p></td>
<td><p
class=
"first last"
><li>
(必选) Function
</p>
失败回调函数,返回值:
</p>
//MessageTypes.ERROR_PARAM 传入的参数错误
//MessageTypes.ERROR_CLASS_PASSWORD_WRONG 传入的参数错误
//MessageTypes.ERROR_CLASS_JOIN_FULL 课堂人数已满
//MessageTypes.ERROR_CLASS_PROTOCOL_WRONG 协议异常
//MessageTypes.ERROR_CLASS_MD5_WRONG MD5验证失败
</td>
</tr>
</tbody>
</table></div>
...
...
@@ -189,6 +174,56 @@ client初始化成功之后,加入会议。
#### client.leaveClass() ####
离开会议
### 获取当前的状态 ###
#### client.currentStatus() ####
获取当前的状态
示例代码
var callbackData=client.currentStatus();
//返回一个对象
//{code:0,message:"XXXXXX"}
<div
class=
"wy-table-responsive"
><table
border=
"1"
class=
"docutils"
>
<colgroup>
<col
width=
"10%"
>
<col
width=
"10%"
>
<col
width=
"80%"
>
</colgroup>
<tbody
valign=
"m"
>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
参数名称
</p></td>
<td><p
class=
"first last"
>
类型
</p></td>
<td><p
class=
"first last"
>
该对象包含以下属性
</p></td>
</tr>
<tr
class=
"row-even"
>
<td
rowspan=
"11"
>
callbackData
</td>
<td
rowspan=
"11"
><p
class=
"first last"
>
对象
</p></td>
</tr>
<tr
class=
"row-odd"
>
<tr
class=
"row-odd"
>
<td>
<ul>
<li>
code:Number
</p></li>
0 //SDK 未初始化
</p>
1 //未加入会议
</p>
2 //已经加入会议
</p>
3 //已经离开会议
</p>
4 //未知状态
</ul>
</td>
</tr>
<td>
<ul>
<li>
message:String
</p>
状态的描述,对应code,默认为空
</li>
</ul>
</td>
</tr>
</tbody>
</table></div>
### 发送消息 ###
#### client.sendChatMsg(paramInfo) ####
发送聊天消息
...
...
@@ -208,7 +243,7 @@ client初始化成功之后,加入会议。
<col
width=
"10%"
>
<col
width=
"80%"
>
</colgroup>
<tbody
valign=
"
top
"
>
<tbody
valign=
"
M
"
>
<tr
class=
"row-odd"
>
<td><p
class=
"first last"
>
参数名称
</p></td>
<td><p
class=
"first last"
>
类型
</p></td>
...
...
@@ -242,20 +277,47 @@ client初始化成功之后,加入会议。
## client回调事件 ##
###
显示
日志信息 事件回调 ###
###
会议
日志信息 事件回调 ###
示例代码
client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){
//.....
{
"repeatmonthweekweek": 0,
"endmode": 0,
"repeatweek": "",
"endcount": 1,
"errorCode": 0,
"cycle": 0,
"repeatmonthday": 0,
"frequency": 1,
"repeatday": 0,
"meetingName": "mcuClient",
"repeatmode": 0,
"finalenddate": "",
"meetingContent": "",
"beginTime": "2017-01-16 13:00:00",
"endTime": "2017-01-31 15:00:00",
"monthType": 0,
"category": "",
"repeatmonthweekday": 0,
"status": 1
}
});
### 会议
人数查询
事件回调 ###
### 会议
有人加入
事件回调 ###
示例代码
client.on(MessageTypes.CLASS_SHOW_ROSTER_NUM,function(callbackData){
//.....
client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){
//返回值
//{"nodeId":1483947664,"nodeData":{"nodeId":1483947664,"name":"cccccc","role":1,"level":0,"audioRecords":[],"videoRecords":[],"status":null,"userData":{"qq":"","skype":"","mobile":""},"userId":"0","handUpTime":null,"deviceType":3,"mobileDirection":null}};
});
### 会议有人离开 事件回调 ###
示例代码
client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){
//{"nodeId":1234}
});
### 关闭会议 事件回调 ###
示例代码
...
...
@@ -298,9 +360,31 @@ client初始化成功之后,加入会议。
//.....
});
### 网络错误 事件回调 ###
示例代码
----------
client.on(MessageTypes.NET_ERROR,function(callbackData){
//.....
});
\ No newline at end of file
## ErrorCode 错误码查询 ##
MessageTypes.ERR_NETWORK=10000;//网络错误
MessageTypes.ERR_UNKNOWN=10001;//未知错误
//会议初始化失败的几种情况
MessageTypes.ERR_CLASS_INIT_PAEAM=100;//初始化参数错误
MessageTypes.ERR_CLASS_INIT_NETWORK=101;//初始化网络错误
MessageTypes.ERR_CLASS_INIT_PROTOCOL=102;//初始化协议错误
MessageTypes.ERR_CLASS_INIT_FAILED=103;//初始化验证失败
//加入会议失败的几种情况
MessageTypes.ERR_CLASS_JOIN_NETWORK=200;//加入会议网络错误
MessageTypes.ERR_CLASS_JOIN_PROTOCOL=201;//加入会议化协议错误
MessageTypes.ERR_CLASS_JOIN_FAILED=202;//加入会议化异常错误
MessageTypes.ERR_CLASS_JOIN_PARAM=203;//加入会议参数错误
MessageTypes.ERR_CLASS_JOIN_FULL=204;//人数已满
MessageTypes.ERR_CLASS_MD5_WRONG=205;//MD5验证失败
MessageTypes.ERR_CLASS_PASSWORD_WRONG=206;//密码错误
MessageTypes.ERR_CLASS_JOIN_CONFILICT=207;//已经在其它地方登陆
MessageTypes.ERR_GET_CLASS_DETAIL=300;//获取classDetail失败
MessageTypes.ERR_GET_MEETING_PARAML=301;//获取MeetingParam失败
...
...
docs/McuClient API.pdf
0 → 100644
查看文件 @
10aea75
不能预览此文件类型
请
注册
或
登录
后发表评论