李勇

1.修改离开会议接口,离开会议之后更改全局状态

此 diff 太大无法显示。
@@ -544,6 +544,11 @@ client初始化成功之后,加入会议。 @@ -544,6 +544,11 @@ client初始化成功之后,加入会议。
544 <td><p class="first last">未知错误</p></td> 544 <td><p class="first last">未知错误</p></td>
545 </tr> 545 </tr>
546 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>
547 </tbody> 552 </tbody>
548 </table> 553 </table>
549 </div> 554 </div>
@@ -92,6 +92,7 @@ export default class MessageEntrance extends Emiter { @@ -92,6 +92,7 @@ export default class MessageEntrance extends Emiter {
92 //公开外部调用的方法 92 //公开外部调用的方法
93 this.init=this._init; 93 this.init=this._init;
94 this.joinClass=this._joinClass; 94 this.joinClass=this._joinClass;
  95 + this.leaveClass=this._leaveClass;
95 this.sendChatMsg=this._sendChatMsg; 96 this.sendChatMsg=this._sendChatMsg;
96 this.setDebugData=this._setDebugData; 97 this.setDebugData=this._setDebugData;
97 this.mcuClientStatus=this._mcuClientStatus; 98 this.mcuClientStatus=this._mcuClientStatus;
@@ -167,7 +168,7 @@ export default class MessageEntrance extends Emiter { @@ -167,7 +168,7 @@ export default class MessageEntrance extends Emiter {
167 } 168 }
168 } 169 }
169 // 离开会议 170 // 离开会议
170 - leaveClass() { 171 + _leaveClass() {
171 if(_mcu){ 172 if(_mcu){
172 _mcu.leaveMCU(); 173 _mcu.leaveMCU();
173 GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3); 174 GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3);
@@ -80,6 +80,10 @@ class EverSocket extends Emiter { @@ -80,6 +80,10 @@ class EverSocket extends Emiter {
80 loger.log('WebSocket,Timers销毁'); 80 loger.log('WebSocket,Timers销毁');
81 window.clearInterval(this.pingTimer); 81 window.clearInterval(this.pingTimer);
82 window.clearInterval(this.pongTimer); 82 window.clearInterval(this.pongTimer);
  83 + if(this.websocket==null){
  84 + loger.log('WebSocket,Timers已经销毁');
  85 + return;
  86 + }
83 this.websocket.onopen = undefined; 87 this.websocket.onopen = undefined;
84 this.websocket.onclose = undefined; 88 this.websocket.onclose = undefined;
85 this.websocket.onerror = undefined; 89 this.websocket.onerror = undefined;
@@ -61,6 +61,7 @@ MessageTypes.MCU_ERROR ="mcuError";//MCU错误 @@ -61,6 +61,7 @@ MessageTypes.MCU_ERROR ="mcuError";//MCU错误
61 MessageTypes.ERR_NETWORK=10000;//网络错误 61 MessageTypes.ERR_NETWORK=10000;//网络错误
62 MessageTypes.ERR_UNKNOWN=10001;//未知错误 62 MessageTypes.ERR_UNKNOWN=10001;//未知错误
63 63
  64 +MessageTypes.ERR_SOCKET_DISCONNECT=20000;//MCU断开连接,已经离开会议
64 65
65 //会议初始化失败的几种情况 66 //会议初始化失败的几种情况
66 MessageTypes.ERR_CLASS_INIT_PAEAM=100;//初始化参数错误 67 MessageTypes.ERR_CLASS_INIT_PAEAM=100;//初始化参数错误
@@ -153,6 +153,8 @@ class MCU extends Emiter { @@ -153,6 +153,8 @@ class MCU extends Emiter {
153 // for (let ape in this._apes) { 153 // for (let ape in this._apes) {
154 // this._apes[ape].stop(); 154 // this._apes[ape].stop();
155 // } 155 // }
  156 + loger.log('leaveMCU');
  157 + GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3)
156 this._everSocket.end(); 158 this._everSocket.end();
157 } 159 }
158 160