正在显示
4 个修改的文件
包含
45 行增加
和
6 行删除
此 diff 太大无法显示。
| @@ -27,7 +27,7 @@ import Server from "config/Server"; | @@ -27,7 +27,7 @@ import Server from "config/Server"; | ||
| 27 | import UTF8 from 'utf-8'; | 27 | import UTF8 from 'utf-8'; |
| 28 | 28 | ||
| 29 | let loger = Loger.getLoger('McuClient'); | 29 | let loger = Loger.getLoger('McuClient'); |
| 30 | -let _sdkInfo = {"version": "v1.17.0.201705010", "author": "www.3mang.com"}; | 30 | +let _sdkInfo = {"version": "v1.18.0.201705010", "author": "www.3mang.com"}; |
| 31 | 31 | ||
| 32 | //APE | 32 | //APE |
| 33 | let _sass; | 33 | let _sass; |
| @@ -134,7 +134,9 @@ export default class MessageEntrance extends Emiter { | @@ -134,7 +134,9 @@ export default class MessageEntrance extends Emiter { | ||
| 134 | this.sendStartClass = this._sendStartClass.bind(this); | 134 | this.sendStartClass = this._sendStartClass.bind(this); |
| 135 | this.sendPauseClass = this._sendPauseClass.bind(this); | 135 | this.sendPauseClass = this._sendPauseClass.bind(this); |
| 136 | this.sendCloseClass = this._sendCloseClass.bind(this); | 136 | this.sendCloseClass = this._sendCloseClass.bind(this); |
| 137 | - this.changeHandUpStatus = this._changeHandUpStatus.bind(this); | 137 | + this.changeHandUpStatus = this._changeHandUpStatus.bind(this);//自己切换举手状态 |
| 138 | + this.controlHandUpStatus = this._controlHandUpStatus.bind(this);//控制别人的举手状态 | ||
| 139 | + | ||
| 138 | 140 | ||
| 139 | //录制回放 | 141 | //录制回放 |
| 140 | this.initRecordPlayback = this._initRecordPlayback.bind(this); | 142 | this.initRecordPlayback = this._initRecordPlayback.bind(this); |
| @@ -969,6 +971,15 @@ export default class MessageEntrance extends Emiter { | @@ -969,6 +971,15 @@ export default class MessageEntrance extends Emiter { | ||
| 969 | _confer_ape.pauseClass(_param); | 971 | _confer_ape.pauseClass(_param); |
| 970 | } | 972 | } |
| 971 | } | 973 | } |
| 974 | + _controlHandUpStatus(_param){ | ||
| 975 | + if (!_mcu.connected) { | ||
| 976 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 977 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; | ||
| 978 | + } | ||
| 979 | + if (_confer_ape) { | ||
| 980 | + _confer_ape.controlHandUpStatus(_param); | ||
| 981 | + } | ||
| 982 | + } | ||
| 972 | _changeHandUpStatus(_param){ | 983 | _changeHandUpStatus(_param){ |
| 973 | if (!_mcu.connected) { | 984 | if (!_mcu.connected) { |
| 974 | loger.warn(GlobalConfig.getCurrentStatus()); | 985 | loger.warn(GlobalConfig.getCurrentStatus()); |
| @@ -23,6 +23,7 @@ ApeConsts.CLASS_PAUSING = "class.update";//更新当前的状态信息 | @@ -23,6 +23,7 @@ ApeConsts.CLASS_PAUSING = "class.update";//更新当前的状态信息 | ||
| 23 | 23 | ||
| 24 | //课堂控制 | 24 | //课堂控制 |
| 25 | ApeConsts.CLASS_ACTION_CLOSE_ALL=1;//所有人关闭课堂 | 25 | ApeConsts.CLASS_ACTION_CLOSE_ALL=1;//所有人关闭课堂 |
| 26 | +ApeConsts.CLASS_ACTION_HANDUP_STATUS_CHANGE=2;//更改用户的举手状态 | ||
| 26 | 27 | ||
| 27 | //课堂类型 | 28 | //课堂类型 |
| 28 | ApeConsts.CLASS_TYPE_INTERACT= 1; // 互动课堂,通过MS转发音视频,不能进行H5观看 | 29 | ApeConsts.CLASS_TYPE_INTERACT= 1; // 互动课堂,通过MS转发音视频,不能进行H5观看 |
| @@ -169,7 +169,7 @@ class ConferApe extends Ape { | @@ -169,7 +169,7 @@ class ConferApe extends Ape { | ||
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | // to, message | 171 | // to, message |
| 172 | - loger.log('发送课堂消息.', _messageInfo); | 172 | + loger.log('发送课堂控制消息.', _messageInfo); |
| 173 | 173 | ||
| 174 | /* message RCConferenceSendDataRequestPdu { | 174 | /* message RCConferenceSendDataRequestPdu { |
| 175 | optional uint32 initiator = 1; | 175 | optional uint32 initiator = 1; |
| @@ -191,11 +191,11 @@ class ConferApe extends Ape { | @@ -191,11 +191,11 @@ class ConferApe extends Ape { | ||
| 191 | // if (!(conferSendPdu.isPublic || 0 === conferSendPdu.peer)) { | 191 | // if (!(conferSendPdu.isPublic || 0 === conferSendPdu.peer)) { |
| 192 | if (!conferSendPdu.isPublic && 0 != conferSendPdu.peer) { | 192 | if (!conferSendPdu.isPublic && 0 != conferSendPdu.peer) { |
| 193 | //发送给制定的人 | 193 | //发送给制定的人 |
| 194 | - loger.log('发送私聊课堂消息.'); | 194 | + //loger.log('发送私聊课堂消息.'); |
| 195 | this.send(conferSendPdu); | 195 | this.send(conferSendPdu); |
| 196 | } else { | 196 | } else { |
| 197 | //发送给所有人 | 197 | //发送给所有人 |
| 198 | - loger.log('发送公聊课堂消息.'); | 198 | + // loger.log('发送公聊课堂消息.'); |
| 199 | this.sendChatUniform(conferSendPdu); | 199 | this.sendChatUniform(conferSendPdu); |
| 200 | } | 200 | } |
| 201 | } | 201 | } |
| @@ -386,6 +386,21 @@ class ConferApe extends Ape { | @@ -386,6 +386,21 @@ class ConferApe extends Ape { | ||
| 386 | this.sendConferMsg({"to": 0, "message": "所有人退出课堂", "actionType": ApeConsts.CLASS_ACTION_CLOSE_ALL}); | 386 | this.sendConferMsg({"to": 0, "message": "所有人退出课堂", "actionType": ApeConsts.CLASS_ACTION_CLOSE_ALL}); |
| 387 | } | 387 | } |
| 388 | 388 | ||
| 389 | + //控制举手状态 | ||
| 390 | + controlHandUpStatus(_param){ | ||
| 391 | + //控制用户的举手状态 | ||
| 392 | + if(!_param||!_param.nodeId){ | ||
| 393 | + loger.log('控制举手状态->失败->参数错误',_param); | ||
| 394 | + return; | ||
| 395 | + } | ||
| 396 | + let msgObj={}; | ||
| 397 | + msgObj.nodeId=_param.nodeId; | ||
| 398 | + msgObj.isHandUp=false; | ||
| 399 | + if(_param&&_param.isHandUp==true){ | ||
| 400 | + msgObj.isHandUp=true; | ||
| 401 | + } | ||
| 402 | + this.sendConferMsg({"to":_param.nodeId, "message":JSON.stringify(msgObj), "actionType": ApeConsts.CLASS_ACTION_HANDUP_STATUS_CHANGE}); | ||
| 403 | + } | ||
| 389 | //切换举手状态 | 404 | //切换举手状态 |
| 390 | changeHandUpStatus(_param){ | 405 | changeHandUpStatus(_param){ |
| 391 | loger.log('切换举手状态->',_param); | 406 | loger.log('切换举手状态->',_param); |
| @@ -573,13 +588,25 @@ class ConferApe extends Ape { | @@ -573,13 +588,25 @@ class ConferApe extends Ape { | ||
| 573 | chatMsg.toNodeID = chatReceivePdu.peer; | 588 | chatMsg.toNodeID = chatReceivePdu.peer; |
| 574 | chatMsg.message = this._rCArrayBufferUtil.uint8ArrayToStr(chatReceivePdu.userData, 2); | 589 | chatMsg.message = this._rCArrayBufferUtil.uint8ArrayToStr(chatReceivePdu.userData, 2); |
| 575 | chatMsg.actionType = chatReceivePdu.actionType; | 590 | chatMsg.actionType = chatReceivePdu.actionType; |
| 576 | - loger.log("conferMsgComingHandler", chatMsg); | 591 | + loger.log("conferMsgComingHandler", chatMsg);//{"fromNodeID":418883112,"toNodeID":0,"message":"所有人退出课堂","actionType":1} |
| 577 | switch (chatMsg.actionType) { | 592 | switch (chatMsg.actionType) { |
| 578 | case ApeConsts.CLASS_ACTION_CLOSE_ALL: | 593 | case ApeConsts.CLASS_ACTION_CLOSE_ALL: |
| 579 | loger.log(chatMsg.message); | 594 | loger.log(chatMsg.message); |
| 580 | //收到课堂关闭,所有人都退出,执行自己关闭的流程 | 595 | //收到课堂关闭,所有人都退出,执行自己关闭的流程 |
| 581 | this._emit(MessageTypes.CLASS_RUN_EXIT,{'type':1}); | 596 | this._emit(MessageTypes.CLASS_RUN_EXIT,{'type':1}); |
| 582 | break; | 597 | break; |
| 598 | + case ApeConsts.CLASS_ACTION_HANDUP_STATUS_CHANGE: | ||
| 599 | + console.log('chatMsg',chatMsg); | ||
| 600 | + let msgObj=null; | ||
| 601 | + try{ | ||
| 602 | + msgObj =JSON.parse(chatMsg.message); | ||
| 603 | + if(msgObj&&msgObj.nodeId==GlobalConfig.nodeId){ | ||
| 604 | + this.changeHandUpStatus(msgObj); | ||
| 605 | + } | ||
| 606 | + }catch (err){ | ||
| 607 | + loger.warn('chatMsg->JSON数据解析失败'); | ||
| 608 | + } | ||
| 609 | + break; | ||
| 583 | default: | 610 | default: |
| 584 | break; | 611 | break; |
| 585 | } | 612 | } |
-
请 注册 或 登录 后发表评论