李勇

增加控制举手状态的接口;

此 diff 太大无法显示。
... ... @@ -27,7 +27,7 @@ import Server from "config/Server";
import UTF8 from 'utf-8';
let loger = Loger.getLoger('McuClient');
let _sdkInfo = {"version": "v1.17.0.201705010", "author": "www.3mang.com"};
let _sdkInfo = {"version": "v1.18.0.201705010", "author": "www.3mang.com"};
//APE
let _sass;
... ... @@ -134,7 +134,9 @@ export default class MessageEntrance extends Emiter {
this.sendStartClass = this._sendStartClass.bind(this);
this.sendPauseClass = this._sendPauseClass.bind(this);
this.sendCloseClass = this._sendCloseClass.bind(this);
this.changeHandUpStatus = this._changeHandUpStatus.bind(this);
this.changeHandUpStatus = this._changeHandUpStatus.bind(this);//自己切换举手状态
this.controlHandUpStatus = this._controlHandUpStatus.bind(this);//控制别人的举手状态
//录制回放
this.initRecordPlayback = this._initRecordPlayback.bind(this);
... ... @@ -969,6 +971,15 @@ export default class MessageEntrance extends Emiter {
_confer_ape.pauseClass(_param);
}
}
_controlHandUpStatus(_param){
if (!_mcu.connected) {
loger.warn(GlobalConfig.getCurrentStatus());
return {"code": ApeConsts.RETURN_FAILED, "data": ""};
}
if (_confer_ape) {
_confer_ape.controlHandUpStatus(_param);
}
}
_changeHandUpStatus(_param){
if (!_mcu.connected) {
loger.warn(GlobalConfig.getCurrentStatus());
... ...
... ... @@ -23,6 +23,7 @@ ApeConsts.CLASS_PAUSING = "class.update";//更新当前的状态信息
//课堂控制
ApeConsts.CLASS_ACTION_CLOSE_ALL=1;//所有人关闭课堂
ApeConsts.CLASS_ACTION_HANDUP_STATUS_CHANGE=2;//更改用户的举手状态
//课堂类型
ApeConsts.CLASS_TYPE_INTERACT= 1; // 互动课堂,通过MS转发音视频,不能进行H5观看
... ...
... ... @@ -169,7 +169,7 @@ class ConferApe extends Ape {
}
// to, message
loger.log('发送课堂消息.', _messageInfo);
loger.log('发送课堂控制消息.', _messageInfo);
/* message RCConferenceSendDataRequestPdu {
optional uint32 initiator = 1;
... ... @@ -191,11 +191,11 @@ class ConferApe extends Ape {
// if (!(conferSendPdu.isPublic || 0 === conferSendPdu.peer)) {
if (!conferSendPdu.isPublic && 0 != conferSendPdu.peer) {
//发送给制定的人
loger.log('发送私聊课堂消息.');
//loger.log('发送私聊课堂消息.');
this.send(conferSendPdu);
} else {
//发送给所有人
loger.log('发送公聊课堂消息.');
// loger.log('发送公聊课堂消息.');
this.sendChatUniform(conferSendPdu);
}
}
... ... @@ -386,6 +386,21 @@ class ConferApe extends Ape {
this.sendConferMsg({"to": 0, "message": "所有人退出课堂", "actionType": ApeConsts.CLASS_ACTION_CLOSE_ALL});
}
//控制举手状态
controlHandUpStatus(_param){
//控制用户的举手状态
if(!_param||!_param.nodeId){
loger.log('控制举手状态->失败->参数错误',_param);
return;
}
let msgObj={};
msgObj.nodeId=_param.nodeId;
msgObj.isHandUp=false;
if(_param&&_param.isHandUp==true){
msgObj.isHandUp=true;
}
this.sendConferMsg({"to":_param.nodeId, "message":JSON.stringify(msgObj), "actionType": ApeConsts.CLASS_ACTION_HANDUP_STATUS_CHANGE});
}
//切换举手状态
changeHandUpStatus(_param){
loger.log('切换举手状态->',_param);
... ... @@ -573,13 +588,25 @@ class ConferApe extends Ape {
chatMsg.toNodeID = chatReceivePdu.peer;
chatMsg.message = this._rCArrayBufferUtil.uint8ArrayToStr(chatReceivePdu.userData, 2);
chatMsg.actionType = chatReceivePdu.actionType;
loger.log("conferMsgComingHandler", chatMsg);
loger.log("conferMsgComingHandler", chatMsg);//{"fromNodeID":418883112,"toNodeID":0,"message":"所有人退出课堂","actionType":1}
switch (chatMsg.actionType) {
case ApeConsts.CLASS_ACTION_CLOSE_ALL:
loger.log(chatMsg.message);
//收到课堂关闭,所有人都退出,执行自己关闭的流程
this._emit(MessageTypes.CLASS_RUN_EXIT,{'type':1});
break;
case ApeConsts.CLASS_ACTION_HANDUP_STATUS_CHANGE:
console.log('chatMsg',chatMsg);
let msgObj=null;
try{
msgObj =JSON.parse(chatMsg.message);
if(msgObj&&msgObj.nodeId==GlobalConfig.nodeId){
this.changeHandUpStatus(msgObj);
}
}catch (err){
loger.warn('chatMsg->JSON数据解析失败');
}
break;
default:
break;
}
... ...