正在显示
2 个修改的文件
包含
701 行增加
和
0 行删除
docs/McuClient_v.1.0.3_API.md
0 → 100644
| 1 | +# McuClient API参考说明 # | ||
| 2 | +</p> | ||
| 3 | + | ||
| 4 | +---------- | ||
| 5 | +##<font color=blue>McuClient 目录</font> ## | ||
| 6 | + | ||
| 7 | +> - **创建McuClient对象** | ||
| 8 | +> | ||
| 9 | +> - **McuClient接口** | ||
| 10 | +> | ||
| 11 | +> - **McuClient回调事件** | ||
| 12 | +> | ||
| 13 | +> - **ErrorCode 错误码查询** | ||
| 14 | + | ||
| 15 | +---------- | ||
| 16 | +##<font color=blue>使用步骤说明</font> ## | ||
| 17 | +> 1. 创建McuClient对象 | ||
| 18 | +> 2. McuClient初始化init | ||
| 19 | +> 3. 添加MessageTypes中的事件监听(接收各个模块的消息) | ||
| 20 | +> 3. McuClient加入会议 | ||
| 21 | +> 4. 加入会议成功之后可以调用其他接口和监听事件 | ||
| 22 | + | ||
| 23 | +---------- | ||
| 24 | + | ||
| 25 | +##<font color=blue>创建McuClient对象</font> ## | ||
| 26 | +只创建一次 | ||
| 27 | + | ||
| 28 | +示例代码 | ||
| 29 | + | ||
| 30 | + window.onload=function(){ | ||
| 31 | + //创建client,这是必须的第一步 | ||
| 32 | + const client=MCUClientEngine.createMcuClient(); | ||
| 33 | + //获取事件监听消息定义 | ||
| 34 | + const MessageTypes=MCUClientEngine.MessageTypes; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | +---------- | ||
| 38 | +## <font color=blue>McuClient接口 </font>## | ||
| 39 | +### 初始化 ### | ||
| 40 | +#### client.init (paramInfo,onSuccess,mcuErrorEventHandler) #### | ||
| 41 | +client创建完成之后第一步需要初始化。 | ||
| 42 | + | ||
| 43 | +示例代码 | ||
| 44 | + | ||
| 45 | + var paramInfo={ | ||
| 46 | + "meetingNumber":123456, | ||
| 47 | + "portal":"127.0.0.1:80", | ||
| 48 | + "usertRole":"normal", | ||
| 49 | + "userID":0, | ||
| 50 | + }; | ||
| 51 | + //初始化 | ||
| 52 | + client.init(paramInfo,onSuccess,mcuErrorEventHandler); | ||
| 53 | + function onSuccess(callbackData){ | ||
| 54 | + //初始化成功回调 | ||
| 55 | + /*{ | ||
| 56 | + "siteId": "h5test", | ||
| 57 | + "passwordRequired": true, | ||
| 58 | + "md5": "de399d5540b3da2fbc1eb0a770d4fd66", | ||
| 59 | + "code": 0, | ||
| 60 | + "msType": 1 | ||
| 61 | + }*/ | ||
| 62 | + }; | ||
| 63 | + function mcuErrorEventHandler(callbackData){ | ||
| 64 | + //整个MCUClient中Error异常监听 | ||
| 65 | + //返回值callbackData的结构为{"code":errorCode,"reson":""} | ||
| 66 | + //errorCode的列表在文档最后面的 ErrorCode错误码查询 | ||
| 67 | + }; | ||
| 68 | + | ||
| 69 | + | ||
| 70 | +<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 71 | + <colgroup> | ||
| 72 | + <col width="10%"> | ||
| 73 | + <col width="10%"> | ||
| 74 | + <col width="80%"> | ||
| 75 | + </colgroup> | ||
| 76 | + <tbody valign="mid"> | ||
| 77 | + <tr class="row-odd"> | ||
| 78 | + <td><p class="first last">参数名称</p></td> | ||
| 79 | + <td><p class="first last">类型</p></td> | ||
| 80 | + <td><p class="first last">该对象包含以下属性</p></td> | ||
| 81 | + </tr> | ||
| 82 | + <tr class="row-even"> | ||
| 83 | + <td rowspan="5">paramInfo</td> | ||
| 84 | + <td rowspan="5"><p class="first last">对象</p></td> | ||
| 85 | + | ||
| 86 | + </tr> | ||
| 87 | + <tr class="row-odd"> | ||
| 88 | + <td> | ||
| 89 | + <ul> | ||
| 90 | + <li>meetingNumber:(必选)Number </p>课堂号</li> | ||
| 91 | + </ul> | ||
| 92 | + </td> | ||
| 93 | + </tr> | ||
| 94 | + <tr class="row-odd"> | ||
| 95 | + <td> | ||
| 96 | + <ul> | ||
| 97 | + <li>portal:(必选)String </p>IP地址</li> | ||
| 98 | + </ul> | ||
| 99 | + </td> | ||
| 100 | + </tr> | ||
| 101 | + <tr class="row-odd"> | ||
| 102 | + <td> | ||
| 103 | + <ul> | ||
| 104 | + <li>usertRole:(可选) String </p> | ||
| 105 | + 用户的身份,5种类型,默认是normal | ||
| 106 | + ;host(主持人/老师)、presenter(主讲人)、assistant(助教)、normal(普通角色/学生),record(暂时没用)</li> | ||
| 107 | + </ul> | ||
| 108 | + </td> | ||
| 109 | + </tr> | ||
| 110 | + <tr class="row-odd"> | ||
| 111 | + <td> | ||
| 112 | + <ul> | ||
| 113 | + <li>userId:(可选) String </p> | ||
| 114 | + 第三方用户id,默认是0 | ||
| 115 | + </ul> | ||
| 116 | + </td> | ||
| 117 | + </tr> | ||
| 118 | + <tr class="row-odd"> | ||
| 119 | + <td><p class="first last">onSuccess</p></td> | ||
| 120 | + <td><p class="first last">Function</p></td> | ||
| 121 | + <td><p class="first last"><li>(必选) Function </p>初始化成功回调函数,返回值:</p>{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 122 | + </td> | ||
| 123 | + </tr> | ||
| 124 | + <tr class="row-odd"> | ||
| 125 | + <td><p class="first last">mcuErrorEventHandler</p></td> | ||
| 126 | + <td><p class="first last">Function</p></td> | ||
| 127 | + <td><p class="first last"><li>(必选) Function </p>整个MCUClient中Error异常监听</p></td> | ||
| 128 | + </tr> | ||
| 129 | + </tbody> | ||
| 130 | +</table></div> | ||
| 131 | + | ||
| 132 | + | ||
| 133 | + | ||
| 134 | +### 加入会议 ### | ||
| 135 | +#### client.joinClass (paramInfo,onSuccess) #### | ||
| 136 | +client初始化成功之后,加入会议。 | ||
| 137 | + | ||
| 138 | +示例代码 | ||
| 139 | + | ||
| 140 | + var paramInfo={ | ||
| 141 | + "userName":"大名",//自己的名字,在列表中显示 | ||
| 142 | + "password":"123321",//课堂密码,如果设置了密码需要验证 | ||
| 143 | + }; | ||
| 144 | + | ||
| 145 | + //加入会议 | ||
| 146 | + client.joinClass(paramInfo,onSuccess); | ||
| 147 | + | ||
| 148 | + function onSuccess(callbackData){ | ||
| 149 | + //加入会议成功回调 | ||
| 150 | + /*{ | ||
| 151 | + "siteId": "h5test", | ||
| 152 | + "confId": 1292388778, | ||
| 153 | + "h5Module": 0, | ||
| 154 | + "nodeId": 1484789938, | ||
| 155 | + "topNodeID": 101, | ||
| 156 | + "userRole": "normal", | ||
| 157 | + "role": 1, | ||
| 158 | + "isHost": false, | ||
| 159 | + "classRole": 0, | ||
| 160 | + "userId": "0", | ||
| 161 | + "userName": "cccccc", | ||
| 162 | + "password": "222222", | ||
| 163 | + "userType": 8, | ||
| 164 | + "passwordRequired": true, | ||
| 165 | + "md5": "b36da144521b70d89e72993cd1117b5b", | ||
| 166 | + "msType": 1, | ||
| 167 | + "portal": "112.126.80.182:80", | ||
| 168 | + "mcuDelay": 3000, | ||
| 169 | + "MCUServerIP": "123.56.73.119", | ||
| 170 | + "MCUServerPort": "7001", | ||
| 171 | + "maxVideoChannels": 1, | ||
| 172 | + "maxAudioChannels": 1, | ||
| 173 | + "maxMediaChannels": 2 | ||
| 174 | + }*/ | ||
| 175 | + }; | ||
| 176 | + | ||
| 177 | + | ||
| 178 | +<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 179 | + <colgroup> | ||
| 180 | + <col width="10%"> | ||
| 181 | + <col width="10%"> | ||
| 182 | + <col width="80%"> | ||
| 183 | + </colgroup> | ||
| 184 | + <tbody valign="m"> | ||
| 185 | + <tr class="row-odd"> | ||
| 186 | + <td><p class="first last">参数名称</p></td> | ||
| 187 | + <td><p class="first last">类型</p></td> | ||
| 188 | + <td><p class="first last">该对象包含以下属性</p></td> | ||
| 189 | + </tr> | ||
| 190 | + <tr class="row-even"> | ||
| 191 | + <td rowspan="3">paramInfo</td> | ||
| 192 | + <td rowspan="3"><p class="first last">对象</p></td> | ||
| 193 | + | ||
| 194 | + </tr> | ||
| 195 | + <tr class="row-odd"> | ||
| 196 | + <td> | ||
| 197 | + <ul> | ||
| 198 | + <li>userName:(必选)String </p>进入课堂的名字</li> | ||
| 199 | + </ul> | ||
| 200 | + </td> | ||
| 201 | + </tr> | ||
| 202 | + | ||
| 203 | + <tr class="row-odd"> | ||
| 204 | + <td> | ||
| 205 | + <ul> | ||
| 206 | + <li>password:(可选)String </p>进入课堂的密码,如果课堂不设置密码就不需要,设置了密码的情况下,进入课堂需要输入密码,根据初始化回调的参数passwordRequired来判断</li> | ||
| 207 | + </ul> | ||
| 208 | + </td> | ||
| 209 | + </tr> | ||
| 210 | + <tr class="row-odd"> | ||
| 211 | + <td><p class="first last">onSuccess</p></td> | ||
| 212 | + <td><p class="first last">Function</p></td> | ||
| 213 | + <td><p class="first last"><li>(必选) Function </p>成功回调函数</p> | ||
| 214 | + </td> | ||
| 215 | + </tr> | ||
| 216 | + | ||
| 217 | + </tbody> | ||
| 218 | +</table></div> | ||
| 219 | + | ||
| 220 | +### 离开会议 ### | ||
| 221 | +#### client.leaveClass() #### | ||
| 222 | +离开会议 | ||
| 223 | + | ||
| 224 | +### 获取当前的状态 ### | ||
| 225 | +#### client.mcuClientStatus() #### | ||
| 226 | +获取当前的状态 | ||
| 227 | + | ||
| 228 | +示例代码 | ||
| 229 | + | ||
| 230 | + var callbackData=client.mcuClientStatus(); | ||
| 231 | + //返回一个对象 | ||
| 232 | + //{code:0,message:"XXXXXX"} | ||
| 233 | + | ||
| 234 | +<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 235 | + <colgroup> | ||
| 236 | + <col width="10%"> | ||
| 237 | + <col width="10%"> | ||
| 238 | + <col width="80%"> | ||
| 239 | + </colgroup> | ||
| 240 | + <tbody valign="m"> | ||
| 241 | + <tr class="row-odd"> | ||
| 242 | + <td><p class="first last">参数名称</p></td> | ||
| 243 | + <td><p class="first last">类型</p></td> | ||
| 244 | + <td><p class="first last">该对象包含以下属性</p></td> | ||
| 245 | + </tr> | ||
| 246 | + <tr class="row-even"> | ||
| 247 | + <td rowspan="11">callbackData</td> | ||
| 248 | + <td rowspan="11"><p class="first last">对象</p></td> | ||
| 249 | + | ||
| 250 | + </tr> | ||
| 251 | + <tr class="row-odd"> | ||
| 252 | + <tr class="row-odd"> | ||
| 253 | + <td> | ||
| 254 | + <ul> | ||
| 255 | + <li>code:Number </p></li> | ||
| 256 | + 0 //SDK 未初始化</p> | ||
| 257 | + 1 //未加入会议</p> | ||
| 258 | + 2 //已经加入会议</p> | ||
| 259 | + 3 //已经离开会议</p> | ||
| 260 | + 4 //未知状态 | ||
| 261 | + </ul> | ||
| 262 | + </td> | ||
| 263 | + </tr> | ||
| 264 | + <td> | ||
| 265 | + <ul> | ||
| 266 | + <li>message:String </p> | ||
| 267 | + 状态的描述,对应code,默认为空</li> | ||
| 268 | + </ul> | ||
| 269 | + </td> | ||
| 270 | + </tr> | ||
| 271 | + </tbody> | ||
| 272 | +</table></div> | ||
| 273 | + | ||
| 274 | +### 发送消息 ### | ||
| 275 | +#### client.sendChatMsg(paramInfo) #### | ||
| 276 | +发送聊天消息 | ||
| 277 | + | ||
| 278 | +示例代码 | ||
| 279 | + | ||
| 280 | + var paramInfo={ | ||
| 281 | + "message":"需要发送的内容", | ||
| 282 | + "to":0 | ||
| 283 | + | ||
| 284 | + }; | ||
| 285 | + client.sendChatMsg(paramInfo); | ||
| 286 | + | ||
| 287 | +<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 288 | + <colgroup> | ||
| 289 | + <col width="10%"> | ||
| 290 | + <col width="10%"> | ||
| 291 | + <col width="80%"> | ||
| 292 | + </colgroup> | ||
| 293 | + <tbody valign="M"> | ||
| 294 | + <tr class="row-odd"> | ||
| 295 | + <td><p class="first last">参数名称</p></td> | ||
| 296 | + <td><p class="first last">类型</p></td> | ||
| 297 | + <td><p class="first last">该对象包含以下属性</p></td> | ||
| 298 | + </tr> | ||
| 299 | + <tr class="row-even"> | ||
| 300 | + <td rowspan="11">paramInfo</td> | ||
| 301 | + <td rowspan="11"><p class="first last">对象</p></td> | ||
| 302 | + | ||
| 303 | + </tr> | ||
| 304 | + <tr class="row-odd"> | ||
| 305 | + <tr class="row-odd"> | ||
| 306 | + <td> | ||
| 307 | + <ul> | ||
| 308 | + <li>message:(必选)String </p>消息内容</li> | ||
| 309 | + </ul> | ||
| 310 | + </td> | ||
| 311 | + </tr> | ||
| 312 | + <td> | ||
| 313 | + <ul> | ||
| 314 | + <li>to:(可选) Number </p> | ||
| 315 | + 接收消息的人的ID,默认值是0(所有人都)</li> | ||
| 316 | + </ul> | ||
| 317 | + </td> | ||
| 318 | + </tr> | ||
| 319 | + </tbody> | ||
| 320 | +</table></div> | ||
| 321 | + | ||
| 322 | +### 添加白板内容 ### | ||
| 323 | +#### client.sendInsertAnnotaion(paramInfo) #### | ||
| 324 | +添加白板内容,可以添加任意线段、直线、矩形、圆形、文本等等内容。下面的代码中将分别演示添加(任意线段、直线、矩形、圆形、文本)内容时调用接口所要传入的参数。 | ||
| 325 | + | ||
| 326 | +示例代码 | ||
| 327 | + | ||
| 328 | + | ||
| 329 | +1. 添加线段(不规则); | ||
| 330 | + | ||
| 331 | + var paramInfo={ | ||
| 332 | + "type": 0, | ||
| 333 | + "pointGroup": [{"w":10,"h":20},{"w":11,"h":21},{"w":12,"h":22}],//有多个坐标点组成 | ||
| 334 | + "color": "#000000", | ||
| 335 | + "thickness": 1 | ||
| 336 | + }; | ||
| 337 | + client.sendInsertAnnotaion(paramInfo); | ||
| 338 | +2. 添加直线; | ||
| 339 | + | ||
| 340 | + var paramInfo={ | ||
| 341 | + "type": 1, | ||
| 342 | + "pointGroup": [{"w":10,"h":20},{"w":60,"h":70}],//只有两个坐标点 [起点,终点] | ||
| 343 | + "color": "#000000", | ||
| 344 | + "thickness": 1 | ||
| 345 | + }; | ||
| 346 | + client.sendInsertAnnotaion(paramInfo); | ||
| 347 | + | ||
| 348 | + | ||
| 349 | +3. 添加矩形; | ||
| 350 | + | ||
| 351 | + var paramInfo={ | ||
| 352 | + "type": 2, | ||
| 353 | + "pointGroup": [{"w":10,"h":10},{"w":60,"h":60}],//矩形对角线 [对角线坐标点1,对角线坐标点2] | ||
| 354 | + "color": "#000000", | ||
| 355 | + "thickness": 1 | ||
| 356 | + }; | ||
| 357 | + client.sendInsertAnnotaion(paramInfo); | ||
| 358 | + | ||
| 359 | +4. 添加圆形; | ||
| 360 | + | ||
| 361 | + var paramInfo={ | ||
| 362 | + "type": 3, | ||
| 363 | + "pointGroup": [{"w":50,"h":50}],//只有一个坐标点[圆的中心坐标] | ||
| 364 | + "color": "#000000", | ||
| 365 | + "thickness": 1, | ||
| 366 | + "radius": 20 | ||
| 367 | + }; | ||
| 368 | + client.sendInsertAnnotaion(paramInfo); | ||
| 369 | + | ||
| 370 | +5. 添加文本; | ||
| 371 | + | ||
| 372 | + var paramInfo={ | ||
| 373 | + "type": 4, | ||
| 374 | + "pointGroup": [{"w":10,"h":20}],//只有一个坐标点[文本的左上角坐标] | ||
| 375 | + "color": "#000000", | ||
| 376 | + "fontSize": 14, | ||
| 377 | + "fontName": "", | ||
| 378 | + "text":"文本的内容" | ||
| 379 | + }; | ||
| 380 | + client.sendInsertAnnotaion(paramInfo); | ||
| 381 | + | ||
| 382 | + | ||
| 383 | +<div class="wy-table-responsive"> | ||
| 384 | + <table border="1" class="docutils"> | ||
| 385 | + <colgroup> | ||
| 386 | + <col width="10%"> | ||
| 387 | + <col width="10%"> | ||
| 388 | + <col width="80%"> | ||
| 389 | + </colgroup> | ||
| 390 | + <tbody valign="m"> | ||
| 391 | + <tr class="row-odd"> | ||
| 392 | + <td><p class="first last">参数名称</p></td> | ||
| 393 | + <td><p class="first last">类型</p></td> | ||
| 394 | + <td><p class="first last">该对象包含以下属性</p></td> | ||
| 395 | + </tr> | ||
| 396 | + <tr class="row-even"> | ||
| 397 | + <td rowspan="11">paramInfo</td> | ||
| 398 | + <td rowspan="11"><p class="first last">对象</p></td> | ||
| 399 | + | ||
| 400 | + </tr> | ||
| 401 | + <tr class="row-odd"> | ||
| 402 | + <tr class="row-odd"> | ||
| 403 | + <td> | ||
| 404 | + <ul> | ||
| 405 | + <li>type:(必选)Number</p></li> | ||
| 406 | + 0 (线段), 1 (直线), 2(矩形), 3(圆形), 4(文本) | ||
| 407 | + </ul> | ||
| 408 | + </td> | ||
| 409 | + </tr> | ||
| 410 | + <td> | ||
| 411 | + <ul> | ||
| 412 | + <li>pointGroup:(必选)array[{"w":w,"h":h}] </p> | ||
| 413 | + 画布上的坐标点对象集合数组,数组中坐标点对象的数量根据type的类型而定,上面有示例代码</li> | ||
| 414 | + </ul> | ||
| 415 | + </td> | ||
| 416 | + </tr> | ||
| 417 | + </tr> | ||
| 418 | + <td> | ||
| 419 | + <ul> | ||
| 420 | + <li>text:(文本必选)String </p> | ||
| 421 | + 文本的内容,这个属性只有在type类型为文本的时候使用,其它类型的情况下不使用</li> | ||
| 422 | + </ul> | ||
| 423 | + </td> | ||
| 424 | + </tr> | ||
| 425 | + </tr> | ||
| 426 | + <td> | ||
| 427 | + <ul> | ||
| 428 | + <li>radius:(绘制圆形必选)Number </p> | ||
| 429 | + 圆的半径(按画布宽度百分比计算),这个只在绘制圆的时候使用,其他type的时候不使用,这个值是一个相对画布宽度大小的百分比,比如在画布宽度为400,要绘制一个半径为40的圆,计算的百分比值=40/400=10%,那么radius=10</li> | ||
| 430 | + </ul> | ||
| 431 | + </td> | ||
| 432 | + </tr> | ||
| 433 | + </tr> | ||
| 434 | + <td> | ||
| 435 | + <ul> | ||
| 436 | + <li>color:(可选)String </p> | ||
| 437 | + 颜色值,默认为"#000000"</li> | ||
| 438 | + </ul> | ||
| 439 | + </td> | ||
| 440 | + </tr> | ||
| 441 | + </tr> | ||
| 442 | + <td> | ||
| 443 | + <ul> | ||
| 444 | + <li>thickness:(可选)Number </p> | ||
| 445 | + 线条的粗细度,除了文本之外的图像都有线条粗细,默认值为1</li> | ||
| 446 | + </ul> | ||
| 447 | + </td> | ||
| 448 | + </tr> | ||
| 449 | + | ||
| 450 | + </tr> | ||
| 451 | + <td> | ||
| 452 | + <ul> | ||
| 453 | + <li>fontSize:(可选)Number </p> | ||
| 454 | + 文本的字体大小,默认值为14,这个属性只有在type类型为文本的时候使用,其它类型的情况下不使用</li> | ||
| 455 | + </ul> | ||
| 456 | + </td> | ||
| 457 | + </tr> | ||
| 458 | + </tr> | ||
| 459 | + <td> | ||
| 460 | + <ul> | ||
| 461 | + <li>fontName:(可选)String </p> | ||
| 462 | + 文本字体,默认值为null,这个属性只有在type类型为文本的时候使用,其它类型的情况下不使用</li> | ||
| 463 | + </ul> | ||
| 464 | + </td> | ||
| 465 | + </tr> | ||
| 466 | + </tbody> | ||
| 467 | + </table> | ||
| 468 | +</div> | ||
| 469 | + | ||
| 470 | + | ||
| 471 | +## <font color=blue>McuClient 回调事件 </font>## | ||
| 472 | + | ||
| 473 | + | ||
| 474 | +### 会议日志信息 事件回调 ### | ||
| 475 | +示例代码 | ||
| 476 | + | ||
| 477 | + client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){ | ||
| 478 | + | ||
| 479 | + //返回值 | ||
| 480 | + /*{ | ||
| 481 | + "repeatmonthweekweek": 0, | ||
| 482 | + "endmode": 0, | ||
| 483 | + "repeatweek": "", | ||
| 484 | + "endcount": 1, | ||
| 485 | + "errorCode": 0, | ||
| 486 | + "cycle": 0, | ||
| 487 | + "repeatmonthday": 0, | ||
| 488 | + "frequency": 1, | ||
| 489 | + "repeatday": 0, | ||
| 490 | + "meetingName": "mcuClient", | ||
| 491 | + "repeatmode": 0, | ||
| 492 | + "finalenddate": "", | ||
| 493 | + "meetingContent": "", | ||
| 494 | + "beginTime": "2017-01-16 13:00:00", | ||
| 495 | + "endTime": "2017-01-31 15:00:00", | ||
| 496 | + "monthType": 0, | ||
| 497 | + "category": "", | ||
| 498 | + "repeatmonthweekday": 0, | ||
| 499 | + "status": 1 | ||
| 500 | + }*/ | ||
| 501 | + }); | ||
| 502 | + | ||
| 503 | +### 会议有人入 事件回调 ### | ||
| 504 | +示例代码 | ||
| 505 | + | ||
| 506 | + client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){ | ||
| 507 | + //返回值 | ||
| 508 | + /*{ | ||
| 509 | + "nodeId": 1483947664, | ||
| 510 | + "nodeData": { | ||
| 511 | + "nodeId": 1483947664, | ||
| 512 | + "name": "cccccc", | ||
| 513 | + "role": 1, | ||
| 514 | + "level": 0, | ||
| 515 | + "audioRecords": [], | ||
| 516 | + "videoRecords": [], | ||
| 517 | + "status": null, | ||
| 518 | + "userData": { | ||
| 519 | + "qq": "", | ||
| 520 | + "skype": "", | ||
| 521 | + "mobile": "" | ||
| 522 | + }, | ||
| 523 | + "userId": "0", | ||
| 524 | + "handUpTime": null, | ||
| 525 | + "deviceType": 3, | ||
| 526 | + "mobileDirection": null | ||
| 527 | + } | ||
| 528 | + }*/ | ||
| 529 | + }); | ||
| 530 | + | ||
| 531 | +### 会议有人离开 事件回调 ### | ||
| 532 | +示例代码 | ||
| 533 | + | ||
| 534 | + client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){ | ||
| 535 | + //{"nodeId":1234} | ||
| 536 | + }); | ||
| 537 | +### 关闭会议 事件回调 ### | ||
| 538 | +示例代码 | ||
| 539 | + | ||
| 540 | + client.on(MessageTypes.CLASS_EXIT, function(callbackData){ | ||
| 541 | + //..... | ||
| 542 | + }); | ||
| 543 | + | ||
| 544 | +### 收到聊天消息 事件回调 ### | ||
| 545 | +示例代码 | ||
| 546 | + | ||
| 547 | + client.on(MessageTypes.CHAT_RECEIVE, function(callbackData){ | ||
| 548 | + //返回值 | ||
| 549 | + /*{ | ||
| 550 | + "fromNodeID": 1484207995, | ||
| 551 | + "toNodeID": 0, | ||
| 552 | + "message": "消息内容", | ||
| 553 | + "fromName": "发送消息人的名字", | ||
| 554 | + "fromRole": 0 | ||
| 555 | + }*/ | ||
| 556 | + }); | ||
| 557 | + | ||
| 558 | +### 视频显示 事件回调 ### | ||
| 559 | +示例代码 | ||
| 560 | + | ||
| 561 | + client.on(MessageTypes.VIDEO_RECEIVE, function(callbackData){ | ||
| 562 | + //..... | ||
| 563 | + }); | ||
| 564 | + | ||
| 565 | +### 文档 事件回调 ### | ||
| 566 | +示例代码 | ||
| 567 | + | ||
| 568 | + client.on(MessageTypes.DOC_SHOW, function(callbackData){ | ||
| 569 | + //..... | ||
| 570 | + }); | ||
| 571 | + | ||
| 572 | +### 文档笔记 事件回调 ### | ||
| 573 | +示例代码 | ||
| 574 | + | ||
| 575 | + client.on(MessageTypes.DOC_ANNOTATION,function(callbackData){ | ||
| 576 | + //..... | ||
| 577 | + }); | ||
| 578 | + | ||
| 579 | +### 删除文档 事件回调 ### | ||
| 580 | +示例代码 | ||
| 581 | + | ||
| 582 | + client.on(MessageTypes.DOC_DEL,function(callbackData){ | ||
| 583 | + //..... | ||
| 584 | + }); | ||
| 585 | + | ||
| 586 | +---------- | ||
| 587 | + | ||
| 588 | +## <font color=blue>ErrorCode 错误码查询</font> ## | ||
| 589 | + | ||
| 590 | +<div class="wy-table-responsive"> | ||
| 591 | + <table border="1" class="docutils"> | ||
| 592 | + <colgroup> | ||
| 593 | + <col width="14%"> | ||
| 594 | + <col width="10%"> | ||
| 595 | + <col width="76%"> | ||
| 596 | + </colgroup> | ||
| 597 | + <tbody valign="M"> | ||
| 598 | + <tr class="row-odd"> | ||
| 599 | + <td><p class="first last">错误代码</p></td> | ||
| 600 | + <td><p class="first last">值(code)</p></td> | ||
| 601 | + <td><p class="first last">描述(reson)</p></td> | ||
| 602 | + </tr> | ||
| 603 | + | ||
| 604 | + <tr class="row-even"> | ||
| 605 | + <td>ERR_CLASS_INIT_PAEAM</td> | ||
| 606 | + <td>100</td> | ||
| 607 | + <td><p class="first last">初始化参数错误</p></td> | ||
| 608 | + </tr> | ||
| 609 | + <tr class="row-even"> | ||
| 610 | + <td>ERR_CLASS_INIT_NETWORK</td> | ||
| 611 | + <td>101</td> | ||
| 612 | + <td><p class="first last">初始化网络错误</p></td> | ||
| 613 | + </tr> | ||
| 614 | + <tr class="row-even"> | ||
| 615 | + <td>ERR_CLASS_INIT_PROTOCOL</td> | ||
| 616 | + <td>102</td> | ||
| 617 | + <td><p class="first last">初始化协议错误</p></td> | ||
| 618 | + </tr> | ||
| 619 | + <tr class="row-even"> | ||
| 620 | + <td>ERR_CLASS_INIT_FAILED</td> | ||
| 621 | + <td>103</td> | ||
| 622 | + <td><p class="first last">初始化验证失败</p></td> | ||
| 623 | + </tr> | ||
| 624 | + | ||
| 625 | + | ||
| 626 | + | ||
| 627 | + <tr class="row-even"> | ||
| 628 | + <td>ERR_CLASS_JOIN_NETWORK</td> | ||
| 629 | + <td>200</td> | ||
| 630 | + <td><p class="first last">加入会议网络错误</p></td> | ||
| 631 | + </tr> | ||
| 632 | + <tr class="row-even"> | ||
| 633 | + <td>ERR_CLASS_JOIN_PROTOCOL</td> | ||
| 634 | + <td>201</td> | ||
| 635 | + <td><p class="first last">加入会议化协议错误</p></td> | ||
| 636 | + </tr> | ||
| 637 | + <tr class="row-even"> | ||
| 638 | + <td>ERR_CLASS_JOIN_FAILED</td> | ||
| 639 | + <td>202</td> | ||
| 640 | + <td><p class="first last">加入会议化异常错误</p></td> | ||
| 641 | + </tr> | ||
| 642 | + <tr class="row-even"> | ||
| 643 | + <td>ERR_CLASS_JOIN_PARAM</td> | ||
| 644 | + <td>203</td> | ||
| 645 | + <td><p class="first last">加入会议参数错误</p></td> | ||
| 646 | + </tr> | ||
| 647 | + <tr class="row-even"> | ||
| 648 | + <td>ERR_CLASS_JOIN_FULL</td> | ||
| 649 | + <td>204</td> | ||
| 650 | + <td><p class="first last">人数已满</p></td> | ||
| 651 | + </tr> | ||
| 652 | + <tr class="row-even"> | ||
| 653 | + <td>ERR_CLASS_MD5_WRONG</td> | ||
| 654 | + <td>205</td> | ||
| 655 | + <td><p class="first last">MD5验证失败</p></td> | ||
| 656 | + </tr> | ||
| 657 | + <tr class="row-even"> | ||
| 658 | + <td>ERR_CLASS_PASSWORD_WRONG</td> | ||
| 659 | + <td>206</td> | ||
| 660 | + <td><p class="first last">密码错误</p></td> | ||
| 661 | + </tr> | ||
| 662 | + <tr class="row-even"> | ||
| 663 | + <td>ERR_CLASS_JOIN_CONFILICT</td> | ||
| 664 | + <td>207</td> | ||
| 665 | + <td><p class="first last">已经在其它地方登陆</p></td> | ||
| 666 | + </tr> | ||
| 667 | + | ||
| 668 | + | ||
| 669 | + | ||
| 670 | + | ||
| 671 | + <tr class="row-even"> | ||
| 672 | + <td>ERR_GET_CLASS_DETAIL</td> | ||
| 673 | + <td>300</td> | ||
| 674 | + <td><p class="first last">获取classDetail失败</p></td> | ||
| 675 | + </tr> | ||
| 676 | + <tr class="row-even"> | ||
| 677 | + <td>ERR_GET_MEETING_PARAML</td> | ||
| 678 | + <td>301</td> | ||
| 679 | + <td><p class="first last">获取MeetingParam失败</p></td> | ||
| 680 | + </tr> | ||
| 681 | + | ||
| 682 | + | ||
| 683 | + <tr class="row-even"> | ||
| 684 | + <td>ERR_NETWORK</td> | ||
| 685 | + <td>10000</td> | ||
| 686 | + <td><p class="first last">网络错误</p></td> | ||
| 687 | + </tr> | ||
| 688 | + <tr class="row-even"> | ||
| 689 | + <td>ERR_UNKNOWN</td> | ||
| 690 | + <td>10001</td> | ||
| 691 | + <td><p class="first last">未知错误</p></td> | ||
| 692 | + </tr> | ||
| 693 | + | ||
| 694 | + <tr class="row-even"> | ||
| 695 | + <td>ERR_SOCKET_DISCONNECT</td> | ||
| 696 | + <td>20000</td> | ||
| 697 | + <td><p class="first last">MCU断开连接,已经离开会议</p></td> | ||
| 698 | + </tr> | ||
| 699 | + </tbody> | ||
| 700 | + </table> | ||
| 701 | +</div> |
docs/McuClient_v.1.0.3_API.pdf
0 → 100644
不能预览此文件类型
-
请 注册 或 登录 后发表评论