正在显示
9 个修改的文件
包含
0 行增加
和
3476 行删除
docs/McuClient_v.1.0.1_API.html
已删除
100644 → 0
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html> | ||
| 3 | -<head> | ||
| 4 | -<title>McuClient_v.1.0.1_API</title> | ||
| 5 | -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 6 | -<style type="text/css"> | ||
| 7 | -/* GitHub stylesheet for MarkdownPad (http://markdownpad.com) */ | ||
| 8 | -/* Author: Nicolas Hery - http://nicolashery.com */ | ||
| 9 | -/* Version: b13fe65ca28d2e568c6ed5d7f06581183df8f2ff */ | ||
| 10 | -/* Source: https://github.com/nicolahery/markdownpad-github */ | ||
| 11 | - | ||
| 12 | -/* RESET | ||
| 13 | -=============================================================================*/ | ||
| 14 | - | ||
| 15 | -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { | ||
| 16 | - margin: 0; | ||
| 17 | - padding: 0; | ||
| 18 | - border: 0; | ||
| 19 | -} | ||
| 20 | - | ||
| 21 | -/* BODY | ||
| 22 | -=============================================================================*/ | ||
| 23 | - | ||
| 24 | -body { | ||
| 25 | - font-family: Helvetica, arial, freesans, clean, sans-serif; | ||
| 26 | - font-size: 14px; | ||
| 27 | - line-height: 1.6; | ||
| 28 | - color: #333; | ||
| 29 | - background-color: #fff; | ||
| 30 | - padding: 20px; | ||
| 31 | - max-width: 960px; | ||
| 32 | - margin: 0 auto; | ||
| 33 | -} | ||
| 34 | - | ||
| 35 | -body>*:first-child { | ||
| 36 | - margin-top: 0 !important; | ||
| 37 | -} | ||
| 38 | - | ||
| 39 | -body>*:last-child { | ||
| 40 | - margin-bottom: 0 !important; | ||
| 41 | -} | ||
| 42 | - | ||
| 43 | -/* BLOCKS | ||
| 44 | -=============================================================================*/ | ||
| 45 | - | ||
| 46 | -p, blockquote, ul, ol, dl, table, pre { | ||
| 47 | - margin: 15px 0; | ||
| 48 | -} | ||
| 49 | - | ||
| 50 | -/* HEADERS | ||
| 51 | -=============================================================================*/ | ||
| 52 | - | ||
| 53 | -h1, h2, h3, h4, h5, h6 { | ||
| 54 | - margin: 20px 0 10px; | ||
| 55 | - padding: 0; | ||
| 56 | - font-weight: bold; | ||
| 57 | - -webkit-font-smoothing: antialiased; | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code { | ||
| 61 | - font-size: inherit; | ||
| 62 | -} | ||
| 63 | - | ||
| 64 | -h1 { | ||
| 65 | - font-size: 28px; | ||
| 66 | - color: #000; | ||
| 67 | -} | ||
| 68 | - | ||
| 69 | -h2 { | ||
| 70 | - font-size: 24px; | ||
| 71 | - border-bottom: 1px solid #ccc; | ||
| 72 | - color: #000; | ||
| 73 | -} | ||
| 74 | - | ||
| 75 | -h3 { | ||
| 76 | - font-size: 18px; | ||
| 77 | -} | ||
| 78 | - | ||
| 79 | -h4 { | ||
| 80 | - font-size: 16px; | ||
| 81 | -} | ||
| 82 | - | ||
| 83 | -h5 { | ||
| 84 | - font-size: 14px; | ||
| 85 | -} | ||
| 86 | - | ||
| 87 | -h6 { | ||
| 88 | - color: #777; | ||
| 89 | - font-size: 14px; | ||
| 90 | -} | ||
| 91 | - | ||
| 92 | -body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child { | ||
| 93 | - margin-top: 0; | ||
| 94 | - padding-top: 0; | ||
| 95 | -} | ||
| 96 | - | ||
| 97 | -a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { | ||
| 98 | - margin-top: 0; | ||
| 99 | - padding-top: 0; | ||
| 100 | -} | ||
| 101 | - | ||
| 102 | -h1+p, h2+p, h3+p, h4+p, h5+p, h6+p { | ||
| 103 | - margin-top: 10px; | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -/* LINKS | ||
| 107 | -=============================================================================*/ | ||
| 108 | - | ||
| 109 | -a { | ||
| 110 | - color: #4183C4; | ||
| 111 | - text-decoration: none; | ||
| 112 | -} | ||
| 113 | - | ||
| 114 | -a:hover { | ||
| 115 | - text-decoration: underline; | ||
| 116 | -} | ||
| 117 | - | ||
| 118 | -/* LISTS | ||
| 119 | -=============================================================================*/ | ||
| 120 | - | ||
| 121 | -ul, ol { | ||
| 122 | - padding-left: 30px; | ||
| 123 | -} | ||
| 124 | - | ||
| 125 | -ul li > :first-child, | ||
| 126 | -ol li > :first-child, | ||
| 127 | -ul li ul:first-of-type, | ||
| 128 | -ol li ol:first-of-type, | ||
| 129 | -ul li ol:first-of-type, | ||
| 130 | -ol li ul:first-of-type { | ||
| 131 | - margin-top: 0px; | ||
| 132 | -} | ||
| 133 | - | ||
| 134 | -ul ul, ul ol, ol ol, ol ul { | ||
| 135 | - margin-bottom: 0; | ||
| 136 | -} | ||
| 137 | - | ||
| 138 | -dl { | ||
| 139 | - padding: 0; | ||
| 140 | -} | ||
| 141 | - | ||
| 142 | -dl dt { | ||
| 143 | - font-size: 14px; | ||
| 144 | - font-weight: bold; | ||
| 145 | - font-style: italic; | ||
| 146 | - padding: 0; | ||
| 147 | - margin: 15px 0 5px; | ||
| 148 | -} | ||
| 149 | - | ||
| 150 | -dl dt:first-child { | ||
| 151 | - padding: 0; | ||
| 152 | -} | ||
| 153 | - | ||
| 154 | -dl dt>:first-child { | ||
| 155 | - margin-top: 0px; | ||
| 156 | -} | ||
| 157 | - | ||
| 158 | -dl dt>:last-child { | ||
| 159 | - margin-bottom: 0px; | ||
| 160 | -} | ||
| 161 | - | ||
| 162 | -dl dd { | ||
| 163 | - margin: 0 0 15px; | ||
| 164 | - padding: 0 15px; | ||
| 165 | -} | ||
| 166 | - | ||
| 167 | -dl dd>:first-child { | ||
| 168 | - margin-top: 0px; | ||
| 169 | -} | ||
| 170 | - | ||
| 171 | -dl dd>:last-child { | ||
| 172 | - margin-bottom: 0px; | ||
| 173 | -} | ||
| 174 | - | ||
| 175 | -/* CODE | ||
| 176 | -=============================================================================*/ | ||
| 177 | - | ||
| 178 | -pre, code, tt { | ||
| 179 | - font-size: 12px; | ||
| 180 | - font-family: Consolas, "Liberation Mono", Courier, monospace; | ||
| 181 | -} | ||
| 182 | - | ||
| 183 | -code, tt { | ||
| 184 | - margin: 0 0px; | ||
| 185 | - padding: 0px 0px; | ||
| 186 | - white-space: nowrap; | ||
| 187 | - border: 1px solid #eaeaea; | ||
| 188 | - background-color: #f8f8f8; | ||
| 189 | - border-radius: 3px; | ||
| 190 | -} | ||
| 191 | - | ||
| 192 | -pre>code { | ||
| 193 | - margin: 0; | ||
| 194 | - padding: 0; | ||
| 195 | - white-space: pre; | ||
| 196 | - border: none; | ||
| 197 | - background: transparent; | ||
| 198 | -} | ||
| 199 | - | ||
| 200 | -pre { | ||
| 201 | - background-color: #f8f8f8; | ||
| 202 | - border: 1px solid #ccc; | ||
| 203 | - font-size: 13px; | ||
| 204 | - line-height: 19px; | ||
| 205 | - overflow: auto; | ||
| 206 | - padding: 6px 10px; | ||
| 207 | - border-radius: 3px; | ||
| 208 | -} | ||
| 209 | - | ||
| 210 | -pre code, pre tt { | ||
| 211 | - background-color: transparent; | ||
| 212 | - border: none; | ||
| 213 | -} | ||
| 214 | - | ||
| 215 | -kbd { | ||
| 216 | - -moz-border-bottom-colors: none; | ||
| 217 | - -moz-border-left-colors: none; | ||
| 218 | - -moz-border-right-colors: none; | ||
| 219 | - -moz-border-top-colors: none; | ||
| 220 | - background-color: #DDDDDD; | ||
| 221 | - background-image: linear-gradient(#F1F1F1, #DDDDDD); | ||
| 222 | - background-repeat: repeat-x; | ||
| 223 | - border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD; | ||
| 224 | - border-image: none; | ||
| 225 | - border-radius: 2px 2px 2px 2px; | ||
| 226 | - border-style: solid; | ||
| 227 | - border-width: 1px; | ||
| 228 | - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; | ||
| 229 | - line-height: 10px; | ||
| 230 | - padding: 1px 4px; | ||
| 231 | -} | ||
| 232 | - | ||
| 233 | -/* QUOTES | ||
| 234 | -=============================================================================*/ | ||
| 235 | - | ||
| 236 | -blockquote { | ||
| 237 | - border-left: 4px solid #DDD; | ||
| 238 | - padding: 0 15px; | ||
| 239 | - color: #777; | ||
| 240 | -} | ||
| 241 | - | ||
| 242 | -blockquote>:first-child { | ||
| 243 | - margin-top: 0px; | ||
| 244 | -} | ||
| 245 | - | ||
| 246 | -blockquote>:last-child { | ||
| 247 | - margin-bottom: 0px; | ||
| 248 | -} | ||
| 249 | - | ||
| 250 | -/* HORIZONTAL RULES | ||
| 251 | -=============================================================================*/ | ||
| 252 | - | ||
| 253 | -hr { | ||
| 254 | - clear: both; | ||
| 255 | - margin: 15px 0; | ||
| 256 | - height: 0px; | ||
| 257 | - overflow: hidden; | ||
| 258 | - border: none; | ||
| 259 | - background: transparent; | ||
| 260 | - border-bottom: 4px solid #ddd; | ||
| 261 | - padding: 0; | ||
| 262 | -} | ||
| 263 | - | ||
| 264 | -/* TABLES | ||
| 265 | -=============================================================================*/ | ||
| 266 | - | ||
| 267 | -table th { | ||
| 268 | - font-weight: bold; | ||
| 269 | -} | ||
| 270 | - | ||
| 271 | -table th, table td { | ||
| 272 | - border: 1px solid #ccc; | ||
| 273 | - padding: 6px 13px; | ||
| 274 | -} | ||
| 275 | - | ||
| 276 | -table tr { | ||
| 277 | - border-top: 1px solid #ccc; | ||
| 278 | - background-color: #fff; | ||
| 279 | -} | ||
| 280 | - | ||
| 281 | -table tr:nth-child(2n) { | ||
| 282 | - background-color: #f8f8f8; | ||
| 283 | -} | ||
| 284 | - | ||
| 285 | -/* IMAGES | ||
| 286 | -=============================================================================*/ | ||
| 287 | - | ||
| 288 | -img { | ||
| 289 | - max-width: 100% | ||
| 290 | -} | ||
| 291 | -</style> | ||
| 292 | -</head> | ||
| 293 | -<body> | ||
| 294 | -<h1>McuClient API参考说明</h1> | ||
| 295 | - | ||
| 296 | -<p></p></p> | ||
| 297 | - | ||
| 298 | -<hr /> | ||
| 299 | - | ||
| 300 | -<h2><font color=blue>McuClient 目录</font></h2> | ||
| 301 | - | ||
| 302 | -<blockquote> | ||
| 303 | - <ul> | ||
| 304 | - <li><p><strong>创建McuClient对象</strong></p></li> | ||
| 305 | - <li><p><strong>McuClient接口</strong></p></li> | ||
| 306 | - <li><p><strong>McuClient回调事件</strong></p></li> | ||
| 307 | - <li><p><strong>ErrorCode 错误码查询</strong></p></li> | ||
| 308 | - </ul> | ||
| 309 | -</blockquote> | ||
| 310 | - | ||
| 311 | -<hr /> | ||
| 312 | - | ||
| 313 | -<h2><font color=blue>使用步骤说明</font></h2> | ||
| 314 | - | ||
| 315 | -<blockquote> | ||
| 316 | - <ol> | ||
| 317 | - <li>创建McuClient对象</li> | ||
| 318 | - <li>McuClient初始化init</li> | ||
| 319 | - <li>添加MessageTypes中的事件监听(接收各个模块的消息)</li> | ||
| 320 | - <li>McuClient加入会议</li> | ||
| 321 | - <li>加入会议成功之后可以调用其他接口和监听事件</li> | ||
| 322 | - </ol> | ||
| 323 | -</blockquote> | ||
| 324 | - | ||
| 325 | -<hr /> | ||
| 326 | - | ||
| 327 | -<h2><font color=blue>创建McuClient对象</font></h2> | ||
| 328 | - | ||
| 329 | -<p>只创建一次</p> | ||
| 330 | - | ||
| 331 | -<p>示例代码</p> | ||
| 332 | - | ||
| 333 | -<pre><code>window.onload=function(){ | ||
| 334 | - //创建client,这是必须的第一步 | ||
| 335 | - const client=MCUClientEngine.createMcuClient(); | ||
| 336 | - //获取事件监听消息定义 | ||
| 337 | - const MessageTypes=MCUClientEngine.MessageTypes; | ||
| 338 | -} | ||
| 339 | -</code></pre> | ||
| 340 | - | ||
| 341 | -<hr /> | ||
| 342 | - | ||
| 343 | -<h2><font color=blue>McuClient接口 </font></h2> | ||
| 344 | - | ||
| 345 | -<h3>初始化</h3> | ||
| 346 | - | ||
| 347 | -<h4>client.init (paramInfo,onSuccess,mcuErrorEventHandler)</h4> | ||
| 348 | - | ||
| 349 | -<p>client创建完成之后第一步需要初始化。</p> | ||
| 350 | - | ||
| 351 | -<p>示例代码</p> | ||
| 352 | - | ||
| 353 | -<pre><code>var paramInfo={ | ||
| 354 | - "meetingNumber":123456, | ||
| 355 | - "portal":"127.0.0.1:80", | ||
| 356 | - "usertRole":"normal", | ||
| 357 | - "userID":0, | ||
| 358 | -}; | ||
| 359 | -//初始化 | ||
| 360 | -client.init(paramInfo,onSuccess,mcuErrorEventHandler); | ||
| 361 | -function onSuccess(callbackData){ | ||
| 362 | - //初始化成功回调 | ||
| 363 | - //{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 364 | -}; | ||
| 365 | -function mcuErrorEventHandler(callbackData){ | ||
| 366 | - //整个MCUClient中Error异常监听 | ||
| 367 | - //返回值callbackData的结构为{"code":errorCode,"reson":""} | ||
| 368 | - //errorCode的列表在文档最后面的 ErrorCode错误码查询 | ||
| 369 | -}; | ||
| 370 | -</code></pre> | ||
| 371 | - | ||
| 372 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 373 | - <colgroup> | ||
| 374 | - <col width="10%"> | ||
| 375 | - <col width="10%"> | ||
| 376 | - <col width="80%"> | ||
| 377 | - </colgroup> | ||
| 378 | - <tbody valign="mid"> | ||
| 379 | - <tr class="row-odd"> | ||
| 380 | - <td><p class="first last">参数名称</p></td> | ||
| 381 | - <td><p class="first last">类型</p></td> | ||
| 382 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 383 | - </tr> | ||
| 384 | - <tr class="row-even"> | ||
| 385 | - <td rowspan="5">paramInfo</td> | ||
| 386 | - <td rowspan="5"><p class="first last">对象</p></td> | ||
| 387 | - | ||
| 388 | - </tr> | ||
| 389 | - <tr class="row-odd"> | ||
| 390 | - <td> | ||
| 391 | - <ul> | ||
| 392 | - <li>meetingNumber:(必选)Number </p>课堂号</li> | ||
| 393 | - </ul> | ||
| 394 | - </td> | ||
| 395 | - </tr> | ||
| 396 | - <tr class="row-odd"> | ||
| 397 | - <td> | ||
| 398 | - <ul> | ||
| 399 | - <li>portal:(必选)String </p>IP地址</li> | ||
| 400 | - </ul> | ||
| 401 | - </td> | ||
| 402 | - </tr> | ||
| 403 | - <tr class="row-odd"> | ||
| 404 | - <td> | ||
| 405 | - <ul> | ||
| 406 | - <li>usertRole:(可选) String </p> | ||
| 407 | - 用户的身份,5种类型,默认是normal | ||
| 408 | - ;host(主持人/老师)、presenter(主讲人)、assistant(助教)、normal(普通角色/学生),record(暂时没用)</li> | ||
| 409 | - </ul> | ||
| 410 | - </td> | ||
| 411 | - </tr> | ||
| 412 | - <tr class="row-odd"> | ||
| 413 | - <td> | ||
| 414 | - <ul> | ||
| 415 | - <li>userId:(可选) String </p> | ||
| 416 | - 第三方用户id,默认是0 | ||
| 417 | - </ul> | ||
| 418 | - </td> | ||
| 419 | - </tr> | ||
| 420 | - <tr class="row-odd"> | ||
| 421 | - <td><p class="first last">onSuccess</p></td> | ||
| 422 | - <td><p class="first last">Function</p></td> | ||
| 423 | - <td><p class="first last"><li>(必选) Function </p>初始化成功回调函数,返回值:</p>{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 424 | - </td> | ||
| 425 | - </tr> | ||
| 426 | - <tr class="row-odd"> | ||
| 427 | - <td><p class="first last">mcuErrorEventHandler</p></td> | ||
| 428 | - <td><p class="first last">Function</p></td> | ||
| 429 | - <td><p class="first last"><li>(必选) Function </p>整个MCUClient中Error异常监听</p></td> | ||
| 430 | - </tr> | ||
| 431 | - </tbody> | ||
| 432 | -</table></div> | ||
| 433 | - | ||
| 434 | -<h3>加入会议</h3> | ||
| 435 | - | ||
| 436 | -<h4>client.joinClass (paramInfo,onSuccess)</h4> | ||
| 437 | - | ||
| 438 | -<p>client初始化成功之后,加入会议。</p> | ||
| 439 | - | ||
| 440 | -<p>示例代码</p> | ||
| 441 | - | ||
| 442 | -<pre><code>var paramInfo={ | ||
| 443 | - "userName":"大名",//自己的名字,在列表中显示 | ||
| 444 | - "password":"123321",//课堂密码,如果设置了密码需要验证 | ||
| 445 | -}; | ||
| 446 | - | ||
| 447 | -//加入会议 | ||
| 448 | -client.joinClass(paramInfo,onSuccess); | ||
| 449 | - | ||
| 450 | -function onSuccess(callbackData){ | ||
| 451 | - //加入会议成功回调 | ||
| 452 | - //{"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} | ||
| 453 | -}; | ||
| 454 | -</code></pre> | ||
| 455 | - | ||
| 456 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 457 | - <colgroup> | ||
| 458 | - <col width="10%"> | ||
| 459 | - <col width="10%"> | ||
| 460 | - <col width="80%"> | ||
| 461 | - </colgroup> | ||
| 462 | - <tbody valign="m"> | ||
| 463 | - <tr class="row-odd"> | ||
| 464 | - <td><p class="first last">参数名称</p></td> | ||
| 465 | - <td><p class="first last">类型</p></td> | ||
| 466 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 467 | - </tr> | ||
| 468 | - <tr class="row-even"> | ||
| 469 | - <td rowspan="3">paramInfo</td> | ||
| 470 | - <td rowspan="3"><p class="first last">对象</p></td> | ||
| 471 | - | ||
| 472 | - </tr> | ||
| 473 | - <tr class="row-odd"> | ||
| 474 | - <td> | ||
| 475 | - <ul> | ||
| 476 | - <li>userName:(必选)String </p>进入课堂的名字</li> | ||
| 477 | - </ul> | ||
| 478 | - </td> | ||
| 479 | - </tr> | ||
| 480 | - | ||
| 481 | - <tr class="row-odd"> | ||
| 482 | - <td> | ||
| 483 | - <ul> | ||
| 484 | - <li>password:(可选)String </p>进入课堂的密码,如果课堂不设置密码就不需要,设置了密码的情况下,进入课堂需要输入密码,根据初始化回调的参数passwordRequired来判断</li> | ||
| 485 | - </ul> | ||
| 486 | - </td> | ||
| 487 | - </tr> | ||
| 488 | - <tr class="row-odd"> | ||
| 489 | - <td><p class="first last">onSuccess</p></td> | ||
| 490 | - <td><p class="first last">Function</p></td> | ||
| 491 | - <td><p class="first last"><li>(必选) Function </p>成功回调函数</p> | ||
| 492 | - </td> | ||
| 493 | - </tr> | ||
| 494 | - | ||
| 495 | - </tbody> | ||
| 496 | -</table></div> | ||
| 497 | - | ||
| 498 | -<h3>离开会议</h3> | ||
| 499 | - | ||
| 500 | -<h4>client.leaveClass()</h4> | ||
| 501 | - | ||
| 502 | -<p>离开会议</p> | ||
| 503 | - | ||
| 504 | -<h3>获取当前的状态</h3> | ||
| 505 | - | ||
| 506 | -<h4>client.currentStatus()</h4> | ||
| 507 | - | ||
| 508 | -<p>获取当前的状态</p> | ||
| 509 | - | ||
| 510 | -<p>示例代码</p> | ||
| 511 | - | ||
| 512 | -<pre><code>var callbackData=client.currentStatus(); | ||
| 513 | -//返回一个对象 | ||
| 514 | -//{code:0,message:"XXXXXX"} | ||
| 515 | -</code></pre> | ||
| 516 | - | ||
| 517 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 518 | - <colgroup> | ||
| 519 | - <col width="10%"> | ||
| 520 | - <col width="10%"> | ||
| 521 | - <col width="80%"> | ||
| 522 | - </colgroup> | ||
| 523 | - <tbody valign="m"> | ||
| 524 | - <tr class="row-odd"> | ||
| 525 | - <td><p class="first last">参数名称</p></td> | ||
| 526 | - <td><p class="first last">类型</p></td> | ||
| 527 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 528 | - </tr> | ||
| 529 | - <tr class="row-even"> | ||
| 530 | - <td rowspan="11">callbackData</td> | ||
| 531 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 532 | - | ||
| 533 | - </tr> | ||
| 534 | - <tr class="row-odd"> | ||
| 535 | - <tr class="row-odd"> | ||
| 536 | - <td> | ||
| 537 | - <ul> | ||
| 538 | - <li>code:Number </p></li> | ||
| 539 | - 0 //SDK 未初始化</p> | ||
| 540 | - 1 //未加入会议</p> | ||
| 541 | - 2 //已经加入会议</p> | ||
| 542 | - 3 //已经离开会议</p> | ||
| 543 | - 4 //未知状态 | ||
| 544 | - </ul> | ||
| 545 | - </td> | ||
| 546 | - </tr> | ||
| 547 | - <td> | ||
| 548 | - <ul> | ||
| 549 | - <li>message:String </p> | ||
| 550 | - 状态的描述,对应code,默认为空</li> | ||
| 551 | - </ul> | ||
| 552 | - </td> | ||
| 553 | - </tr> | ||
| 554 | - </tbody> | ||
| 555 | -</table></div> | ||
| 556 | - | ||
| 557 | -<h3>发送消息</h3> | ||
| 558 | - | ||
| 559 | -<h4>client.sendChatMsg(paramInfo)</h4> | ||
| 560 | - | ||
| 561 | -<p>发送聊天消息</p> | ||
| 562 | - | ||
| 563 | -<p>示例代码</p> | ||
| 564 | - | ||
| 565 | -<pre><code>var paramInfo={ | ||
| 566 | - "message":"需要发送的内容", | ||
| 567 | - "to":0 | ||
| 568 | - | ||
| 569 | -}; | ||
| 570 | -client.sendChatMsg(paramInfo); | ||
| 571 | -</code></pre> | ||
| 572 | - | ||
| 573 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 574 | - <colgroup> | ||
| 575 | - <col width="10%"> | ||
| 576 | - <col width="10%"> | ||
| 577 | - <col width="80%"> | ||
| 578 | - </colgroup> | ||
| 579 | - <tbody valign="M"> | ||
| 580 | - <tr class="row-odd"> | ||
| 581 | - <td><p class="first last">参数名称</p></td> | ||
| 582 | - <td><p class="first last">类型</p></td> | ||
| 583 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 584 | - </tr> | ||
| 585 | - <tr class="row-even"> | ||
| 586 | - <td rowspan="11">paramInfo</td> | ||
| 587 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 588 | - | ||
| 589 | - </tr> | ||
| 590 | - <tr class="row-odd"> | ||
| 591 | - <tr class="row-odd"> | ||
| 592 | - <td> | ||
| 593 | - <ul> | ||
| 594 | - <li>message:(必选)String </p>消息内容</li> | ||
| 595 | - </ul> | ||
| 596 | - </td> | ||
| 597 | - </tr> | ||
| 598 | - <td> | ||
| 599 | - <ul> | ||
| 600 | - <li>to:(可选) Number </p> | ||
| 601 | - 接收消息的人的ID,默认值是0(所有人都)</li> | ||
| 602 | - </ul> | ||
| 603 | - </td> | ||
| 604 | - </tr> | ||
| 605 | - </tbody> | ||
| 606 | -</table></div> | ||
| 607 | - | ||
| 608 | -<hr /> | ||
| 609 | - | ||
| 610 | -<h2><font color=blue>McuClient 回调事件 </font></h2> | ||
| 611 | - | ||
| 612 | -<h3>会议日志信息 事件回调</h3> | ||
| 613 | - | ||
| 614 | -<p>示例代码</p> | ||
| 615 | - | ||
| 616 | -<pre><code>client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){ | ||
| 617 | -{ | ||
| 618 | -"repeatmonthweekweek": 0, | ||
| 619 | -"endmode": 0, | ||
| 620 | -"repeatweek": "", | ||
| 621 | -"endcount": 1, | ||
| 622 | -"errorCode": 0, | ||
| 623 | -"cycle": 0, | ||
| 624 | -"repeatmonthday": 0, | ||
| 625 | -"frequency": 1, | ||
| 626 | -"repeatday": 0, | ||
| 627 | -"meetingName": "mcuClient", | ||
| 628 | -"repeatmode": 0, | ||
| 629 | -"finalenddate": "", | ||
| 630 | -"meetingContent": "", | ||
| 631 | -"beginTime": "2017-01-16 13:00:00", | ||
| 632 | -"endTime": "2017-01-31 15:00:00", | ||
| 633 | -"monthType": 0, | ||
| 634 | -"category": "", | ||
| 635 | -"repeatmonthweekday": 0, | ||
| 636 | -"status": 1 | ||
| 637 | -</code></pre> | ||
| 638 | - | ||
| 639 | -<p>} | ||
| 640 | - });</p> | ||
| 641 | - | ||
| 642 | -<h3>会议有人加入 事件回调</h3> | ||
| 643 | - | ||
| 644 | -<p>示例代码</p> | ||
| 645 | - | ||
| 646 | -<pre><code> client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){ | ||
| 647 | - //返回值 | ||
| 648 | - //{"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}}; | ||
| 649 | -}); | ||
| 650 | -</code></pre> | ||
| 651 | - | ||
| 652 | -<h3>会议有人离开 事件回调</h3> | ||
| 653 | - | ||
| 654 | -<p>示例代码</p> | ||
| 655 | - | ||
| 656 | -<pre><code> client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){ | ||
| 657 | - //{"nodeId":1234} | ||
| 658 | -}); | ||
| 659 | -</code></pre> | ||
| 660 | - | ||
| 661 | -<h3>关闭会议 事件回调</h3> | ||
| 662 | - | ||
| 663 | -<p>示例代码</p> | ||
| 664 | - | ||
| 665 | -<pre><code>client.on(MessageTypes.CLASS_EXIT, function(callbackData){ | ||
| 666 | - //..... | ||
| 667 | -}); | ||
| 668 | -</code></pre> | ||
| 669 | - | ||
| 670 | -<h3>收到聊天消息 事件回调</h3> | ||
| 671 | - | ||
| 672 | -<p>示例代码</p> | ||
| 673 | - | ||
| 674 | -<pre><code>client.on(MessageTypes.CHAT_RECEIVE, function(callbackData){ | ||
| 675 | - //{"fromNodeID":1484207995,"toNodeID":0,"message":"消息内容","fromName":"发送消息人的名字","fromRole":0} | ||
| 676 | -}); | ||
| 677 | -</code></pre> | ||
| 678 | - | ||
| 679 | -<h3>视频显示 事件回调</h3> | ||
| 680 | - | ||
| 681 | -<p>示例代码</p> | ||
| 682 | - | ||
| 683 | -<pre><code>client.on(MessageTypes.VIDEO_RECEIVE, function(callbackData){ | ||
| 684 | - //..... | ||
| 685 | -}); | ||
| 686 | -</code></pre> | ||
| 687 | - | ||
| 688 | -<h3>文档 事件回调</h3> | ||
| 689 | - | ||
| 690 | -<p>示例代码</p> | ||
| 691 | - | ||
| 692 | -<pre><code>client.on(MessageTypes.DOC_SHOW, function(callbackData){ | ||
| 693 | - //..... | ||
| 694 | -}); | ||
| 695 | -</code></pre> | ||
| 696 | - | ||
| 697 | -<h3>文档笔记 事件回调</h3> | ||
| 698 | - | ||
| 699 | -<p>示例代码</p> | ||
| 700 | - | ||
| 701 | -<pre><code>client.on(MessageTypes.DOC_ANNOTATION,function(callbackData){ | ||
| 702 | - //..... | ||
| 703 | -}); | ||
| 704 | -</code></pre> | ||
| 705 | - | ||
| 706 | -<h3>删除文档 事件回调</h3> | ||
| 707 | - | ||
| 708 | -<p>示例代码</p> | ||
| 709 | - | ||
| 710 | -<pre><code> client.on(MessageTypes.DOC_DELETE,function(callbackData){ | ||
| 711 | - //..... | ||
| 712 | -}); | ||
| 713 | -</code></pre> | ||
| 714 | - | ||
| 715 | -<hr /> | ||
| 716 | - | ||
| 717 | -<h2><font color=blue>ErrorCode 错误码查询</font></h2> | ||
| 718 | - | ||
| 719 | -<pre><code>MessageTypes.ERR_NETWORK=10000;//网络错误 | ||
| 720 | -MessageTypes.ERR_UNKNOWN=10001;//未知错误 | ||
| 721 | - | ||
| 722 | - | ||
| 723 | -//会议初始化失败的几种情况 | ||
| 724 | -MessageTypes.ERR_CLASS_INIT_PAEAM=100;//初始化参数错误 | ||
| 725 | -MessageTypes.ERR_CLASS_INIT_NETWORK=101;//初始化网络错误 | ||
| 726 | -MessageTypes.ERR_CLASS_INIT_PROTOCOL=102;//初始化协议错误 | ||
| 727 | -MessageTypes.ERR_CLASS_INIT_FAILED=103;//初始化验证失败 | ||
| 728 | - | ||
| 729 | - | ||
| 730 | -//加入会议失败的几种情况 | ||
| 731 | -MessageTypes.ERR_CLASS_JOIN_NETWORK=200;//加入会议网络错误 | ||
| 732 | -MessageTypes.ERR_CLASS_JOIN_PROTOCOL=201;//加入会议化协议错误 | ||
| 733 | -MessageTypes.ERR_CLASS_JOIN_FAILED=202;//加入会议化异常错误 | ||
| 734 | -MessageTypes.ERR_CLASS_JOIN_PARAM=203;//加入会议参数错误 | ||
| 735 | -MessageTypes.ERR_CLASS_JOIN_FULL=204;//人数已满 | ||
| 736 | -MessageTypes.ERR_CLASS_MD5_WRONG=205;//MD5验证失败 | ||
| 737 | -MessageTypes.ERR_CLASS_PASSWORD_WRONG=206;//密码错误 | ||
| 738 | -MessageTypes.ERR_CLASS_JOIN_CONFILICT=207;//已经在其它地方登陆 | ||
| 739 | - | ||
| 740 | - | ||
| 741 | -MessageTypes.ERR_GET_CLASS_DETAIL=300;//获取classDetail失败 | ||
| 742 | -MessageTypes.ERR_GET_MEETING_PARAML=301;//获取MeetingParam失败 | ||
| 743 | -</code></pre> | ||
| 744 | - | ||
| 745 | -</body> | ||
| 746 | -</html> | ||
| 747 | -<!-- This document was created with MarkdownPad, the Markdown editor for Windows (http://markdownpad.com) --> |
docs/McuClient_v.1.0.1_API.md
已删除
100644 → 0
| 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 | - //{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 56 | - }; | ||
| 57 | - function mcuErrorEventHandler(callbackData){ | ||
| 58 | - //整个MCUClient中Error异常监听 | ||
| 59 | - //返回值callbackData的结构为{"code":errorCode,"reson":""} | ||
| 60 | - //errorCode的列表在文档最后面的 ErrorCode错误码查询 | ||
| 61 | - }; | ||
| 62 | - | ||
| 63 | - | ||
| 64 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 65 | - <colgroup> | ||
| 66 | - <col width="10%"> | ||
| 67 | - <col width="10%"> | ||
| 68 | - <col width="80%"> | ||
| 69 | - </colgroup> | ||
| 70 | - <tbody valign="mid"> | ||
| 71 | - <tr class="row-odd"> | ||
| 72 | - <td><p class="first last">参数名称</p></td> | ||
| 73 | - <td><p class="first last">类型</p></td> | ||
| 74 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 75 | - </tr> | ||
| 76 | - <tr class="row-even"> | ||
| 77 | - <td rowspan="5">paramInfo</td> | ||
| 78 | - <td rowspan="5"><p class="first last">对象</p></td> | ||
| 79 | - | ||
| 80 | - </tr> | ||
| 81 | - <tr class="row-odd"> | ||
| 82 | - <td> | ||
| 83 | - <ul> | ||
| 84 | - <li>meetingNumber:(必选)Number </p>课堂号</li> | ||
| 85 | - </ul> | ||
| 86 | - </td> | ||
| 87 | - </tr> | ||
| 88 | - <tr class="row-odd"> | ||
| 89 | - <td> | ||
| 90 | - <ul> | ||
| 91 | - <li>portal:(必选)String </p>IP地址</li> | ||
| 92 | - </ul> | ||
| 93 | - </td> | ||
| 94 | - </tr> | ||
| 95 | - <tr class="row-odd"> | ||
| 96 | - <td> | ||
| 97 | - <ul> | ||
| 98 | - <li>usertRole:(可选) String </p> | ||
| 99 | - 用户的身份,5种类型,默认是normal | ||
| 100 | - ;host(主持人/老师)、presenter(主讲人)、assistant(助教)、normal(普通角色/学生),record(暂时没用)</li> | ||
| 101 | - </ul> | ||
| 102 | - </td> | ||
| 103 | - </tr> | ||
| 104 | - <tr class="row-odd"> | ||
| 105 | - <td> | ||
| 106 | - <ul> | ||
| 107 | - <li>userId:(可选) String </p> | ||
| 108 | - 第三方用户id,默认是0 | ||
| 109 | - </ul> | ||
| 110 | - </td> | ||
| 111 | - </tr> | ||
| 112 | - <tr class="row-odd"> | ||
| 113 | - <td><p class="first last">onSuccess</p></td> | ||
| 114 | - <td><p class="first last">Function</p></td> | ||
| 115 | - <td><p class="first last"><li>(必选) Function </p>初始化成功回调函数,返回值:</p>{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 116 | - </td> | ||
| 117 | - </tr> | ||
| 118 | - <tr class="row-odd"> | ||
| 119 | - <td><p class="first last">mcuErrorEventHandler</p></td> | ||
| 120 | - <td><p class="first last">Function</p></td> | ||
| 121 | - <td><p class="first last"><li>(必选) Function </p>整个MCUClient中Error异常监听</p></td> | ||
| 122 | - </tr> | ||
| 123 | - </tbody> | ||
| 124 | -</table></div> | ||
| 125 | - | ||
| 126 | - | ||
| 127 | - | ||
| 128 | -### 加入会议 ### | ||
| 129 | -#### client.joinClass (paramInfo,onSuccess) #### | ||
| 130 | -client初始化成功之后,加入会议。 | ||
| 131 | - | ||
| 132 | -示例代码 | ||
| 133 | - | ||
| 134 | - var paramInfo={ | ||
| 135 | - "userName":"大名",//自己的名字,在列表中显示 | ||
| 136 | - "password":"123321",//课堂密码,如果设置了密码需要验证 | ||
| 137 | - }; | ||
| 138 | - | ||
| 139 | - //加入会议 | ||
| 140 | - client.joinClass(paramInfo,onSuccess); | ||
| 141 | - | ||
| 142 | - function onSuccess(callbackData){ | ||
| 143 | - //加入会议成功回调 | ||
| 144 | - //{"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} | ||
| 145 | - }; | ||
| 146 | - | ||
| 147 | - | ||
| 148 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 149 | - <colgroup> | ||
| 150 | - <col width="10%"> | ||
| 151 | - <col width="10%"> | ||
| 152 | - <col width="80%"> | ||
| 153 | - </colgroup> | ||
| 154 | - <tbody valign="m"> | ||
| 155 | - <tr class="row-odd"> | ||
| 156 | - <td><p class="first last">参数名称</p></td> | ||
| 157 | - <td><p class="first last">类型</p></td> | ||
| 158 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 159 | - </tr> | ||
| 160 | - <tr class="row-even"> | ||
| 161 | - <td rowspan="3">paramInfo</td> | ||
| 162 | - <td rowspan="3"><p class="first last">对象</p></td> | ||
| 163 | - | ||
| 164 | - </tr> | ||
| 165 | - <tr class="row-odd"> | ||
| 166 | - <td> | ||
| 167 | - <ul> | ||
| 168 | - <li>userName:(必选)String </p>进入课堂的名字</li> | ||
| 169 | - </ul> | ||
| 170 | - </td> | ||
| 171 | - </tr> | ||
| 172 | - | ||
| 173 | - <tr class="row-odd"> | ||
| 174 | - <td> | ||
| 175 | - <ul> | ||
| 176 | - <li>password:(可选)String </p>进入课堂的密码,如果课堂不设置密码就不需要,设置了密码的情况下,进入课堂需要输入密码,根据初始化回调的参数passwordRequired来判断</li> | ||
| 177 | - </ul> | ||
| 178 | - </td> | ||
| 179 | - </tr> | ||
| 180 | - <tr class="row-odd"> | ||
| 181 | - <td><p class="first last">onSuccess</p></td> | ||
| 182 | - <td><p class="first last">Function</p></td> | ||
| 183 | - <td><p class="first last"><li>(必选) Function </p>成功回调函数</p> | ||
| 184 | - </td> | ||
| 185 | - </tr> | ||
| 186 | - | ||
| 187 | - </tbody> | ||
| 188 | -</table></div> | ||
| 189 | - | ||
| 190 | -### 离开会议 ### | ||
| 191 | -#### client.leaveClass() #### | ||
| 192 | -离开会议 | ||
| 193 | - | ||
| 194 | -### 获取当前的状态 ### | ||
| 195 | -#### client.mcuClientStatus() #### | ||
| 196 | -获取当前的状态 | ||
| 197 | - | ||
| 198 | -示例代码 | ||
| 199 | - | ||
| 200 | - var callbackData=client.mcuClientStatus(); | ||
| 201 | - //返回一个对象 | ||
| 202 | - //{code:0,message:"XXXXXX"} | ||
| 203 | - | ||
| 204 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 205 | - <colgroup> | ||
| 206 | - <col width="10%"> | ||
| 207 | - <col width="10%"> | ||
| 208 | - <col width="80%"> | ||
| 209 | - </colgroup> | ||
| 210 | - <tbody valign="m"> | ||
| 211 | - <tr class="row-odd"> | ||
| 212 | - <td><p class="first last">参数名称</p></td> | ||
| 213 | - <td><p class="first last">类型</p></td> | ||
| 214 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 215 | - </tr> | ||
| 216 | - <tr class="row-even"> | ||
| 217 | - <td rowspan="11">callbackData</td> | ||
| 218 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 219 | - | ||
| 220 | - </tr> | ||
| 221 | - <tr class="row-odd"> | ||
| 222 | - <tr class="row-odd"> | ||
| 223 | - <td> | ||
| 224 | - <ul> | ||
| 225 | - <li>code:Number </p></li> | ||
| 226 | - 0 //SDK 未初始化</p> | ||
| 227 | - 1 //未加入会议</p> | ||
| 228 | - 2 //已经加入会议</p> | ||
| 229 | - 3 //已经离开会议</p> | ||
| 230 | - 4 //未知状态 | ||
| 231 | - </ul> | ||
| 232 | - </td> | ||
| 233 | - </tr> | ||
| 234 | - <td> | ||
| 235 | - <ul> | ||
| 236 | - <li>message:String </p> | ||
| 237 | - 状态的描述,对应code,默认为空</li> | ||
| 238 | - </ul> | ||
| 239 | - </td> | ||
| 240 | - </tr> | ||
| 241 | - </tbody> | ||
| 242 | -</table></div> | ||
| 243 | - | ||
| 244 | -### 发送消息 ### | ||
| 245 | -#### client.sendChatMsg(paramInfo) #### | ||
| 246 | -发送聊天消息 | ||
| 247 | - | ||
| 248 | -示例代码 | ||
| 249 | - | ||
| 250 | - var paramInfo={ | ||
| 251 | - "message":"需要发送的内容", | ||
| 252 | - "to":0 | ||
| 253 | - | ||
| 254 | - }; | ||
| 255 | - client.sendChatMsg(paramInfo); | ||
| 256 | - | ||
| 257 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 258 | - <colgroup> | ||
| 259 | - <col width="10%"> | ||
| 260 | - <col width="10%"> | ||
| 261 | - <col width="80%"> | ||
| 262 | - </colgroup> | ||
| 263 | - <tbody valign="M"> | ||
| 264 | - <tr class="row-odd"> | ||
| 265 | - <td><p class="first last">参数名称</p></td> | ||
| 266 | - <td><p class="first last">类型</p></td> | ||
| 267 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 268 | - </tr> | ||
| 269 | - <tr class="row-even"> | ||
| 270 | - <td rowspan="11">paramInfo</td> | ||
| 271 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 272 | - | ||
| 273 | - </tr> | ||
| 274 | - <tr class="row-odd"> | ||
| 275 | - <tr class="row-odd"> | ||
| 276 | - <td> | ||
| 277 | - <ul> | ||
| 278 | - <li>message:(必选)String </p>消息内容</li> | ||
| 279 | - </ul> | ||
| 280 | - </td> | ||
| 281 | - </tr> | ||
| 282 | - <td> | ||
| 283 | - <ul> | ||
| 284 | - <li>to:(可选) Number </p> | ||
| 285 | - 接收消息的人的ID,默认值是0(所有人都)</li> | ||
| 286 | - </ul> | ||
| 287 | - </td> | ||
| 288 | - </tr> | ||
| 289 | - </tbody> | ||
| 290 | -</table></div> | ||
| 291 | - | ||
| 292 | ----------- | ||
| 293 | - | ||
| 294 | -## <font color=blue>McuClient 回调事件 </font>## | ||
| 295 | - | ||
| 296 | - | ||
| 297 | -### 会议日志信息 事件回调 ### | ||
| 298 | -示例代码 | ||
| 299 | - | ||
| 300 | - client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){ | ||
| 301 | - | ||
| 302 | - //返回值 | ||
| 303 | - /*{ | ||
| 304 | - "repeatmonthweekweek": 0, | ||
| 305 | - "endmode": 0, | ||
| 306 | - "repeatweek": "", | ||
| 307 | - "endcount": 1, | ||
| 308 | - "errorCode": 0, | ||
| 309 | - "cycle": 0, | ||
| 310 | - "repeatmonthday": 0, | ||
| 311 | - "frequency": 1, | ||
| 312 | - "repeatday": 0, | ||
| 313 | - "meetingName": "mcuClient", | ||
| 314 | - "repeatmode": 0, | ||
| 315 | - "finalenddate": "", | ||
| 316 | - "meetingContent": "", | ||
| 317 | - "beginTime": "2017-01-16 13:00:00", | ||
| 318 | - "endTime": "2017-01-31 15:00:00", | ||
| 319 | - "monthType": 0, | ||
| 320 | - "category": "", | ||
| 321 | - "repeatmonthweekday": 0, | ||
| 322 | - "status": 1 | ||
| 323 | - }*/ | ||
| 324 | - }); | ||
| 325 | - | ||
| 326 | -### 会议有人加入 事件回调 ### | ||
| 327 | -示例代码 | ||
| 328 | - | ||
| 329 | - client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){ | ||
| 330 | - //返回值 | ||
| 331 | - //{"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}}; | ||
| 332 | - }); | ||
| 333 | - | ||
| 334 | -### 会议有人离开 事件回调 ### | ||
| 335 | -示例代码 | ||
| 336 | - | ||
| 337 | - client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){ | ||
| 338 | - //{"nodeId":1234} | ||
| 339 | - }); | ||
| 340 | -### 关闭会议 事件回调 ### | ||
| 341 | -示例代码 | ||
| 342 | - | ||
| 343 | - client.on(MessageTypes.CLASS_EXIT, function(callbackData){ | ||
| 344 | - //..... | ||
| 345 | - }); | ||
| 346 | - | ||
| 347 | -### 收到聊天消息 事件回调 ### | ||
| 348 | -示例代码 | ||
| 349 | - | ||
| 350 | - client.on(MessageTypes.CHAT_RECEIVE, function(callbackData){ | ||
| 351 | - //{"fromNodeID":1484207995,"toNodeID":0,"message":"消息内容","fromName":"发送消息人的名字","fromRole":0} | ||
| 352 | - }); | ||
| 353 | - | ||
| 354 | -### 视频显示 事件回调 ### | ||
| 355 | -示例代码 | ||
| 356 | - | ||
| 357 | - client.on(MessageTypes.VIDEO_RECEIVE, function(callbackData){ | ||
| 358 | - //..... | ||
| 359 | - }); | ||
| 360 | - | ||
| 361 | -### 文档 事件回调 ### | ||
| 362 | -示例代码 | ||
| 363 | - | ||
| 364 | - client.on(MessageTypes.DOC_SHOW, function(callbackData){ | ||
| 365 | - //..... | ||
| 366 | - }); | ||
| 367 | - | ||
| 368 | -### 文档笔记 事件回调 ### | ||
| 369 | -示例代码 | ||
| 370 | - | ||
| 371 | - client.on(MessageTypes.DOC_ANNOTATION,function(callbackData){ | ||
| 372 | - //..... | ||
| 373 | - }); | ||
| 374 | - | ||
| 375 | -### 删除文档 事件回调 ### | ||
| 376 | -示例代码 | ||
| 377 | - | ||
| 378 | - client.on(MessageTypes.DOC_DELETE,function(callbackData){ | ||
| 379 | - //..... | ||
| 380 | - }); | ||
| 381 | - | ||
| 382 | ----------- | ||
| 383 | - | ||
| 384 | -## <font color=blue>ErrorCode 错误码查询</font> ## | ||
| 385 | - | ||
| 386 | -<div class="wy-table-responsive"> | ||
| 387 | - <table border="1" class="docutils"> | ||
| 388 | - <colgroup> | ||
| 389 | - <col width="14%"> | ||
| 390 | - <col width="10%"> | ||
| 391 | - <col width="76%"> | ||
| 392 | - </colgroup> | ||
| 393 | - <tbody valign="M"> | ||
| 394 | - <tr class="row-odd"> | ||
| 395 | - <td><p class="first last">错误代码</p></td> | ||
| 396 | - <td><p class="first last">值(code)</p></td> | ||
| 397 | - <td><p class="first last">描述(reson)</p></td> | ||
| 398 | - </tr> | ||
| 399 | - | ||
| 400 | - <tr class="row-even"> | ||
| 401 | - <td>ERR_CLASS_INIT_PAEAM</td> | ||
| 402 | - <td>100</td> | ||
| 403 | - <td><p class="first last">初始化参数错误</p></td> | ||
| 404 | - </tr> | ||
| 405 | - <tr class="row-even"> | ||
| 406 | - <td>ERR_CLASS_INIT_NETWORK</td> | ||
| 407 | - <td>101</td> | ||
| 408 | - <td><p class="first last">初始化网络错误</p></td> | ||
| 409 | - </tr> | ||
| 410 | - <tr class="row-even"> | ||
| 411 | - <td>ERR_CLASS_INIT_PROTOCOL</td> | ||
| 412 | - <td>102</td> | ||
| 413 | - <td><p class="first last">初始化协议错误</p></td> | ||
| 414 | - </tr> | ||
| 415 | - <tr class="row-even"> | ||
| 416 | - <td>ERR_CLASS_INIT_FAILED</td> | ||
| 417 | - <td>103</td> | ||
| 418 | - <td><p class="first last">初始化验证失败</p></td> | ||
| 419 | - </tr> | ||
| 420 | - | ||
| 421 | - | ||
| 422 | - | ||
| 423 | - <tr class="row-even"> | ||
| 424 | - <td>ERR_CLASS_JOIN_NETWORK</td> | ||
| 425 | - <td>200</td> | ||
| 426 | - <td><p class="first last">加入会议网络错误</p></td> | ||
| 427 | - </tr> | ||
| 428 | - <tr class="row-even"> | ||
| 429 | - <td>ERR_CLASS_JOIN_PROTOCOL</td> | ||
| 430 | - <td>201</td> | ||
| 431 | - <td><p class="first last">加入会议化协议错误</p></td> | ||
| 432 | - </tr> | ||
| 433 | - <tr class="row-even"> | ||
| 434 | - <td>ERR_CLASS_JOIN_FAILED</td> | ||
| 435 | - <td>202</td> | ||
| 436 | - <td><p class="first last">加入会议化异常错误</p></td> | ||
| 437 | - </tr> | ||
| 438 | - <tr class="row-even"> | ||
| 439 | - <td>ERR_CLASS_JOIN_PARAM</td> | ||
| 440 | - <td>203</td> | ||
| 441 | - <td><p class="first last">加入会议参数错误</p></td> | ||
| 442 | - </tr> | ||
| 443 | - <tr class="row-even"> | ||
| 444 | - <td>ERR_CLASS_JOIN_FULL</td> | ||
| 445 | - <td>204</td> | ||
| 446 | - <td><p class="first last">人数已满</p></td> | ||
| 447 | - </tr> | ||
| 448 | - <tr class="row-even"> | ||
| 449 | - <td>ERR_CLASS_MD5_WRONG</td> | ||
| 450 | - <td>205</td> | ||
| 451 | - <td><p class="first last">MD5验证失败</p></td> | ||
| 452 | - </tr> | ||
| 453 | - <tr class="row-even"> | ||
| 454 | - <td>ERR_CLASS_PASSWORD_WRONG</td> | ||
| 455 | - <td>206</td> | ||
| 456 | - <td><p class="first last">密码错误</p></td> | ||
| 457 | - </tr> | ||
| 458 | - <tr class="row-even"> | ||
| 459 | - <td>ERR_CLASS_JOIN_CONFILICT</td> | ||
| 460 | - <td>207</td> | ||
| 461 | - <td><p class="first last">已经在其它地方登陆</p></td> | ||
| 462 | - </tr> | ||
| 463 | - | ||
| 464 | - | ||
| 465 | - | ||
| 466 | - | ||
| 467 | - <tr class="row-even"> | ||
| 468 | - <td>ERR_GET_CLASS_DETAIL</td> | ||
| 469 | - <td>300</td> | ||
| 470 | - <td><p class="first last">获取classDetail失败</p></td> | ||
| 471 | - </tr> | ||
| 472 | - <tr class="row-even"> | ||
| 473 | - <td>ERR_GET_MEETING_PARAML</td> | ||
| 474 | - <td>301</td> | ||
| 475 | - <td><p class="first last">获取MeetingParam失败</p></td> | ||
| 476 | - </tr> | ||
| 477 | - | ||
| 478 | - | ||
| 479 | - <tr class="row-even"> | ||
| 480 | - <td>ERR_NETWORK</td> | ||
| 481 | - <td>10000</td> | ||
| 482 | - <td><p class="first last">网络错误</p></td> | ||
| 483 | - </tr> | ||
| 484 | - <tr class="row-even"> | ||
| 485 | - <td>ERR_UNKNOWN</td> | ||
| 486 | - <td>10001</td> | ||
| 487 | - <td><p class="first last">未知错误</p></td> | ||
| 488 | - </tr> | ||
| 489 | - | ||
| 490 | - </tbody> | ||
| 491 | - </table> | ||
| 492 | -</div> |
docs/McuClient_v.1.0.1_API.pdf
已删除
100644 → 0
不能预览此文件类型
docs/McuClient_v.1.0.2_API.html
已删除
100644 → 0
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html> | ||
| 3 | -<head> | ||
| 4 | -<title>McuClient_v.1.0.2_API</title> | ||
| 5 | -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 6 | -<style type="text/css"> | ||
| 7 | -/* GitHub stylesheet for MarkdownPad (http://markdownpad.com) */ | ||
| 8 | -/* Author: Nicolas Hery - http://nicolashery.com */ | ||
| 9 | -/* Version: b13fe65ca28d2e568c6ed5d7f06581183df8f2ff */ | ||
| 10 | -/* Source: https://github.com/nicolahery/markdownpad-github */ | ||
| 11 | - | ||
| 12 | -/* RESET | ||
| 13 | -=============================================================================*/ | ||
| 14 | - | ||
| 15 | -html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { | ||
| 16 | - margin: 0; | ||
| 17 | - padding: 0; | ||
| 18 | - border: 0; | ||
| 19 | -} | ||
| 20 | - | ||
| 21 | -/* BODY | ||
| 22 | -=============================================================================*/ | ||
| 23 | - | ||
| 24 | -body { | ||
| 25 | - font-family: Helvetica, arial, freesans, clean, sans-serif; | ||
| 26 | - font-size: 14px; | ||
| 27 | - line-height: 1.6; | ||
| 28 | - color: #333; | ||
| 29 | - background-color: #fff; | ||
| 30 | - padding: 20px; | ||
| 31 | - max-width: 960px; | ||
| 32 | - margin: 0 auto; | ||
| 33 | -} | ||
| 34 | - | ||
| 35 | -body>*:first-child { | ||
| 36 | - margin-top: 0 !important; | ||
| 37 | -} | ||
| 38 | - | ||
| 39 | -body>*:last-child { | ||
| 40 | - margin-bottom: 0 !important; | ||
| 41 | -} | ||
| 42 | - | ||
| 43 | -/* BLOCKS | ||
| 44 | -=============================================================================*/ | ||
| 45 | - | ||
| 46 | -p, blockquote, ul, ol, dl, table, pre { | ||
| 47 | - margin: 15px 0; | ||
| 48 | -} | ||
| 49 | - | ||
| 50 | -/* HEADERS | ||
| 51 | -=============================================================================*/ | ||
| 52 | - | ||
| 53 | -h1, h2, h3, h4, h5, h6 { | ||
| 54 | - margin: 20px 0 10px; | ||
| 55 | - padding: 0; | ||
| 56 | - font-weight: bold; | ||
| 57 | - -webkit-font-smoothing: antialiased; | ||
| 58 | -} | ||
| 59 | - | ||
| 60 | -h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code { | ||
| 61 | - font-size: inherit; | ||
| 62 | -} | ||
| 63 | - | ||
| 64 | -h1 { | ||
| 65 | - font-size: 28px; | ||
| 66 | - color: #000; | ||
| 67 | -} | ||
| 68 | - | ||
| 69 | -h2 { | ||
| 70 | - font-size: 24px; | ||
| 71 | - border-bottom: 1px solid #ccc; | ||
| 72 | - color: #000; | ||
| 73 | -} | ||
| 74 | - | ||
| 75 | -h3 { | ||
| 76 | - font-size: 18px; | ||
| 77 | -} | ||
| 78 | - | ||
| 79 | -h4 { | ||
| 80 | - font-size: 16px; | ||
| 81 | -} | ||
| 82 | - | ||
| 83 | -h5 { | ||
| 84 | - font-size: 14px; | ||
| 85 | -} | ||
| 86 | - | ||
| 87 | -h6 { | ||
| 88 | - color: #777; | ||
| 89 | - font-size: 14px; | ||
| 90 | -} | ||
| 91 | - | ||
| 92 | -body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child { | ||
| 93 | - margin-top: 0; | ||
| 94 | - padding-top: 0; | ||
| 95 | -} | ||
| 96 | - | ||
| 97 | -a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { | ||
| 98 | - margin-top: 0; | ||
| 99 | - padding-top: 0; | ||
| 100 | -} | ||
| 101 | - | ||
| 102 | -h1+p, h2+p, h3+p, h4+p, h5+p, h6+p { | ||
| 103 | - margin-top: 10px; | ||
| 104 | -} | ||
| 105 | - | ||
| 106 | -/* LINKS | ||
| 107 | -=============================================================================*/ | ||
| 108 | - | ||
| 109 | -a { | ||
| 110 | - color: #4183C4; | ||
| 111 | - text-decoration: none; | ||
| 112 | -} | ||
| 113 | - | ||
| 114 | -a:hover { | ||
| 115 | - text-decoration: underline; | ||
| 116 | -} | ||
| 117 | - | ||
| 118 | -/* LISTS | ||
| 119 | -=============================================================================*/ | ||
| 120 | - | ||
| 121 | -ul, ol { | ||
| 122 | - padding-left: 30px; | ||
| 123 | -} | ||
| 124 | - | ||
| 125 | -ul li > :first-child, | ||
| 126 | -ol li > :first-child, | ||
| 127 | -ul li ul:first-of-type, | ||
| 128 | -ol li ol:first-of-type, | ||
| 129 | -ul li ol:first-of-type, | ||
| 130 | -ol li ul:first-of-type { | ||
| 131 | - margin-top: 0px; | ||
| 132 | -} | ||
| 133 | - | ||
| 134 | -ul ul, ul ol, ol ol, ol ul { | ||
| 135 | - margin-bottom: 0; | ||
| 136 | -} | ||
| 137 | - | ||
| 138 | -dl { | ||
| 139 | - padding: 0; | ||
| 140 | -} | ||
| 141 | - | ||
| 142 | -dl dt { | ||
| 143 | - font-size: 14px; | ||
| 144 | - font-weight: bold; | ||
| 145 | - font-style: italic; | ||
| 146 | - padding: 0; | ||
| 147 | - margin: 15px 0 5px; | ||
| 148 | -} | ||
| 149 | - | ||
| 150 | -dl dt:first-child { | ||
| 151 | - padding: 0; | ||
| 152 | -} | ||
| 153 | - | ||
| 154 | -dl dt>:first-child { | ||
| 155 | - margin-top: 0px; | ||
| 156 | -} | ||
| 157 | - | ||
| 158 | -dl dt>:last-child { | ||
| 159 | - margin-bottom: 0px; | ||
| 160 | -} | ||
| 161 | - | ||
| 162 | -dl dd { | ||
| 163 | - margin: 0 0 15px; | ||
| 164 | - padding: 0 15px; | ||
| 165 | -} | ||
| 166 | - | ||
| 167 | -dl dd>:first-child { | ||
| 168 | - margin-top: 0px; | ||
| 169 | -} | ||
| 170 | - | ||
| 171 | -dl dd>:last-child { | ||
| 172 | - margin-bottom: 0px; | ||
| 173 | -} | ||
| 174 | - | ||
| 175 | -/* CODE | ||
| 176 | -=============================================================================*/ | ||
| 177 | - | ||
| 178 | -pre, code, tt { | ||
| 179 | - font-size: 12px; | ||
| 180 | - font-family: Consolas, "Liberation Mono", Courier, monospace; | ||
| 181 | -} | ||
| 182 | - | ||
| 183 | -code, tt { | ||
| 184 | - margin: 0 0px; | ||
| 185 | - padding: 0px 0px; | ||
| 186 | - white-space: nowrap; | ||
| 187 | - border: 1px solid #eaeaea; | ||
| 188 | - background-color: #f8f8f8; | ||
| 189 | - border-radius: 3px; | ||
| 190 | -} | ||
| 191 | - | ||
| 192 | -pre>code { | ||
| 193 | - margin: 0; | ||
| 194 | - padding: 0; | ||
| 195 | - white-space: pre; | ||
| 196 | - border: none; | ||
| 197 | - background: transparent; | ||
| 198 | -} | ||
| 199 | - | ||
| 200 | -pre { | ||
| 201 | - background-color: #f8f8f8; | ||
| 202 | - border: 1px solid #ccc; | ||
| 203 | - font-size: 13px; | ||
| 204 | - line-height: 19px; | ||
| 205 | - overflow: auto; | ||
| 206 | - padding: 6px 10px; | ||
| 207 | - border-radius: 3px; | ||
| 208 | -} | ||
| 209 | - | ||
| 210 | -pre code, pre tt { | ||
| 211 | - background-color: transparent; | ||
| 212 | - border: none; | ||
| 213 | -} | ||
| 214 | - | ||
| 215 | -kbd { | ||
| 216 | - -moz-border-bottom-colors: none; | ||
| 217 | - -moz-border-left-colors: none; | ||
| 218 | - -moz-border-right-colors: none; | ||
| 219 | - -moz-border-top-colors: none; | ||
| 220 | - background-color: #DDDDDD; | ||
| 221 | - background-image: linear-gradient(#F1F1F1, #DDDDDD); | ||
| 222 | - background-repeat: repeat-x; | ||
| 223 | - border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD; | ||
| 224 | - border-image: none; | ||
| 225 | - border-radius: 2px 2px 2px 2px; | ||
| 226 | - border-style: solid; | ||
| 227 | - border-width: 1px; | ||
| 228 | - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; | ||
| 229 | - line-height: 10px; | ||
| 230 | - padding: 1px 4px; | ||
| 231 | -} | ||
| 232 | - | ||
| 233 | -/* QUOTES | ||
| 234 | -=============================================================================*/ | ||
| 235 | - | ||
| 236 | -blockquote { | ||
| 237 | - border-left: 4px solid #DDD; | ||
| 238 | - padding: 0 15px; | ||
| 239 | - color: #777; | ||
| 240 | -} | ||
| 241 | - | ||
| 242 | -blockquote>:first-child { | ||
| 243 | - margin-top: 0px; | ||
| 244 | -} | ||
| 245 | - | ||
| 246 | -blockquote>:last-child { | ||
| 247 | - margin-bottom: 0px; | ||
| 248 | -} | ||
| 249 | - | ||
| 250 | -/* HORIZONTAL RULES | ||
| 251 | -=============================================================================*/ | ||
| 252 | - | ||
| 253 | -hr { | ||
| 254 | - clear: both; | ||
| 255 | - margin: 15px 0; | ||
| 256 | - height: 0px; | ||
| 257 | - overflow: hidden; | ||
| 258 | - border: none; | ||
| 259 | - background: transparent; | ||
| 260 | - border-bottom: 4px solid #ddd; | ||
| 261 | - padding: 0; | ||
| 262 | -} | ||
| 263 | - | ||
| 264 | -/* TABLES | ||
| 265 | -=============================================================================*/ | ||
| 266 | - | ||
| 267 | -table th { | ||
| 268 | - font-weight: bold; | ||
| 269 | -} | ||
| 270 | - | ||
| 271 | -table th, table td { | ||
| 272 | - border: 1px solid #ccc; | ||
| 273 | - padding: 6px 13px; | ||
| 274 | -} | ||
| 275 | - | ||
| 276 | -table tr { | ||
| 277 | - border-top: 1px solid #ccc; | ||
| 278 | - background-color: #fff; | ||
| 279 | -} | ||
| 280 | - | ||
| 281 | -table tr:nth-child(2n) { | ||
| 282 | - background-color: #f8f8f8; | ||
| 283 | -} | ||
| 284 | - | ||
| 285 | -/* IMAGES | ||
| 286 | -=============================================================================*/ | ||
| 287 | - | ||
| 288 | -img { | ||
| 289 | - max-width: 100% | ||
| 290 | -} | ||
| 291 | -</style> | ||
| 292 | -</head> | ||
| 293 | -<body> | ||
| 294 | -<h1>McuClient API参考说明</h1> | ||
| 295 | - | ||
| 296 | -<p></p></p> | ||
| 297 | - | ||
| 298 | -<hr /> | ||
| 299 | - | ||
| 300 | -<h2><font color=blue>McuClient 目录</font></h2> | ||
| 301 | - | ||
| 302 | -<blockquote> | ||
| 303 | - <ul> | ||
| 304 | - <li><p><strong>创建McuClient对象</strong></p></li> | ||
| 305 | - <li><p><strong>McuClient接口</strong></p></li> | ||
| 306 | - <li><p><strong>McuClient回调事件</strong></p></li> | ||
| 307 | - <li><p><strong>ErrorCode 错误码查询</strong></p></li> | ||
| 308 | - </ul> | ||
| 309 | -</blockquote> | ||
| 310 | - | ||
| 311 | -<hr /> | ||
| 312 | - | ||
| 313 | -<h2><font color=blue>使用步骤说明</font></h2> | ||
| 314 | - | ||
| 315 | -<blockquote> | ||
| 316 | - <ol> | ||
| 317 | - <li>创建McuClient对象</li> | ||
| 318 | - <li>McuClient初始化init</li> | ||
| 319 | - <li>添加MessageTypes中的事件监听(接收各个模块的消息)</li> | ||
| 320 | - <li>McuClient加入会议</li> | ||
| 321 | - <li>加入会议成功之后可以调用其他接口和监听事件</li> | ||
| 322 | - </ol> | ||
| 323 | -</blockquote> | ||
| 324 | - | ||
| 325 | -<hr /> | ||
| 326 | - | ||
| 327 | -<h2><font color=blue>创建McuClient对象</font></h2> | ||
| 328 | - | ||
| 329 | -<p>只创建一次</p> | ||
| 330 | - | ||
| 331 | -<p>示例代码</p> | ||
| 332 | - | ||
| 333 | -<pre><code>window.onload=function(){ | ||
| 334 | - //创建client,这是必须的第一步 | ||
| 335 | - const client=MCUClientEngine.createMcuClient(); | ||
| 336 | - //获取事件监听消息定义 | ||
| 337 | - const MessageTypes=MCUClientEngine.MessageTypes; | ||
| 338 | -} | ||
| 339 | -</code></pre> | ||
| 340 | - | ||
| 341 | -<hr /> | ||
| 342 | - | ||
| 343 | -<h2><font color=blue>McuClient接口 </font></h2> | ||
| 344 | - | ||
| 345 | -<h3>初始化</h3> | ||
| 346 | - | ||
| 347 | -<h4>client.init (paramInfo,onSuccess,mcuErrorEventHandler)</h4> | ||
| 348 | - | ||
| 349 | -<p>client创建完成之后第一步需要初始化。</p> | ||
| 350 | - | ||
| 351 | -<p>示例代码</p> | ||
| 352 | - | ||
| 353 | -<pre><code>var paramInfo={ | ||
| 354 | - "meetingNumber":123456, | ||
| 355 | - "portal":"127.0.0.1:80", | ||
| 356 | - "usertRole":"normal", | ||
| 357 | - "userID":0, | ||
| 358 | -}; | ||
| 359 | -//初始化 | ||
| 360 | -client.init(paramInfo,onSuccess,mcuErrorEventHandler); | ||
| 361 | -function onSuccess(callbackData){ | ||
| 362 | - //初始化成功回调 | ||
| 363 | - /*{ | ||
| 364 | - "siteId": "h5test", | ||
| 365 | - "passwordRequired": true, | ||
| 366 | - "md5": "de399d5540b3da2fbc1eb0a770d4fd66", | ||
| 367 | - "code": 0, | ||
| 368 | - "msType": 1 | ||
| 369 | - }*/ | ||
| 370 | -}; | ||
| 371 | -function mcuErrorEventHandler(callbackData){ | ||
| 372 | - //整个MCUClient中Error异常监听 | ||
| 373 | - //返回值callbackData的结构为{"code":errorCode,"reson":""} | ||
| 374 | - //errorCode的列表在文档最后面的 ErrorCode错误码查询 | ||
| 375 | -}; | ||
| 376 | -</code></pre> | ||
| 377 | - | ||
| 378 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 379 | - <colgroup> | ||
| 380 | - <col width="10%"> | ||
| 381 | - <col width="10%"> | ||
| 382 | - <col width="80%"> | ||
| 383 | - </colgroup> | ||
| 384 | - <tbody valign="mid"> | ||
| 385 | - <tr class="row-odd"> | ||
| 386 | - <td><p class="first last">参数名称</p></td> | ||
| 387 | - <td><p class="first last">类型</p></td> | ||
| 388 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 389 | - </tr> | ||
| 390 | - <tr class="row-even"> | ||
| 391 | - <td rowspan="5">paramInfo</td> | ||
| 392 | - <td rowspan="5"><p class="first last">对象</p></td> | ||
| 393 | - | ||
| 394 | - </tr> | ||
| 395 | - <tr class="row-odd"> | ||
| 396 | - <td> | ||
| 397 | - <ul> | ||
| 398 | - <li>meetingNumber:(必选)Number </p>课堂号</li> | ||
| 399 | - </ul> | ||
| 400 | - </td> | ||
| 401 | - </tr> | ||
| 402 | - <tr class="row-odd"> | ||
| 403 | - <td> | ||
| 404 | - <ul> | ||
| 405 | - <li>portal:(必选)String </p>IP地址</li> | ||
| 406 | - </ul> | ||
| 407 | - </td> | ||
| 408 | - </tr> | ||
| 409 | - <tr class="row-odd"> | ||
| 410 | - <td> | ||
| 411 | - <ul> | ||
| 412 | - <li>usertRole:(可选) String </p> | ||
| 413 | - 用户的身份,5种类型,默认是normal | ||
| 414 | - ;host(主持人/老师)、presenter(主讲人)、assistant(助教)、normal(普通角色/学生),record(暂时没用)</li> | ||
| 415 | - </ul> | ||
| 416 | - </td> | ||
| 417 | - </tr> | ||
| 418 | - <tr class="row-odd"> | ||
| 419 | - <td> | ||
| 420 | - <ul> | ||
| 421 | - <li>userId:(可选) String </p> | ||
| 422 | - 第三方用户id,默认是0 | ||
| 423 | - </ul> | ||
| 424 | - </td> | ||
| 425 | - </tr> | ||
| 426 | - <tr class="row-odd"> | ||
| 427 | - <td><p class="first last">onSuccess</p></td> | ||
| 428 | - <td><p class="first last">Function</p></td> | ||
| 429 | - <td><p class="first last"><li>(必选) Function </p>初始化成功回调函数,返回值:</p>{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1} | ||
| 430 | - </td> | ||
| 431 | - </tr> | ||
| 432 | - <tr class="row-odd"> | ||
| 433 | - <td><p class="first last">mcuErrorEventHandler</p></td> | ||
| 434 | - <td><p class="first last">Function</p></td> | ||
| 435 | - <td><p class="first last"><li>(必选) Function </p>整个MCUClient中Error异常监听</p></td> | ||
| 436 | - </tr> | ||
| 437 | - </tbody> | ||
| 438 | -</table></div> | ||
| 439 | - | ||
| 440 | -<h3>加入会议</h3> | ||
| 441 | - | ||
| 442 | -<h4>client.joinClass (paramInfo,onSuccess)</h4> | ||
| 443 | - | ||
| 444 | -<p>client初始化成功之后,加入会议。</p> | ||
| 445 | - | ||
| 446 | -<p>示例代码</p> | ||
| 447 | - | ||
| 448 | -<pre><code>var paramInfo={ | ||
| 449 | - "userName":"大名",//自己的名字,在列表中显示 | ||
| 450 | - "password":"123321",//课堂密码,如果设置了密码需要验证 | ||
| 451 | -}; | ||
| 452 | - | ||
| 453 | -//加入会议 | ||
| 454 | -client.joinClass(paramInfo,onSuccess); | ||
| 455 | - | ||
| 456 | -function onSuccess(callbackData){ | ||
| 457 | - //加入会议成功回调 | ||
| 458 | - /*{ | ||
| 459 | - "siteId": "h5test", | ||
| 460 | - "confId": 1292388778, | ||
| 461 | - "h5Module": 0, | ||
| 462 | - "nodeId": 1484789938, | ||
| 463 | - "topNodeID": 101, | ||
| 464 | - "userRole": "normal", | ||
| 465 | - "role": 1, | ||
| 466 | - "isHost": false, | ||
| 467 | - "classRole": 0, | ||
| 468 | - "userId": "0", | ||
| 469 | - "userName": "cccccc", | ||
| 470 | - "password": "222222", | ||
| 471 | - "userType": 8, | ||
| 472 | - "passwordRequired": true, | ||
| 473 | - "md5": "b36da144521b70d89e72993cd1117b5b", | ||
| 474 | - "msType": 1, | ||
| 475 | - "portal": "112.126.80.182:80", | ||
| 476 | - "mcuDelay": 3000, | ||
| 477 | - "MCUServerIP": "123.56.73.119", | ||
| 478 | - "MCUServerPort": "7001", | ||
| 479 | - "maxVideoChannels": 1, | ||
| 480 | - "maxAudioChannels": 1, | ||
| 481 | - "maxMediaChannels": 2 | ||
| 482 | - }*/ | ||
| 483 | -}; | ||
| 484 | -</code></pre> | ||
| 485 | - | ||
| 486 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 487 | - <colgroup> | ||
| 488 | - <col width="10%"> | ||
| 489 | - <col width="10%"> | ||
| 490 | - <col width="80%"> | ||
| 491 | - </colgroup> | ||
| 492 | - <tbody valign="m"> | ||
| 493 | - <tr class="row-odd"> | ||
| 494 | - <td><p class="first last">参数名称</p></td> | ||
| 495 | - <td><p class="first last">类型</p></td> | ||
| 496 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 497 | - </tr> | ||
| 498 | - <tr class="row-even"> | ||
| 499 | - <td rowspan="3">paramInfo</td> | ||
| 500 | - <td rowspan="3"><p class="first last">对象</p></td> | ||
| 501 | - | ||
| 502 | - </tr> | ||
| 503 | - <tr class="row-odd"> | ||
| 504 | - <td> | ||
| 505 | - <ul> | ||
| 506 | - <li>userName:(必选)String </p>进入课堂的名字</li> | ||
| 507 | - </ul> | ||
| 508 | - </td> | ||
| 509 | - </tr> | ||
| 510 | - | ||
| 511 | - <tr class="row-odd"> | ||
| 512 | - <td> | ||
| 513 | - <ul> | ||
| 514 | - <li>password:(可选)String </p>进入课堂的密码,如果课堂不设置密码就不需要,设置了密码的情况下,进入课堂需要输入密码,根据初始化回调的参数passwordRequired来判断</li> | ||
| 515 | - </ul> | ||
| 516 | - </td> | ||
| 517 | - </tr> | ||
| 518 | - <tr class="row-odd"> | ||
| 519 | - <td><p class="first last">onSuccess</p></td> | ||
| 520 | - <td><p class="first last">Function</p></td> | ||
| 521 | - <td><p class="first last"><li>(必选) Function </p>成功回调函数</p> | ||
| 522 | - </td> | ||
| 523 | - </tr> | ||
| 524 | - | ||
| 525 | - </tbody> | ||
| 526 | -</table></div> | ||
| 527 | - | ||
| 528 | -<h3>离开会议</h3> | ||
| 529 | - | ||
| 530 | -<h4>client.leaveClass()</h4> | ||
| 531 | - | ||
| 532 | -<p>离开会议</p> | ||
| 533 | - | ||
| 534 | -<h3>获取当前的状态</h3> | ||
| 535 | - | ||
| 536 | -<h4>client.mcuClientStatus()</h4> | ||
| 537 | - | ||
| 538 | -<p>获取当前的状态</p> | ||
| 539 | - | ||
| 540 | -<p>示例代码</p> | ||
| 541 | - | ||
| 542 | -<pre><code>var callbackData=client.mcuClientStatus(); | ||
| 543 | -//返回一个对象 | ||
| 544 | -//{code:0,message:"XXXXXX"} | ||
| 545 | -</code></pre> | ||
| 546 | - | ||
| 547 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 548 | - <colgroup> | ||
| 549 | - <col width="10%"> | ||
| 550 | - <col width="10%"> | ||
| 551 | - <col width="80%"> | ||
| 552 | - </colgroup> | ||
| 553 | - <tbody valign="m"> | ||
| 554 | - <tr class="row-odd"> | ||
| 555 | - <td><p class="first last">参数名称</p></td> | ||
| 556 | - <td><p class="first last">类型</p></td> | ||
| 557 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 558 | - </tr> | ||
| 559 | - <tr class="row-even"> | ||
| 560 | - <td rowspan="11">callbackData</td> | ||
| 561 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 562 | - | ||
| 563 | - </tr> | ||
| 564 | - <tr class="row-odd"> | ||
| 565 | - <tr class="row-odd"> | ||
| 566 | - <td> | ||
| 567 | - <ul> | ||
| 568 | - <li>code:Number </p></li> | ||
| 569 | - 0 //SDK 未初始化</p> | ||
| 570 | - 1 //未加入会议</p> | ||
| 571 | - 2 //已经加入会议</p> | ||
| 572 | - 3 //已经离开会议</p> | ||
| 573 | - 4 //未知状态 | ||
| 574 | - </ul> | ||
| 575 | - </td> | ||
| 576 | - </tr> | ||
| 577 | - <td> | ||
| 578 | - <ul> | ||
| 579 | - <li>message:String </p> | ||
| 580 | - 状态的描述,对应code,默认为空</li> | ||
| 581 | - </ul> | ||
| 582 | - </td> | ||
| 583 | - </tr> | ||
| 584 | - </tbody> | ||
| 585 | -</table></div> | ||
| 586 | - | ||
| 587 | -<h3>发送消息</h3> | ||
| 588 | - | ||
| 589 | -<h4>client.sendChatMsg(paramInfo)</h4> | ||
| 590 | - | ||
| 591 | -<p>发送聊天消息</p> | ||
| 592 | - | ||
| 593 | -<p>示例代码</p> | ||
| 594 | - | ||
| 595 | -<pre><code>var paramInfo={ | ||
| 596 | - "message":"需要发送的内容", | ||
| 597 | - "to":0 | ||
| 598 | - | ||
| 599 | -}; | ||
| 600 | -client.sendChatMsg(paramInfo); | ||
| 601 | -</code></pre> | ||
| 602 | - | ||
| 603 | -<div class="wy-table-responsive"><table border="1" class="docutils"> | ||
| 604 | - <colgroup> | ||
| 605 | - <col width="10%"> | ||
| 606 | - <col width="10%"> | ||
| 607 | - <col width="80%"> | ||
| 608 | - </colgroup> | ||
| 609 | - <tbody valign="M"> | ||
| 610 | - <tr class="row-odd"> | ||
| 611 | - <td><p class="first last">参数名称</p></td> | ||
| 612 | - <td><p class="first last">类型</p></td> | ||
| 613 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 614 | - </tr> | ||
| 615 | - <tr class="row-even"> | ||
| 616 | - <td rowspan="11">paramInfo</td> | ||
| 617 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 618 | - | ||
| 619 | - </tr> | ||
| 620 | - <tr class="row-odd"> | ||
| 621 | - <tr class="row-odd"> | ||
| 622 | - <td> | ||
| 623 | - <ul> | ||
| 624 | - <li>message:(必选)String </p>消息内容</li> | ||
| 625 | - </ul> | ||
| 626 | - </td> | ||
| 627 | - </tr> | ||
| 628 | - <td> | ||
| 629 | - <ul> | ||
| 630 | - <li>to:(可选) Number </p> | ||
| 631 | - 接收消息的人的ID,默认值是0(所有人都)</li> | ||
| 632 | - </ul> | ||
| 633 | - </td> | ||
| 634 | - </tr> | ||
| 635 | - </tbody> | ||
| 636 | -</table></div> | ||
| 637 | - | ||
| 638 | -<hr /> | ||
| 639 | - | ||
| 640 | -<h2><font color=blue>McuClient 回调事件 </font></h2> | ||
| 641 | - | ||
| 642 | -<h3>会议日志信息 事件回调</h3> | ||
| 643 | - | ||
| 644 | -<p>示例代码</p> | ||
| 645 | - | ||
| 646 | -<pre><code>client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){ | ||
| 647 | - | ||
| 648 | - //返回值 | ||
| 649 | - /*{ | ||
| 650 | - "repeatmonthweekweek": 0, | ||
| 651 | - "endmode": 0, | ||
| 652 | - "repeatweek": "", | ||
| 653 | - "endcount": 1, | ||
| 654 | - "errorCode": 0, | ||
| 655 | - "cycle": 0, | ||
| 656 | - "repeatmonthday": 0, | ||
| 657 | - "frequency": 1, | ||
| 658 | - "repeatday": 0, | ||
| 659 | - "meetingName": "mcuClient", | ||
| 660 | - "repeatmode": 0, | ||
| 661 | - "finalenddate": "", | ||
| 662 | - "meetingContent": "", | ||
| 663 | - "beginTime": "2017-01-16 13:00:00", | ||
| 664 | - "endTime": "2017-01-31 15:00:00", | ||
| 665 | - "monthType": 0, | ||
| 666 | - "category": "", | ||
| 667 | - "repeatmonthweekday": 0, | ||
| 668 | - "status": 1 | ||
| 669 | - }*/ | ||
| 670 | -}); | ||
| 671 | -</code></pre> | ||
| 672 | - | ||
| 673 | -<h3>会议有人加入 事件回调</h3> | ||
| 674 | - | ||
| 675 | -<p>示例代码</p> | ||
| 676 | - | ||
| 677 | -<pre><code> client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){ | ||
| 678 | - //返回值 | ||
| 679 | - /*{ | ||
| 680 | - "nodeId": 1483947664, | ||
| 681 | - "nodeData": { | ||
| 682 | - "nodeId": 1483947664, | ||
| 683 | - "name": "cccccc", | ||
| 684 | - "role": 1, | ||
| 685 | - "level": 0, | ||
| 686 | - "audioRecords": [], | ||
| 687 | - "videoRecords": [], | ||
| 688 | - "status": null, | ||
| 689 | - "userData": { | ||
| 690 | - "qq": "", | ||
| 691 | - "skype": "", | ||
| 692 | - "mobile": "" | ||
| 693 | - }, | ||
| 694 | - "userId": "0", | ||
| 695 | - "handUpTime": null, | ||
| 696 | - "deviceType": 3, | ||
| 697 | - "mobileDirection": null | ||
| 698 | - } | ||
| 699 | - }*/ | ||
| 700 | -}); | ||
| 701 | -</code></pre> | ||
| 702 | - | ||
| 703 | -<h3>会议有人离开 事件回调</h3> | ||
| 704 | - | ||
| 705 | -<p>示例代码</p> | ||
| 706 | - | ||
| 707 | -<pre><code> client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){ | ||
| 708 | - //{"nodeId":1234} | ||
| 709 | -}); | ||
| 710 | -</code></pre> | ||
| 711 | - | ||
| 712 | -<h3>关闭会议 事件回调</h3> | ||
| 713 | - | ||
| 714 | -<p>示例代码</p> | ||
| 715 | - | ||
| 716 | -<pre><code>client.on(MessageTypes.CLASS_EXIT, function(callbackData){ | ||
| 717 | - //..... | ||
| 718 | -}); | ||
| 719 | -</code></pre> | ||
| 720 | - | ||
| 721 | -<h3>收到聊天消息 事件回调</h3> | ||
| 722 | - | ||
| 723 | -<p>示例代码</p> | ||
| 724 | - | ||
| 725 | -<pre><code>client.on(MessageTypes.CHAT_RECEIVE, function(callbackData){ | ||
| 726 | - //返回值 | ||
| 727 | - /*{ | ||
| 728 | - "fromNodeID": 1484207995, | ||
| 729 | - "toNodeID": 0, | ||
| 730 | - "message": "消息内容", | ||
| 731 | - "fromName": "发送消息人的名字", | ||
| 732 | - "fromRole": 0 | ||
| 733 | - }*/ | ||
| 734 | -}); | ||
| 735 | -</code></pre> | ||
| 736 | - | ||
| 737 | -<h3>视频显示 事件回调</h3> | ||
| 738 | - | ||
| 739 | -<p>示例代码</p> | ||
| 740 | - | ||
| 741 | -<pre><code>client.on(MessageTypes.VIDEO_RECEIVE, function(callbackData){ | ||
| 742 | - //..... | ||
| 743 | -}); | ||
| 744 | -</code></pre> | ||
| 745 | - | ||
| 746 | -<h3>文档 事件回调</h3> | ||
| 747 | - | ||
| 748 | -<p>示例代码</p> | ||
| 749 | - | ||
| 750 | -<pre><code>client.on(MessageTypes.DOC_SHOW, function(callbackData){ | ||
| 751 | - //..... | ||
| 752 | -}); | ||
| 753 | -</code></pre> | ||
| 754 | - | ||
| 755 | -<h3>文档笔记 事件回调</h3> | ||
| 756 | - | ||
| 757 | -<p>示例代码</p> | ||
| 758 | - | ||
| 759 | -<pre><code>client.on(MessageTypes.DOC_ANNOTATION,function(callbackData){ | ||
| 760 | - //..... | ||
| 761 | -}); | ||
| 762 | -</code></pre> | ||
| 763 | - | ||
| 764 | -<h3>删除文档 事件回调</h3> | ||
| 765 | - | ||
| 766 | -<p>示例代码</p> | ||
| 767 | - | ||
| 768 | -<pre><code> client.on(MessageTypes.DOC_DELETE,function(callbackData){ | ||
| 769 | - //..... | ||
| 770 | -}); | ||
| 771 | -</code></pre> | ||
| 772 | - | ||
| 773 | -<hr /> | ||
| 774 | - | ||
| 775 | -<h2><font color=blue>ErrorCode 错误码查询</font></h2> | ||
| 776 | - | ||
| 777 | -<div class="wy-table-responsive"> | ||
| 778 | - <table border="1" class="docutils"> | ||
| 779 | - <colgroup> | ||
| 780 | - <col width="14%"> | ||
| 781 | - <col width="10%"> | ||
| 782 | - <col width="76%"> | ||
| 783 | - </colgroup> | ||
| 784 | - <tbody valign="M"> | ||
| 785 | - <tr class="row-odd"> | ||
| 786 | - <td><p class="first last">错误代码</p></td> | ||
| 787 | - <td><p class="first last">值(code)</p></td> | ||
| 788 | - <td><p class="first last">描述(reson)</p></td> | ||
| 789 | - </tr> | ||
| 790 | - | ||
| 791 | - <tr class="row-even"> | ||
| 792 | - <td>ERR_CLASS_INIT_PAEAM</td> | ||
| 793 | - <td>100</td> | ||
| 794 | - <td><p class="first last">初始化参数错误</p></td> | ||
| 795 | - </tr> | ||
| 796 | - <tr class="row-even"> | ||
| 797 | - <td>ERR_CLASS_INIT_NETWORK</td> | ||
| 798 | - <td>101</td> | ||
| 799 | - <td><p class="first last">初始化网络错误</p></td> | ||
| 800 | - </tr> | ||
| 801 | - <tr class="row-even"> | ||
| 802 | - <td>ERR_CLASS_INIT_PROTOCOL</td> | ||
| 803 | - <td>102</td> | ||
| 804 | - <td><p class="first last">初始化协议错误</p></td> | ||
| 805 | - </tr> | ||
| 806 | - <tr class="row-even"> | ||
| 807 | - <td>ERR_CLASS_INIT_FAILED</td> | ||
| 808 | - <td>103</td> | ||
| 809 | - <td><p class="first last">初始化验证失败</p></td> | ||
| 810 | - </tr> | ||
| 811 | - | ||
| 812 | - | ||
| 813 | - | ||
| 814 | - <tr class="row-even"> | ||
| 815 | - <td>ERR_CLASS_JOIN_NETWORK</td> | ||
| 816 | - <td>200</td> | ||
| 817 | - <td><p class="first last">加入会议网络错误</p></td> | ||
| 818 | - </tr> | ||
| 819 | - <tr class="row-even"> | ||
| 820 | - <td>ERR_CLASS_JOIN_PROTOCOL</td> | ||
| 821 | - <td>201</td> | ||
| 822 | - <td><p class="first last">加入会议化协议错误</p></td> | ||
| 823 | - </tr> | ||
| 824 | - <tr class="row-even"> | ||
| 825 | - <td>ERR_CLASS_JOIN_FAILED</td> | ||
| 826 | - <td>202</td> | ||
| 827 | - <td><p class="first last">加入会议化异常错误</p></td> | ||
| 828 | - </tr> | ||
| 829 | - <tr class="row-even"> | ||
| 830 | - <td>ERR_CLASS_JOIN_PARAM</td> | ||
| 831 | - <td>203</td> | ||
| 832 | - <td><p class="first last">加入会议参数错误</p></td> | ||
| 833 | - </tr> | ||
| 834 | - <tr class="row-even"> | ||
| 835 | - <td>ERR_CLASS_JOIN_FULL</td> | ||
| 836 | - <td>204</td> | ||
| 837 | - <td><p class="first last">人数已满</p></td> | ||
| 838 | - </tr> | ||
| 839 | - <tr class="row-even"> | ||
| 840 | - <td>ERR_CLASS_MD5_WRONG</td> | ||
| 841 | - <td>205</td> | ||
| 842 | - <td><p class="first last">MD5验证失败</p></td> | ||
| 843 | - </tr> | ||
| 844 | - <tr class="row-even"> | ||
| 845 | - <td>ERR_CLASS_PASSWORD_WRONG</td> | ||
| 846 | - <td>206</td> | ||
| 847 | - <td><p class="first last">密码错误</p></td> | ||
| 848 | - </tr> | ||
| 849 | - <tr class="row-even"> | ||
| 850 | - <td>ERR_CLASS_JOIN_CONFILICT</td> | ||
| 851 | - <td>207</td> | ||
| 852 | - <td><p class="first last">已经在其它地方登陆</p></td> | ||
| 853 | - </tr> | ||
| 854 | - | ||
| 855 | - | ||
| 856 | - | ||
| 857 | - | ||
| 858 | - <tr class="row-even"> | ||
| 859 | - <td>ERR_GET_CLASS_DETAIL</td> | ||
| 860 | - <td>300</td> | ||
| 861 | - <td><p class="first last">获取classDetail失败</p></td> | ||
| 862 | - </tr> | ||
| 863 | - <tr class="row-even"> | ||
| 864 | - <td>ERR_GET_MEETING_PARAML</td> | ||
| 865 | - <td>301</td> | ||
| 866 | - <td><p class="first last">获取MeetingParam失败</p></td> | ||
| 867 | - </tr> | ||
| 868 | - | ||
| 869 | - | ||
| 870 | - <tr class="row-even"> | ||
| 871 | - <td>ERR_NETWORK</td> | ||
| 872 | - <td>10000</td> | ||
| 873 | - <td><p class="first last">网络错误</p></td> | ||
| 874 | - </tr> | ||
| 875 | - <tr class="row-even"> | ||
| 876 | - <td>ERR_UNKNOWN</td> | ||
| 877 | - <td>10001</td> | ||
| 878 | - <td><p class="first last">未知错误</p></td> | ||
| 879 | - </tr> | ||
| 880 | - | ||
| 881 | - </tbody> | ||
| 882 | - </table> | ||
| 883 | -</div> | ||
| 884 | - | ||
| 885 | -</body> | ||
| 886 | -</html> | ||
| 887 | -<!-- This document was created with MarkdownPad, the Markdown editor for Windows (http://markdownpad.com) --> |
docs/McuClient_v.1.0.2_API.md
已删除
100644 → 0
| 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 | - | ||
| 324 | -## <font color=blue>McuClient 回调事件 </font>## | ||
| 325 | - | ||
| 326 | - | ||
| 327 | -### 会议日志信息 事件回调 ### | ||
| 328 | -示例代码 | ||
| 329 | - | ||
| 330 | - client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){ | ||
| 331 | - | ||
| 332 | - //返回值 | ||
| 333 | - /*{ | ||
| 334 | - "repeatmonthweekweek": 0, | ||
| 335 | - "endmode": 0, | ||
| 336 | - "repeatweek": "", | ||
| 337 | - "endcount": 1, | ||
| 338 | - "errorCode": 0, | ||
| 339 | - "cycle": 0, | ||
| 340 | - "repeatmonthday": 0, | ||
| 341 | - "frequency": 1, | ||
| 342 | - "repeatday": 0, | ||
| 343 | - "meetingName": "mcuClient", | ||
| 344 | - "repeatmode": 0, | ||
| 345 | - "finalenddate": "", | ||
| 346 | - "meetingContent": "", | ||
| 347 | - "beginTime": "2017-01-16 13:00:00", | ||
| 348 | - "endTime": "2017-01-31 15:00:00", | ||
| 349 | - "monthType": 0, | ||
| 350 | - "category": "", | ||
| 351 | - "repeatmonthweekday": 0, | ||
| 352 | - "status": 1 | ||
| 353 | - }*/ | ||
| 354 | - }); | ||
| 355 | - | ||
| 356 | -### 会议有人加入 事件回调 ### | ||
| 357 | -示例代码 | ||
| 358 | - | ||
| 359 | - client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){ | ||
| 360 | - //返回值 | ||
| 361 | - /*{ | ||
| 362 | - "nodeId": 1483947664, | ||
| 363 | - "nodeData": { | ||
| 364 | - "nodeId": 1483947664, | ||
| 365 | - "name": "cccccc", | ||
| 366 | - "role": 1, | ||
| 367 | - "level": 0, | ||
| 368 | - "audioRecords": [], | ||
| 369 | - "videoRecords": [], | ||
| 370 | - "status": null, | ||
| 371 | - "userData": { | ||
| 372 | - "qq": "", | ||
| 373 | - "skype": "", | ||
| 374 | - "mobile": "" | ||
| 375 | - }, | ||
| 376 | - "userId": "0", | ||
| 377 | - "handUpTime": null, | ||
| 378 | - "deviceType": 3, | ||
| 379 | - "mobileDirection": null | ||
| 380 | - } | ||
| 381 | - }*/ | ||
| 382 | - }); | ||
| 383 | - | ||
| 384 | -### 会议有人离开 事件回调 ### | ||
| 385 | -示例代码 | ||
| 386 | - | ||
| 387 | - client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){ | ||
| 388 | - //{"nodeId":1234} | ||
| 389 | - }); | ||
| 390 | -### 关闭会议 事件回调 ### | ||
| 391 | -示例代码 | ||
| 392 | - | ||
| 393 | - client.on(MessageTypes.CLASS_EXIT, function(callbackData){ | ||
| 394 | - //..... | ||
| 395 | - }); | ||
| 396 | - | ||
| 397 | -### 收到聊天消息 事件回调 ### | ||
| 398 | -示例代码 | ||
| 399 | - | ||
| 400 | - client.on(MessageTypes.CHAT_RECEIVE, function(callbackData){ | ||
| 401 | - //返回值 | ||
| 402 | - /*{ | ||
| 403 | - "fromNodeID": 1484207995, | ||
| 404 | - "toNodeID": 0, | ||
| 405 | - "message": "消息内容", | ||
| 406 | - "fromName": "发送消息人的名字", | ||
| 407 | - "fromRole": 0 | ||
| 408 | - }*/ | ||
| 409 | - }); | ||
| 410 | - | ||
| 411 | -### 视频显示 事件回调 ### | ||
| 412 | -示例代码 | ||
| 413 | - | ||
| 414 | - client.on(MessageTypes.VIDEO_RECEIVE, function(callbackData){ | ||
| 415 | - //..... | ||
| 416 | - }); | ||
| 417 | - | ||
| 418 | -### 文档 事件回调 ### | ||
| 419 | -示例代码 | ||
| 420 | - | ||
| 421 | - client.on(MessageTypes.DOC_SHOW, function(callbackData){ | ||
| 422 | - //..... | ||
| 423 | - }); | ||
| 424 | - | ||
| 425 | -### 文档笔记 事件回调 ### | ||
| 426 | -示例代码 | ||
| 427 | - | ||
| 428 | - client.on(MessageTypes.DOC_ANNOTATION,function(callbackData){ | ||
| 429 | - //..... | ||
| 430 | - }); | ||
| 431 | - | ||
| 432 | -### 删除文档 事件回调 ### | ||
| 433 | -示例代码 | ||
| 434 | - | ||
| 435 | - client.on(MessageTypes.DOC_DELETE,function(callbackData){ | ||
| 436 | - //..... | ||
| 437 | - }); | ||
| 438 | - | ||
| 439 | ----------- | ||
| 440 | - | ||
| 441 | -## <font color=blue>ErrorCode 错误码查询</font> ## | ||
| 442 | - | ||
| 443 | -<div class="wy-table-responsive"> | ||
| 444 | - <table border="1" class="docutils"> | ||
| 445 | - <colgroup> | ||
| 446 | - <col width="14%"> | ||
| 447 | - <col width="10%"> | ||
| 448 | - <col width="76%"> | ||
| 449 | - </colgroup> | ||
| 450 | - <tbody valign="M"> | ||
| 451 | - <tr class="row-odd"> | ||
| 452 | - <td><p class="first last">错误代码</p></td> | ||
| 453 | - <td><p class="first last">值(code)</p></td> | ||
| 454 | - <td><p class="first last">描述(reson)</p></td> | ||
| 455 | - </tr> | ||
| 456 | - | ||
| 457 | - <tr class="row-even"> | ||
| 458 | - <td>ERR_CLASS_INIT_PAEAM</td> | ||
| 459 | - <td>100</td> | ||
| 460 | - <td><p class="first last">初始化参数错误</p></td> | ||
| 461 | - </tr> | ||
| 462 | - <tr class="row-even"> | ||
| 463 | - <td>ERR_CLASS_INIT_NETWORK</td> | ||
| 464 | - <td>101</td> | ||
| 465 | - <td><p class="first last">初始化网络错误</p></td> | ||
| 466 | - </tr> | ||
| 467 | - <tr class="row-even"> | ||
| 468 | - <td>ERR_CLASS_INIT_PROTOCOL</td> | ||
| 469 | - <td>102</td> | ||
| 470 | - <td><p class="first last">初始化协议错误</p></td> | ||
| 471 | - </tr> | ||
| 472 | - <tr class="row-even"> | ||
| 473 | - <td>ERR_CLASS_INIT_FAILED</td> | ||
| 474 | - <td>103</td> | ||
| 475 | - <td><p class="first last">初始化验证失败</p></td> | ||
| 476 | - </tr> | ||
| 477 | - | ||
| 478 | - | ||
| 479 | - | ||
| 480 | - <tr class="row-even"> | ||
| 481 | - <td>ERR_CLASS_JOIN_NETWORK</td> | ||
| 482 | - <td>200</td> | ||
| 483 | - <td><p class="first last">加入会议网络错误</p></td> | ||
| 484 | - </tr> | ||
| 485 | - <tr class="row-even"> | ||
| 486 | - <td>ERR_CLASS_JOIN_PROTOCOL</td> | ||
| 487 | - <td>201</td> | ||
| 488 | - <td><p class="first last">加入会议化协议错误</p></td> | ||
| 489 | - </tr> | ||
| 490 | - <tr class="row-even"> | ||
| 491 | - <td>ERR_CLASS_JOIN_FAILED</td> | ||
| 492 | - <td>202</td> | ||
| 493 | - <td><p class="first last">加入会议化异常错误</p></td> | ||
| 494 | - </tr> | ||
| 495 | - <tr class="row-even"> | ||
| 496 | - <td>ERR_CLASS_JOIN_PARAM</td> | ||
| 497 | - <td>203</td> | ||
| 498 | - <td><p class="first last">加入会议参数错误</p></td> | ||
| 499 | - </tr> | ||
| 500 | - <tr class="row-even"> | ||
| 501 | - <td>ERR_CLASS_JOIN_FULL</td> | ||
| 502 | - <td>204</td> | ||
| 503 | - <td><p class="first last">人数已满</p></td> | ||
| 504 | - </tr> | ||
| 505 | - <tr class="row-even"> | ||
| 506 | - <td>ERR_CLASS_MD5_WRONG</td> | ||
| 507 | - <td>205</td> | ||
| 508 | - <td><p class="first last">MD5验证失败</p></td> | ||
| 509 | - </tr> | ||
| 510 | - <tr class="row-even"> | ||
| 511 | - <td>ERR_CLASS_PASSWORD_WRONG</td> | ||
| 512 | - <td>206</td> | ||
| 513 | - <td><p class="first last">密码错误</p></td> | ||
| 514 | - </tr> | ||
| 515 | - <tr class="row-even"> | ||
| 516 | - <td>ERR_CLASS_JOIN_CONFILICT</td> | ||
| 517 | - <td>207</td> | ||
| 518 | - <td><p class="first last">已经在其它地方登陆</p></td> | ||
| 519 | - </tr> | ||
| 520 | - | ||
| 521 | - | ||
| 522 | - | ||
| 523 | - | ||
| 524 | - <tr class="row-even"> | ||
| 525 | - <td>ERR_GET_CLASS_DETAIL</td> | ||
| 526 | - <td>300</td> | ||
| 527 | - <td><p class="first last">获取classDetail失败</p></td> | ||
| 528 | - </tr> | ||
| 529 | - <tr class="row-even"> | ||
| 530 | - <td>ERR_GET_MEETING_PARAML</td> | ||
| 531 | - <td>301</td> | ||
| 532 | - <td><p class="first last">获取MeetingParam失败</p></td> | ||
| 533 | - </tr> | ||
| 534 | - | ||
| 535 | - | ||
| 536 | - <tr class="row-even"> | ||
| 537 | - <td>ERR_NETWORK</td> | ||
| 538 | - <td>10000</td> | ||
| 539 | - <td><p class="first last">网络错误</p></td> | ||
| 540 | - </tr> | ||
| 541 | - <tr class="row-even"> | ||
| 542 | - <td>ERR_UNKNOWN</td> | ||
| 543 | - <td>10001</td> | ||
| 544 | - <td><p class="first last">未知错误</p></td> | ||
| 545 | - </tr> | ||
| 546 | - | ||
| 547 | - <tr class="row-even"> | ||
| 548 | - <td>ERR_SOCKET_DISCONNECT</td> | ||
| 549 | - <td>20000</td> | ||
| 550 | - <td><p class="first last">MCU断开连接,已经离开会议</p></td> | ||
| 551 | - </tr> | ||
| 552 | - </tbody> | ||
| 553 | - </table> | ||
| 554 | -</div> |
docs/McuClient_v.1.0.2_API.pdf
已删除
100644 → 0
不能预览此文件类型
docs/McuClient_v.1.0.3_API.md
已删除
100644 → 0
| 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 | -#### client.sendDeleteAnnotaion(paramInfo) #### | ||
| 472 | -删除已有的白板内容,每一次插入的白板内容都有一个唯一的itemIdx标识,需要删除指定的白板内容,参数传递itemIdx即可。 | ||
| 473 | - | ||
| 474 | -示例代码 | ||
| 475 | - | ||
| 476 | - //下列代码为删除itemIdx标识为12222的白板内容 | ||
| 477 | - | ||
| 478 | - var paramInfo={ | ||
| 479 | - "itemIdx": 12222 | ||
| 480 | - }; | ||
| 481 | - client.sendDeleteAnnotaion(paramInfo); | ||
| 482 | - | ||
| 483 | - | ||
| 484 | -<div class="wy-table-responsive"> | ||
| 485 | - <table border="1" class="docutils"> | ||
| 486 | - <colgroup> | ||
| 487 | - <col width="10%"> | ||
| 488 | - <col width="10%"> | ||
| 489 | - <col width="80%"> | ||
| 490 | - </colgroup> | ||
| 491 | - <tbody valign="m"> | ||
| 492 | - <tr class="row-odd"> | ||
| 493 | - <td><p class="first last">参数名称</p></td> | ||
| 494 | - <td><p class="first last">类型</p></td> | ||
| 495 | - <td><p class="first last">该对象包含以下属性</p></td> | ||
| 496 | - </tr> | ||
| 497 | - <tr class="row-even"> | ||
| 498 | - <td rowspan="11">paramInfo</td> | ||
| 499 | - <td rowspan="11"><p class="first last">对象</p></td> | ||
| 500 | - | ||
| 501 | - </tr> | ||
| 502 | - | ||
| 503 | - <tr class="row-odd"> | ||
| 504 | - <td> | ||
| 505 | - <ul> | ||
| 506 | - <li>itemIdx:(必选)Number</p></li> | ||
| 507 | - 白板内容的itemIdx标识,需要删除指定的白板内容,参数传递itemIdx即可。 | ||
| 508 | - </ul> | ||
| 509 | - </td> | ||
| 510 | - </tbody> | ||
| 511 | - </table> | ||
| 512 | -</div> | ||
| 513 | - | ||
| 514 | ----------- | ||
| 515 | - | ||
| 516 | - | ||
| 517 | -## <font color=blue>McuClient 回调事件 </font>## | ||
| 518 | - | ||
| 519 | - | ||
| 520 | -### 会议日志信息 事件回调 ### | ||
| 521 | -示例代码 | ||
| 522 | - | ||
| 523 | - client.on(MessageTypes.CLASS_SHOW_DETAIL, function(callbackData){ | ||
| 524 | - | ||
| 525 | - //返回值 | ||
| 526 | - /*{ | ||
| 527 | - "repeatmonthweekweek": 0, | ||
| 528 | - "endmode": 0, | ||
| 529 | - "repeatweek": "", | ||
| 530 | - "endcount": 1, | ||
| 531 | - "errorCode": 0, | ||
| 532 | - "cycle": 0, | ||
| 533 | - "repeatmonthday": 0, | ||
| 534 | - "frequency": 1, | ||
| 535 | - "repeatday": 0, | ||
| 536 | - "meetingName": "mcuClient", | ||
| 537 | - "repeatmode": 0, | ||
| 538 | - "finalenddate": "", | ||
| 539 | - "meetingContent": "", | ||
| 540 | - "beginTime": "2017-01-16 13:00:00", | ||
| 541 | - "endTime": "2017-01-31 15:00:00", | ||
| 542 | - "monthType": 0, | ||
| 543 | - "category": "", | ||
| 544 | - "repeatmonthweekday": 0, | ||
| 545 | - "status": 1 | ||
| 546 | - }*/ | ||
| 547 | - }); | ||
| 548 | - | ||
| 549 | -### 会议有人加入事件回调 ### | ||
| 550 | -示例代码 | ||
| 551 | - | ||
| 552 | - client.on(MessageTypes.CLASS_INSERT_ROSTER,function(callbackData){ | ||
| 553 | - //返回值 | ||
| 554 | - /*{ | ||
| 555 | - "nodeId": 1483947664, | ||
| 556 | - "nodeData": { | ||
| 557 | - "nodeId": 1483947664, | ||
| 558 | - "name": "cccccc", | ||
| 559 | - "role": 1, | ||
| 560 | - "level": 0, | ||
| 561 | - "audioRecords": [], | ||
| 562 | - "videoRecords": [], | ||
| 563 | - "status": null, | ||
| 564 | - "userData": { | ||
| 565 | - "qq": "", | ||
| 566 | - "skype": "", | ||
| 567 | - "mobile": "" | ||
| 568 | - }, | ||
| 569 | - "userId": "0", | ||
| 570 | - "handUpTime": null, | ||
| 571 | - "deviceType": 3, | ||
| 572 | - "mobileDirection": null | ||
| 573 | - } | ||
| 574 | - }*/ | ||
| 575 | - }); | ||
| 576 | - | ||
| 577 | -### 会议有人离开 事件回调 ### | ||
| 578 | -示例代码 | ||
| 579 | - | ||
| 580 | - client.on(MessageTypes.CLASS_DELETE_ROSTER,function(callbackData){ | ||
| 581 | - //{"nodeId":1234} | ||
| 582 | - }); | ||
| 583 | -### 关闭会议 事件回调 ### | ||
| 584 | -示例代码 | ||
| 585 | - | ||
| 586 | - client.on(MessageTypes.CLASS_EXIT, function(callbackData){ | ||
| 587 | - //..... | ||
| 588 | - }); | ||
| 589 | - | ||
| 590 | -### 收到聊天消息 事件回调 ### | ||
| 591 | -示例代码 | ||
| 592 | - | ||
| 593 | - client.on(MessageTypes.CHAT_RECEIVE, function(callbackData){ | ||
| 594 | - //返回值 | ||
| 595 | - /*{ | ||
| 596 | - "fromNodeID": 1484207995, | ||
| 597 | - "toNodeID": 0, | ||
| 598 | - "message": "消息内容", | ||
| 599 | - "fromName": "发送消息人的名字", | ||
| 600 | - "fromRole": 0 | ||
| 601 | - }*/ | ||
| 602 | - }); | ||
| 603 | - | ||
| 604 | - | ||
| 605 | -### 白板插入内容 事件回调 ### | ||
| 606 | -示例代码 | ||
| 607 | - | ||
| 608 | - client.on(MessageTypes.WHITEBOARD_ANNOTAION_INSERT, function(callbackData){ | ||
| 609 | - //..... | ||
| 610 | - }); | ||
| 611 | - | ||
| 612 | - | ||
| 613 | -### 白板删除内容 事件回调 ### | ||
| 614 | -示例代码 | ||
| 615 | - | ||
| 616 | - client.on(MessageTypes.WHITEBOARD_ANNOTAION_DELETE, function(callbackData){ | ||
| 617 | - //..... | ||
| 618 | - }); | ||
| 619 | - | ||
| 620 | - | ||
| 621 | -### 视频显示 事件回调 ### | ||
| 622 | -示例代码 | ||
| 623 | - | ||
| 624 | - client.on(MessageTypes.VIDEO_RECEIVE, function(callbackData){ | ||
| 625 | - //..... | ||
| 626 | - }); | ||
| 627 | - | ||
| 628 | -### 文档 事件回调 ### | ||
| 629 | -示例代码 | ||
| 630 | - | ||
| 631 | - client.on(MessageTypes.DOC_SHOW, function(callbackData){ | ||
| 632 | - //..... | ||
| 633 | - }); | ||
| 634 | - | ||
| 635 | -### 文档笔记 事件回调 ### | ||
| 636 | -示例代码 | ||
| 637 | - | ||
| 638 | - client.on(MessageTypes.DOC_ANNOTATION,function(callbackData){ | ||
| 639 | - //..... | ||
| 640 | - }); | ||
| 641 | - | ||
| 642 | -### 删除文档 事件回调 ### | ||
| 643 | -示例代码 | ||
| 644 | - | ||
| 645 | - client.on(MessageTypes.DOC_DEL,function(callbackData){ | ||
| 646 | - //..... | ||
| 647 | - }); | ||
| 648 | - | ||
| 649 | ----------- | ||
| 650 | - | ||
| 651 | -## <font color=blue>ErrorCode 错误码查询</font> ## | ||
| 652 | - | ||
| 653 | -<div class="wy-table-responsive"> | ||
| 654 | - <table border="1" class="docutils"> | ||
| 655 | - <colgroup> | ||
| 656 | - <col width="14%"> | ||
| 657 | - <col width="10%"> | ||
| 658 | - <col width="76%"> | ||
| 659 | - </colgroup> | ||
| 660 | - <tbody valign="M"> | ||
| 661 | - <tr class="row-odd"> | ||
| 662 | - <td><p class="first last">错误代码</p></td> | ||
| 663 | - <td><p class="first last">值(code)</p></td> | ||
| 664 | - <td><p class="first last">描述(reson)</p></td> | ||
| 665 | - </tr> | ||
| 666 | - | ||
| 667 | - <tr class="row-even"> | ||
| 668 | - <td>ERR_CLASS_INIT_PAEAM</td> | ||
| 669 | - <td>100</td> | ||
| 670 | - <td><p class="first last">初始化参数错误</p></td> | ||
| 671 | - </tr> | ||
| 672 | - <tr class="row-even"> | ||
| 673 | - <td>ERR_CLASS_INIT_NETWORK</td> | ||
| 674 | - <td>101</td> | ||
| 675 | - <td><p class="first last">初始化网络错误</p></td> | ||
| 676 | - </tr> | ||
| 677 | - <tr class="row-even"> | ||
| 678 | - <td>ERR_CLASS_INIT_PROTOCOL</td> | ||
| 679 | - <td>102</td> | ||
| 680 | - <td><p class="first last">初始化协议错误</p></td> | ||
| 681 | - </tr> | ||
| 682 | - <tr class="row-even"> | ||
| 683 | - <td>ERR_CLASS_INIT_FAILED</td> | ||
| 684 | - <td>103</td> | ||
| 685 | - <td><p class="first last">初始化验证失败</p></td> | ||
| 686 | - </tr> | ||
| 687 | - | ||
| 688 | - | ||
| 689 | - | ||
| 690 | - <tr class="row-even"> | ||
| 691 | - <td>ERR_CLASS_JOIN_NETWORK</td> | ||
| 692 | - <td>200</td> | ||
| 693 | - <td><p class="first last">加入会议网络错误</p></td> | ||
| 694 | - </tr> | ||
| 695 | - <tr class="row-even"> | ||
| 696 | - <td>ERR_CLASS_JOIN_PROTOCOL</td> | ||
| 697 | - <td>201</td> | ||
| 698 | - <td><p class="first last">加入会议化协议错误</p></td> | ||
| 699 | - </tr> | ||
| 700 | - <tr class="row-even"> | ||
| 701 | - <td>ERR_CLASS_JOIN_FAILED</td> | ||
| 702 | - <td>202</td> | ||
| 703 | - <td><p class="first last">加入会议化异常错误</p></td> | ||
| 704 | - </tr> | ||
| 705 | - <tr class="row-even"> | ||
| 706 | - <td>ERR_CLASS_JOIN_PARAM</td> | ||
| 707 | - <td>203</td> | ||
| 708 | - <td><p class="first last">加入会议参数错误</p></td> | ||
| 709 | - </tr> | ||
| 710 | - <tr class="row-even"> | ||
| 711 | - <td>ERR_CLASS_JOIN_FULL</td> | ||
| 712 | - <td>204</td> | ||
| 713 | - <td><p class="first last">人数已满</p></td> | ||
| 714 | - </tr> | ||
| 715 | - <tr class="row-even"> | ||
| 716 | - <td>ERR_CLASS_MD5_WRONG</td> | ||
| 717 | - <td>205</td> | ||
| 718 | - <td><p class="first last">MD5验证失败</p></td> | ||
| 719 | - </tr> | ||
| 720 | - <tr class="row-even"> | ||
| 721 | - <td>ERR_CLASS_PASSWORD_WRONG</td> | ||
| 722 | - <td>206</td> | ||
| 723 | - <td><p class="first last">密码错误</p></td> | ||
| 724 | - </tr> | ||
| 725 | - <tr class="row-even"> | ||
| 726 | - <td>ERR_CLASS_JOIN_CONFILICT</td> | ||
| 727 | - <td>207</td> | ||
| 728 | - <td><p class="first last">已经在其它地方登陆</p></td> | ||
| 729 | - </tr> | ||
| 730 | - | ||
| 731 | - | ||
| 732 | - | ||
| 733 | - | ||
| 734 | - <tr class="row-even"> | ||
| 735 | - <td>ERR_GET_CLASS_DETAIL</td> | ||
| 736 | - <td>300</td> | ||
| 737 | - <td><p class="first last">获取classDetail失败</p></td> | ||
| 738 | - </tr> | ||
| 739 | - <tr class="row-even"> | ||
| 740 | - <td>ERR_GET_MEETING_PARAML</td> | ||
| 741 | - <td>301</td> | ||
| 742 | - <td><p class="first last">获取MeetingParam失败</p></td> | ||
| 743 | - </tr> | ||
| 744 | - | ||
| 745 | - | ||
| 746 | - <tr class="row-even"> | ||
| 747 | - <td>ERR_NETWORK</td> | ||
| 748 | - <td>10000</td> | ||
| 749 | - <td><p class="first last">网络错误</p></td> | ||
| 750 | - </tr> | ||
| 751 | - <tr class="row-even"> | ||
| 752 | - <td>ERR_UNKNOWN</td> | ||
| 753 | - <td>10001</td> | ||
| 754 | - <td><p class="first last">未知错误</p></td> | ||
| 755 | - </tr> | ||
| 756 | - | ||
| 757 | - <tr class="row-even"> | ||
| 758 | - <td>ERR_SOCKET_DISCONNECT</td> | ||
| 759 | - <td>20000</td> | ||
| 760 | - <td><p class="first last">MCU断开连接,已经离开会议</p></td> | ||
| 761 | - </tr> | ||
| 762 | - </tbody> | ||
| 763 | - </table> | ||
| 764 | -</div> |
docs/McuClient_v.1.0.3_API.pdf
已删除
100644 → 0
不能预览此文件类型
docs/README.md
已删除
100644 → 0
| 1 | -# DOCS FOLDER | ||
| 2 | -wrcp 主要负责和MCU服务端通讯部分的 | ||
| 3 | - | ||
| 4 | - | ||
| 5 | -1.协议上 senddata是顶层协议壳。所有消息包都嵌套打在 这个 pdu中 | ||
| 6 | - | ||
| 7 | -2. | ||
| 8 | -从会议流程上看,分以下几类: | ||
| 9 | -1、connectprovider(内部嵌套joinconference包):加入会议协议,分为request和response两组。 | ||
| 10 | -2、joinsession(内部嵌套注册表的操作包):加入应用,分为request和response | ||
| 11 | -3、joinchannel:加入channel | ||
| 12 | -4、adapterpdu 中嵌套注册表操作pdu | ||
| 13 | - mcu中的注册表是有客户端通过adapterpdu来维护的,mcu本身不维护这个数据 | ||
| 14 | - 我特别强调这个,就是想说明,会议的所有控制逻辑不是mcu完成的,而是客户端完成的 | ||
| 15 | - | ||
| 16 | -3.每个应用就是一个session,(joinsession就是加入这个应用),客户端加入这个应用后,就能从mcu的注册标中活的这个应用的所有信息。 | ||
| 17 | -conference这个应用会保留会议的主要信息如用户列表等,而且很多会议控制我觉得也会在这个应用中。 | ||
| 18 | - | ||
| 19 | -然后特定应用如聊天就是负责聊天的数据转发,需要先joinsession然后在joinchannel(相当于聊天的数据通道),这样客户端会通过senddatapdu嵌套chatsenddatapdu来发送聊天channel的消息,其他客户端只要加入了聊天应用的聊天channel,就会收到聊天消息。 | ||
| 20 | - | ||
| 21 | -每个应用在joinsession时会嵌套adapterpdu,其中带上了需要维护的注册表信息(定义 registrykey和object) | ||
| 22 | -注册表常用的就是 table,几乎所有app都维护了一个table | ||
| 23 | - | ||
| 24 | -比如一个会议中会维护三个视频通道,这样在table中就会有三条记录(以视频channel id作为索引 | ||
| 25 | - | ||
| 26 | -所有用户加入视频应用后都会获得这个信息,且记录发生改变时会广播给全网用户。 | ||
| 27 | - | ||
| 28 | -具体到这个表格的存储呢,mcu仅仅知道 id 和 一个 pdu生成的字符串还有owner信息。具体这个记录的内容,mcu没有关心。 | ||
| 29 | - | ||
| 30 | -比如想定义一个会议的控制行为,很可能的操作就是:在conference这个应用的某个表格下插入一个特定id的string值。然后通过修改这个值,然后与会的人知道当前是什么行为 | ||
| 31 | - | ||
| 32 | -再比如,tabbar中的多个tab选项,每个选项对应一个id,其属性可以保存在conference中一个表中,这样属性值中可以有visble选项,老师切换时,将相关id属性同步成true,mcu会广播给所有客户端,这样所有的与会人员就知道切换tab了。 |
-
请 注册 或 登录 后发表评论