正在显示
4 个修改的文件
包含
101 行增加
和
14 行删除
此 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.10.6.20170503", "author": "www.3mang.com"}; | 30 | +let _sdkInfo = {"version": "v1.11.3.20170504", "author": "www.3mang.com"}; |
| 31 | 31 | ||
| 32 | //APE | 32 | //APE |
| 33 | let _sass; | 33 | let _sass; |
| @@ -132,6 +132,7 @@ export default class MessageEntrance extends Emiter { | @@ -132,6 +132,7 @@ export default class MessageEntrance extends Emiter { | ||
| 132 | this.sendStartClass = this._sendStartClass.bind(this); | 132 | this.sendStartClass = this._sendStartClass.bind(this); |
| 133 | this.sendPauseClass = this._sendPauseClass.bind(this); | 133 | this.sendPauseClass = this._sendPauseClass.bind(this); |
| 134 | this.sendCloseClass = this._sendCloseClass.bind(this); | 134 | this.sendCloseClass = this._sendCloseClass.bind(this); |
| 135 | + this.changeHandUpStatus = this._changeHandUpStatus.bind(this); | ||
| 135 | 136 | ||
| 136 | //录制回放 | 137 | //录制回放 |
| 137 | this.initRecordPlayback = this._initRecordPlayback.bind(this); | 138 | this.initRecordPlayback = this._initRecordPlayback.bind(this); |
| @@ -931,12 +932,20 @@ export default class MessageEntrance extends Emiter { | @@ -931,12 +932,20 @@ export default class MessageEntrance extends Emiter { | ||
| 931 | _confer_ape.pauseClass(_param); | 932 | _confer_ape.pauseClass(_param); |
| 932 | } | 933 | } |
| 933 | } | 934 | } |
| 934 | - | 935 | + _changeHandUpStatus(_param){ |
| 936 | + if (!_mcu.connected) { | ||
| 937 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 938 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; | ||
| 939 | + } | ||
| 940 | + if (_confer_ape) { | ||
| 941 | + _confer_ape.changeHandUpStatus(_param); | ||
| 942 | + } | ||
| 943 | + } | ||
| 935 | //停止上课 | 944 | //停止上课 |
| 936 | _sendCloseClass(_param) { | 945 | _sendCloseClass(_param) { |
| 937 | if (!_mcu.connected) { | 946 | if (!_mcu.connected) { |
| 938 | loger.warn(GlobalConfig.getCurrentStatus()); | 947 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 939 | - return; | 948 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; |
| 940 | } | 949 | } |
| 941 | if (_confer_ape) { | 950 | if (_confer_ape) { |
| 942 | _confer_ape.closeClass(_param); | 951 | _confer_ape.closeClass(_param); |
| @@ -947,7 +956,7 @@ export default class MessageEntrance extends Emiter { | @@ -947,7 +956,7 @@ export default class MessageEntrance extends Emiter { | ||
| 947 | _leaveClass(_param) { | 956 | _leaveClass(_param) { |
| 948 | if (!_mcu.connected) { | 957 | if (!_mcu.connected) { |
| 949 | loger.warn(GlobalConfig.getCurrentStatus()); | 958 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 950 | - return; | 959 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; |
| 951 | } | 960 | } |
| 952 | 961 | ||
| 953 | //停止推流 | 962 | //停止推流 |
| @@ -985,11 +994,11 @@ export default class MessageEntrance extends Emiter { | @@ -985,11 +994,11 @@ export default class MessageEntrance extends Emiter { | ||
| 985 | _sendChatMsg(_messageInfo) { | 994 | _sendChatMsg(_messageInfo) { |
| 986 | if (!_mcu.connected) { | 995 | if (!_mcu.connected) { |
| 987 | loger.warn(GlobalConfig.getCurrentStatus()); | 996 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 988 | - return; | 997 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; |
| 989 | } | 998 | } |
| 990 | if (_messageInfo === null || EngineUtils.isEmptyObject(_messageInfo)) { | 999 | if (_messageInfo === null || EngineUtils.isEmptyObject(_messageInfo)) { |
| 991 | loger.log('发送聊天消息失败->参数错误', _messageInfo); | 1000 | loger.log('发送聊天消息失败->参数错误', _messageInfo); |
| 992 | - return; | 1001 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; |
| 993 | } | 1002 | } |
| 994 | if (_chat_ape) { | 1003 | if (_chat_ape) { |
| 995 | _chat_ape.sendChatMsg(_messageInfo); | 1004 | _chat_ape.sendChatMsg(_messageInfo); |
| @@ -1007,7 +1016,7 @@ export default class MessageEntrance extends Emiter { | @@ -1007,7 +1016,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1007 | _sendVideoBroadcastMsg(_param) { | 1016 | _sendVideoBroadcastMsg(_param) { |
| 1008 | if (!_mcu.connected) { | 1017 | if (!_mcu.connected) { |
| 1009 | loger.warn(GlobalConfig.getCurrentStatus()); | 1018 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 1010 | - return; | 1019 | + return {"code": ApeConsts.RETURN_FAILED, "data": ""}; |
| 1011 | } | 1020 | } |
| 1012 | if (_video_ape) { | 1021 | if (_video_ape) { |
| 1013 | return _video_ape.sendVideoBroadcastMsg(_param); | 1022 | return _video_ape.sendVideoBroadcastMsg(_param); |
| @@ -316,6 +316,12 @@ GlobalConfig.deviceType=0; //设备类型 0:电脑 1:安卓 2:ios | @@ -316,6 +316,12 @@ GlobalConfig.deviceType=0; //设备类型 0:电脑 1:安卓 2:ios | ||
| 316 | GlobalConfig.userIp="";//用户当前IP | 316 | GlobalConfig.userIp="";//用户当前IP |
| 317 | GlobalConfig.userId=0; | 317 | GlobalConfig.userId=0; |
| 318 | GlobalConfig.userName=""; | 318 | GlobalConfig.userName=""; |
| 319 | +GlobalConfig.handUpTime=0; | ||
| 320 | +GlobalConfig.level=0; | ||
| 321 | +GlobalConfig.openCamera=0; | ||
| 322 | +GlobalConfig.openMicrophones=0; | ||
| 323 | + | ||
| 324 | + | ||
| 319 | 325 | ||
| 320 | GlobalConfig.nodeId=0;//随机生成 mcu中的唯一ID | 326 | GlobalConfig.nodeId=0;//随机生成 mcu中的唯一ID |
| 321 | GlobalConfig.passwordRequired=false; | 327 | GlobalConfig.passwordRequired=false; |
| @@ -49,9 +49,70 @@ class ConferApe extends Ape { | @@ -49,9 +49,70 @@ class ConferApe extends Ape { | ||
| 49 | 49 | ||
| 50 | //加入课堂 | 50 | //加入课堂 |
| 51 | _joinSessionHandler(_data) { | 51 | _joinSessionHandler(_data) { |
| 52 | - let nodeInfoRecordPdu = this.mcu.mcuClassInfo.self; | ||
| 53 | - loger.log("_joinSessionHandler nodeInfoRecordPdu="); | ||
| 54 | - loger.log(nodeInfoRecordPdu); | 52 | + //let nodeInfoRecordPdu = this.mcu.mcuClassInfo.self; |
| 53 | + let nodeInfoRecordPdu = this.getNodeInfo(); | ||
| 54 | + | ||
| 55 | + let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; | ||
| 56 | + userDataPdu.qq = ''; | ||
| 57 | + userDataPdu.skype = ''; | ||
| 58 | + | ||
| 59 | + nodeInfoRecordPdu.userData = userDataPdu.toArrayBuffer(); | ||
| 60 | + nodeInfoRecordPdu.deviceType = GlobalConfig.deviceType;//设备类型 | ||
| 61 | + | ||
| 62 | + loger.log('开始加入->',nodeInfoRecordPdu); | ||
| 63 | + | ||
| 64 | + let item = new pdu['RCRegistryRosterItemPdu']; | ||
| 65 | + item.nodeId = nodeInfoRecordPdu.nodeId; | ||
| 66 | + item.nodeData = nodeInfoRecordPdu.toArrayBuffer(); | ||
| 67 | + | ||
| 68 | + let rosterUpdateItem = new pdu['RCRegistryRosterUpdateItemPdu']; | ||
| 69 | + rosterUpdateItem.type = pdu.RCPDU_REG_ROSTER_UPDATE_PDU; | ||
| 70 | + rosterUpdateItem.items.push(item); | ||
| 71 | + | ||
| 72 | + let updateObjPdu = new pdu['RCRegistryUpdateObjPdu']; | ||
| 73 | + updateObjPdu.objId = ApeConsts.CONFERENCE_OBJ_ROSTER_ID; | ||
| 74 | + updateObjPdu.subType = rosterUpdateItem.type; | ||
| 75 | + updateObjPdu.userData = rosterUpdateItem.toArrayBuffer(); | ||
| 76 | + | ||
| 77 | + //同步 | ||
| 78 | + let adapterItemPdu = new pdu['RCAdapterItemPdu']; | ||
| 79 | + adapterItemPdu.type = pdu.RCPDU_REG_UPDATE_OBJ; | ||
| 80 | + adapterItemPdu.itemData = updateObjPdu.toArrayBuffer(); | ||
| 81 | + | ||
| 82 | + let adapterPdu = new pdu['RCAdapterPdu']; | ||
| 83 | + adapterPdu.type = pdu.RCPDU_REG_ADAPTER; | ||
| 84 | + adapterPdu.item.push(adapterItemPdu); | ||
| 85 | + this.sendUniform(adapterPdu, true); | ||
| 86 | + } | ||
| 87 | + //获取角色信息 | ||
| 88 | + getNodeInfo(){ | ||
| 89 | + let nodeInfoRecordPdu = new pdu['RCNodeInfoRecordPdu']; | ||
| 90 | + nodeInfoRecordPdu.nodeId= GlobalConfig.nodeId; | ||
| 91 | + nodeInfoRecordPdu.name= GlobalConfig.userName; | ||
| 92 | + nodeInfoRecordPdu.role= ApeConsts.userTypesToId[GlobalConfig.userRole] || 1; //NR_NORMAL用户的身份,根据用户登录时的身份设置; | ||
| 93 | + nodeInfoRecordPdu.level= GlobalConfig.level; | ||
| 94 | + //nodeInfoRecordPdu.audioRecords= GlobalConfig.audioRecords; | ||
| 95 | + //nodeInfoRecordPdu.videoRecords= GlobalConfig.videoRecords; | ||
| 96 | + //nodeInfoRecordPdu.status= GlobalConfig.status; | ||
| 97 | + nodeInfoRecordPdu.userData= GlobalConfig.userData; | ||
| 98 | + nodeInfoRecordPdu.userId= GlobalConfig.userId; | ||
| 99 | + nodeInfoRecordPdu.handUpTime= GlobalConfig.handUpTime; | ||
| 100 | + //nodeInfoRecordPdu.deviceType= GlobalConfig.deviceType; | ||
| 101 | + //nodeInfoRecordPdu.mobileDirection= GlobalConfig.mobileDirection; | ||
| 102 | + nodeInfoRecordPdu.microphones= GlobalConfig.microphones; | ||
| 103 | + nodeInfoRecordPdu.cameras= GlobalConfig.cameras; | ||
| 104 | + nodeInfoRecordPdu.openCamera= GlobalConfig.openCamera; | ||
| 105 | + nodeInfoRecordPdu.openMicrophones= GlobalConfig.openMicrophones; | ||
| 106 | + nodeInfoRecordPdu.videoQuality= GlobalConfig.videoQuality; | ||
| 107 | + nodeInfoRecordPdu.userIp= GlobalConfig.userIp; | ||
| 108 | + | ||
| 109 | + | ||
| 110 | + return nodeInfoRecordPdu; | ||
| 111 | + } | ||
| 112 | + //更新角色数据 | ||
| 113 | + updateUserInfo(){ | ||
| 114 | + let nodeInfoRecordPdu = this.getNodeInfo(); | ||
| 115 | + loger.log('更新用户信息->',nodeInfoRecordPdu); | ||
| 55 | let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; | 116 | let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; |
| 56 | userDataPdu.qq = ''; | 117 | userDataPdu.qq = ''; |
| 57 | userDataPdu.skype = ''; | 118 | userDataPdu.skype = ''; |
| @@ -311,12 +372,23 @@ class ConferApe extends Ape { | @@ -311,12 +372,23 @@ class ConferApe extends Ape { | ||
| 311 | this.sendConferMsg({"to": 0, "message": "所有人退出课堂", "actionType": ApeConsts.CLASS_ACTION_CLOSE_ALL}); | 372 | this.sendConferMsg({"to": 0, "message": "所有人退出课堂", "actionType": ApeConsts.CLASS_ACTION_CLOSE_ALL}); |
| 312 | } | 373 | } |
| 313 | 374 | ||
| 375 | + //切换举手状态 | ||
| 376 | + changeHandUpStatus(_param){ | ||
| 377 | + loger.log('切换举手状态->',_param); | ||
| 378 | + if(_param&&_param.isHandUp==true){ | ||
| 379 | + //举手 | ||
| 380 | + GlobalConfig.handUpTime=EngineUtils.creatTimestamp(); | ||
| 381 | + }else { | ||
| 382 | + GlobalConfig.handUpTime=0;//默认0是没有举手的状态(大于0就是举手) | ||
| 383 | + } | ||
| 384 | + this.updateUserInfo(); | ||
| 385 | + } | ||
| 314 | 386 | ||
| 315 | //更新课堂信息 | 387 | //更新课堂信息 |
| 316 | sendUpdaterClassStatusInfo(_param) { | 388 | sendUpdaterClassStatusInfo(_param) { |
| 317 | - loger.log('sendUpdaterClassStatusInfo'); | 389 | + loger.log('更新课堂信息->'); |
| 318 | if (_param == null || EngineUtils.isEmptyObject(_param)) { | 390 | if (_param == null || EngineUtils.isEmptyObject(_param)) { |
| 319 | - loger.log('sendUpdaterClassStatusInfo,参数错误'); | 391 | + loger.log('更新课堂信息->参数错误'); |
| 320 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 392 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 321 | return; | 393 | return; |
| 322 | } | 394 | } |
| @@ -326,7 +398,7 @@ class ConferApe extends Ape { | @@ -326,7 +398,7 @@ class ConferApe extends Ape { | ||
| 326 | loger.log(modelPdu); | 398 | loger.log(modelPdu); |
| 327 | 399 | ||
| 328 | if (modelPdu == null) { | 400 | if (modelPdu == null) { |
| 329 | - loger.log('sendUpdaterClassStatusInfo,参数错误'); | 401 | + loger.log('更新课堂信息->参数错误'); |
| 330 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 402 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 331 | return; | 403 | return; |
| 332 | } | 404 | } |
| @@ -360,7 +432,7 @@ class ConferApe extends Ape { | @@ -360,7 +432,7 @@ class ConferApe extends Ape { | ||
| 360 | adapterPdu.type = pdu.RCPDU_REG_ADAPTER; | 432 | adapterPdu.type = pdu.RCPDU_REG_ADAPTER; |
| 361 | adapterPdu.item.push(adapterItemPdu); | 433 | adapterPdu.item.push(adapterItemPdu); |
| 362 | 434 | ||
| 363 | - loger.log("课堂发送更新数据============"); | 435 | + loger.log("更新课堂信息->发送更新数据"); |
| 364 | this.sendUniform(adapterPdu, true); | 436 | this.sendUniform(adapterPdu, true); |
| 365 | } | 437 | } |
| 366 | 438 |
-
请 注册 或 登录 后发表评论