1.更换新的消息广播协议(会议、视频、音频、聊天)
2、文档模块把获取文档完整地址的接口分成 获取图片和获取PDF 两个接口
正在显示
9 个修改的文件
包含
71 行增加
和
31 行删除
| @@ -152,7 +152,8 @@ export default class MessageEntrance extends Emiter { | @@ -152,7 +152,8 @@ export default class MessageEntrance extends Emiter { | ||
| 152 | this.sendDocumentDelete = this._sassDeleteDocument;//删除文档,先通过Sass删除,sass删除成功之后再同步mcu | 152 | this.sendDocumentDelete = this._sassDeleteDocument;//删除文档,先通过Sass删除,sass删除成功之后再同步mcu |
| 153 | //this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档 | 153 | //this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档 |
| 154 | this.sendDocumentCommand = this._sendDocumentCommand;//操作文档(翻页、缩放、滚动...) | 154 | this.sendDocumentCommand = this._sendDocumentCommand;//操作文档(翻页、缩放、滚动...) |
| 155 | - this.getDocFullPath=this._getDocFullPath;//获取文档的完整路径 | 155 | + this.getDocImageFullPath=this._getDocImageFullPath;//获取文档图片的完整路径 |
| 156 | + this.getDocPDFFullPath=this._getDocPDFFullPath;//获取文档的完整路径 | ||
| 156 | } | 157 | } |
| 157 | 158 | ||
| 158 | 159 | ||
| @@ -869,12 +870,20 @@ export default class MessageEntrance extends Emiter { | @@ -869,12 +870,20 @@ export default class MessageEntrance extends Emiter { | ||
| 869 | 870 | ||
| 870 | //DocApe | 871 | //DocApe |
| 871 | //获取文档完整路径 | 872 | //获取文档完整路径 |
| 872 | - _getDocFullPath(_param){ | 873 | + _getDocImageFullPath(_param){ |
| 873 | if(_doc_ape){ | 874 | if(_doc_ape){ |
| 874 | - return _doc_ape.getDocFullPath(_param); | 875 | + return _doc_ape.getDocImageFullPath(_param); |
| 875 | }else { | 876 | }else { |
| 876 | loger.error("文档模块还没有创建,无法获取"); | 877 | loger.error("文档模块还没有创建,无法获取"); |
| 877 | - return ""; | 878 | + return []; |
| 879 | + } | ||
| 880 | + } | ||
| 881 | + _getDocPDFFullPath(_param){ | ||
| 882 | + if(_doc_ape){ | ||
| 883 | + return _doc_ape.getDocPDFFullPath(_param); | ||
| 884 | + }else { | ||
| 885 | + loger.error("文档模块还没有创建,无法获取"); | ||
| 886 | + return []; | ||
| 878 | } | 887 | } |
| 879 | } | 888 | } |
| 880 | //上传文档 | 889 | //上传文档 |
| @@ -13,11 +13,6 @@ class GlobalConfig { | @@ -13,11 +13,6 @@ class GlobalConfig { | ||
| 13 | } | 13 | } |
| 14 | _currentStatus=null; | 14 | _currentStatus=null; |
| 15 | 15 | ||
| 16 | - | ||
| 17 | - static setDebugData (_deBugData){ | ||
| 18 | - this.isDebug=true; | ||
| 19 | - this.deBugData=_deBugData; | ||
| 20 | - } | ||
| 21 | static getCurrentStatus(){ | 16 | static getCurrentStatus(){ |
| 22 | if(this._currentStatus==null){ | 17 | if(this._currentStatus==null){ |
| 23 | this._currentStatus=this.statusCode_0; | 18 | this._currentStatus=this.statusCode_0; |
| @@ -273,9 +268,6 @@ GlobalConfig.RecordServerPort =""; | @@ -273,9 +268,6 @@ GlobalConfig.RecordServerPort =""; | ||
| 273 | GlobalConfig.maxVideoChannels=0; | 268 | GlobalConfig.maxVideoChannels=0; |
| 274 | GlobalConfig.maxAudioChannels=0; | 269 | GlobalConfig.maxAudioChannels=0; |
| 275 | 270 | ||
| 276 | -GlobalConfig.isDebug=false; | ||
| 277 | -GlobalConfig.deBugData={}; | ||
| 278 | - | ||
| 279 | GlobalConfig.hasCamera=false;//摄像头是否可用 | 271 | GlobalConfig.hasCamera=false;//摄像头是否可用 |
| 280 | GlobalConfig.hasMicrophone=false;//麦克风是否可用 | 272 | GlobalConfig.hasMicrophone=false;//麦克风是否可用 |
| 281 | 273 |
| @@ -416,11 +416,11 @@ class Sass extends Emiter { | @@ -416,11 +416,11 @@ class Sass extends Emiter { | ||
| 416 | } | 416 | } |
| 417 | }) | 417 | }) |
| 418 | .then(ret => { | 418 | .then(ret => { |
| 419 | - if (ret.code === 0) { | 419 | + if (ret.errorCode === 0) { |
| 420 | loger.log('保存开始录制信息 完成'); | 420 | loger.log('保存开始录制信息 完成'); |
| 421 | this._emit(Sass.CLASS_SAVE_RECORD_INFO_SUCCESS, _param); | 421 | this._emit(Sass.CLASS_SAVE_RECORD_INFO_SUCCESS, _param); |
| 422 | } else { | 422 | } else { |
| 423 | - loger.warn('保存开始录制信息 失败.'); | 423 | + loger.warn('保存开始录制信息 失败.',ret); |
| 424 | } | 424 | } |
| 425 | }) | 425 | }) |
| 426 | .catch(err => { | 426 | .catch(err => { |
| @@ -29,7 +29,7 @@ class AudioApe extends Ape { | @@ -29,7 +29,7 @@ class AudioApe extends Ape { | ||
| 29 | this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.AUDIO_OBJ_TABLE_ID, ApeConsts.AUDIO_OBJ_TABLE_NAME, ApeConsts.AUDIO_OBJ_TABLE_TAG, 0, new ArrayBuffer); | 29 | this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.AUDIO_OBJ_TABLE_ID, ApeConsts.AUDIO_OBJ_TABLE_NAME, ApeConsts.AUDIO_OBJ_TABLE_TAG, 0, new ArrayBuffer); |
| 30 | 30 | ||
| 31 | // 广播消息,用户之间的消息传递 | 31 | // 广播消息,用户之间的消息传递 |
| 32 | - this.on(pdu.RCPDU_AUDIO_SEND_DATA_REQUEST, this.receiveAudiooCommandHandler.bind(this)); | 32 | + this.on(pdu.RCPDU_SEND_AUDIO_DATA_REQUEST, this.receiveAudiooCommandHandler.bind(this)); |
| 33 | } | 33 | } |
| 34 | //ape加入成功 | 34 | //ape加入成功 |
| 35 | onJoinChannelHandlerSuccess(){ | 35 | onJoinChannelHandlerSuccess(){ |
| @@ -162,7 +162,7 @@ class AudioApe extends Ape { | @@ -162,7 +162,7 @@ class AudioApe extends Ape { | ||
| 162 | 162 | ||
| 163 | 163 | ||
| 164 | let audioSendPdu = new pdu['RCAudioSendDataRequestPdu']; | 164 | let audioSendPdu = new pdu['RCAudioSendDataRequestPdu']; |
| 165 | - audioSendPdu.type = pdu.RCPDU_AUDIO_SEND_DATA_REQUEST; | 165 | + audioSendPdu.type = pdu.RCPDU_SEND_AUDIO_DATA_REQUEST; |
| 166 | audioSendPdu.isPublic = true; | 166 | audioSendPdu.isPublic = true; |
| 167 | 167 | ||
| 168 | audioSendPdu.fromNodeId = GlobalConfig.nodeId;//发起人 | 168 | audioSendPdu.fromNodeId = GlobalConfig.nodeId;//发起人 |
| @@ -35,7 +35,8 @@ class ChatApe extends Ape { | @@ -35,7 +35,8 @@ class ChatApe extends Ape { | ||
| 35 | ApeConsts.CHAT_OBJ_TABLE_NAME, ApeConsts.CHAT_OBJ_TABLE_TAG, 0, new ArrayBuffer); | 35 | ApeConsts.CHAT_OBJ_TABLE_NAME, ApeConsts.CHAT_OBJ_TABLE_TAG, 0, new ArrayBuffer); |
| 36 | 36 | ||
| 37 | // ape listeners | 37 | // ape listeners |
| 38 | - this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this)); | 38 | + //this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this)); |
| 39 | + this.on(pdu.RCPDU_SEND_CHAT_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this)); | ||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | sendChatMsg(_messageInfo) { | 42 | sendChatMsg(_messageInfo) { |
| @@ -52,7 +53,8 @@ class ChatApe extends Ape { | @@ -52,7 +53,8 @@ class ChatApe extends Ape { | ||
| 52 | loger.log('发送聊天消息.', _messageInfo.to, _messageInfo.message); | 53 | loger.log('发送聊天消息.', _messageInfo.to, _messageInfo.message); |
| 53 | 54 | ||
| 54 | let chatSendPdu = new pdu['RCChatSendDataRequestPdu']; | 55 | let chatSendPdu = new pdu['RCChatSendDataRequestPdu']; |
| 55 | - chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST; | 56 | + //chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST; |
| 57 | + chatSendPdu.type = pdu.RCPDU_SEND_CHAT_DATA_REQUEST; | ||
| 56 | chatSendPdu.initiator = this._classInfo.nodeId;//发起人 | 58 | chatSendPdu.initiator = this._classInfo.nodeId;//发起人 |
| 57 | chatSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id | 59 | chatSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id |
| 58 | 60 |
| @@ -54,7 +54,7 @@ class ConferApe extends Ape { | @@ -54,7 +54,7 @@ class ConferApe extends Ape { | ||
| 54 | 54 | ||
| 55 | this.on(pdu.RCPDU_SESSION_JOIN_RESPONSE, this._joinSessionHandler.bind(this)); | 55 | this.on(pdu.RCPDU_SESSION_JOIN_RESPONSE, this._joinSessionHandler.bind(this)); |
| 56 | 56 | ||
| 57 | - this.on(pdu.RCPDU_CONFERENCE_SEND_DATA_REQUEST, this.conferMsgComingHandler.bind(this));//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理 | 57 | + this.on(pdu.RCPDU_SEND_CONFERENCE_DATA_REQUEST, this.conferMsgComingHandler.bind(this));//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理 |
| 58 | this.on(pdu.RCPDU_CONFERENCE_RECORD_REQUEST,this.onSendConferRecordRequestHandler.bind(this));//发送录制和停止录制消息 | 58 | this.on(pdu.RCPDU_CONFERENCE_RECORD_REQUEST,this.onSendConferRecordRequestHandler.bind(this));//发送录制和停止录制消息 |
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -116,7 +116,7 @@ class ConferApe extends Ape { | @@ -116,7 +116,7 @@ class ConferApe extends Ape { | ||
| 116 | */ | 116 | */ |
| 117 | 117 | ||
| 118 | let conferSendPdu = new pdu['RCConferenceSendDataRequestPdu']; | 118 | let conferSendPdu = new pdu['RCConferenceSendDataRequestPdu']; |
| 119 | - conferSendPdu.type = pdu.RCPDU_CONFERENCE_SEND_DATA_REQUEST; | 119 | + conferSendPdu.type = pdu.RCPDU_SEND_CONFERENCE_DATA_REQUEST; |
| 120 | conferSendPdu.initiator = this._classInfo.nodeId;//发起人 | 120 | conferSendPdu.initiator = this._classInfo.nodeId;//发起人 |
| 121 | conferSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id | 121 | conferSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id |
| 122 | 122 |
| @@ -137,40 +137,70 @@ class DocApe extends Ape { | @@ -137,40 +137,70 @@ class DocApe extends Ape { | ||
| 137 | loger.log("发送更新文档.itemIdx="+tableItemPdu.itemIdx); | 137 | loger.log("发送更新文档.itemIdx="+tableItemPdu.itemIdx); |
| 138 | this.sendUniform(adapterPdu,true); | 138 | this.sendUniform(adapterPdu,true); |
| 139 | } | 139 | } |
| 140 | - //获取文档的完整地址 | ||
| 141 | - getDocFullPath(_param){ | 140 | + //获取文档的图片完整地址 |
| 141 | + getDocImageFullPath(_param){ | ||
| 142 | if(_param==null||_param.relativeUrl==null){ | 142 | if(_param==null||_param.relativeUrl==null){ |
| 143 | loger.warn('获取文档完整地址,传递的参数不对.',_param); | 143 | loger.warn('获取文档完整地址,传递的参数不对.',_param); |
| 144 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_JOIN_PARAM); | 144 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_JOIN_PARAM); |
| 145 | - return ""; | 145 | + return []; |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | let port = (GlobalConfig.DOCServerPort == "" || GlobalConfig.DOCServerPort == null) ? "":":" + GlobalConfig.DOCServerPort; | 148 | let port = (GlobalConfig.DOCServerPort == "" || GlobalConfig.DOCServerPort == null) ? "":":" + GlobalConfig.DOCServerPort; |
| 149 | let fullPath=GlobalConfig.DOCServerIP+port+_param.relativeUrl; | 149 | let fullPath=GlobalConfig.DOCServerIP+port+_param.relativeUrl; |
| 150 | - var index; | 150 | + if(fullPath&&fullPath.indexOf("http://")<0){ |
| 151 | + fullPath="http://"+fullPath; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + var fileType="jpg"; | ||
| 151 | switch (_param.type){ | 155 | switch (_param.type){ |
| 152 | case "jpg": | 156 | case "jpg": |
| 157 | + fileType="jpg"; | ||
| 153 | fullPath=this.replacePathType(fullPath)+".jpg"; | 158 | fullPath=this.replacePathType(fullPath)+".jpg"; |
| 154 | break; | 159 | break; |
| 155 | case "png": | 160 | case "png": |
| 161 | + fileType="png"; | ||
| 156 | fullPath=this.replacePathType(fullPath)+".png"; | 162 | fullPath=this.replacePathType(fullPath)+".png"; |
| 157 | break; | 163 | break; |
| 158 | - case "pdf": | ||
| 159 | - fullPath=this.replacePathType(fullPath)+".pdf"; | ||
| 160 | - break; | ||
| 161 | default : | 164 | default : |
| 162 | //不做处理,直接返回拼接的地址 | 165 | //不做处理,直接返回拼接的地址 |
| 163 | break; | 166 | break; |
| 164 | } | 167 | } |
| 165 | 168 | ||
| 169 | + if(_param.pageNum&&parseInt(_param.pageNum)>1){ | ||
| 170 | + //如果是多页的,需要返回序列 | ||
| 171 | + var lastIndex=fullPath.lastIndexOf("/"); | ||
| 172 | + if(lastIndex>0){ | ||
| 173 | + let newPath=fullPath.substr(0,lastIndex); | ||
| 174 | + let pathArr=[]; | ||
| 175 | + for(let i=1;i<_param.pageNum;i++){ | ||
| 176 | + pathArr.push(newPath+"/"+i+"."+fileType); | ||
| 177 | + } | ||
| 178 | + return pathArr; | ||
| 179 | + }else { | ||
| 180 | + return [fullPath]; | ||
| 181 | + } | ||
| 182 | + }else { | ||
| 183 | + return [fullPath]; | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + | ||
| 187 | + //获取文档的pdf完整地址 | ||
| 188 | + getDocPDFFullPath(_param){ | ||
| 189 | + if(_param==null||_param.relativeUrl==null){ | ||
| 190 | + loger.warn('获取文档完整地址,传递的参数不对.',_param); | ||
| 191 | + this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_JOIN_PARAM); | ||
| 192 | + return []; | ||
| 193 | + } | ||
| 194 | + let port = (GlobalConfig.DOCServerPort == "" || GlobalConfig.DOCServerPort == null) ? "":":" + GlobalConfig.DOCServerPort; | ||
| 195 | + let fullPath=GlobalConfig.DOCServerIP+port+_param.relativeUrl; | ||
| 166 | if(fullPath&&fullPath.indexOf("http://")<0){ | 196 | if(fullPath&&fullPath.indexOf("http://")<0){ |
| 167 | fullPath="http://"+fullPath; | 197 | fullPath="http://"+fullPath; |
| 168 | } | 198 | } |
| 169 | - loger.warn('getDocFullPath ->',fullPath); | 199 | + fullPath=this.replacePathType(fullPath)+".pdf"; |
| 170 | return [fullPath]; | 200 | return [fullPath]; |
| 171 | } | 201 | } |
| 172 | 202 | ||
| 173 | - // 去除文件的后缀格式名称 | 203 | + // 去除文件的后缀格式名称 |
| 174 | replacePathType(_path){ | 204 | replacePathType(_path){ |
| 175 | let path=_path; | 205 | let path=_path; |
| 176 | path=path.replace(/.jpg/g,""); | 206 | path=path.replace(/.jpg/g,""); |
| @@ -30,7 +30,7 @@ class VideoApe extends Ape { | @@ -30,7 +30,7 @@ class VideoApe extends Ape { | ||
| 30 | this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.VIDEO_OBJ_TABLE_ID, ApeConsts.VIDEO_OBJ_TABLE_NAME, ApeConsts.VIDEO_OBJ_TABLE_TAG, 0, new ArrayBuffer); | 30 | this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.VIDEO_OBJ_TABLE_ID, ApeConsts.VIDEO_OBJ_TABLE_NAME, ApeConsts.VIDEO_OBJ_TABLE_TAG, 0, new ArrayBuffer); |
| 31 | 31 | ||
| 32 | // videoApe 监听视频控制消息,用户之间的消息传递 | 32 | // videoApe 监听视频控制消息,用户之间的消息传递 |
| 33 | - this.on(pdu.RCPDU_VIDEO_SEND_DATA_REQUEST, this.receiveVideoCommandHandler.bind(this)); | 33 | + this.on(pdu.RCPDU_SEND_VIDEO_DATA_REQUEST, this.receiveVideoCommandHandler.bind(this)); |
| 34 | } | 34 | } |
| 35 | //ape加入成功 | 35 | //ape加入成功 |
| 36 | onJoinChannelHandlerSuccess(){ | 36 | onJoinChannelHandlerSuccess(){ |
| @@ -172,7 +172,7 @@ class VideoApe extends Ape { | @@ -172,7 +172,7 @@ class VideoApe extends Ape { | ||
| 172 | }*/ | 172 | }*/ |
| 173 | 173 | ||
| 174 | let videoSendPdu = new pdu['RCVideoSendDataRequestPdu']; | 174 | let videoSendPdu = new pdu['RCVideoSendDataRequestPdu']; |
| 175 | - videoSendPdu.type = pdu.RCPDU_VIDEO_SEND_DATA_REQUEST; | 175 | + videoSendPdu.type = pdu.RCPDU_SEND_VIDEO_DATA_REQUEST; |
| 176 | videoSendPdu.isPublic = true; | 176 | videoSendPdu.isPublic = true; |
| 177 | 177 | ||
| 178 | videoSendPdu.fromNodeId = GlobalConfig.nodeId;//发起人 | 178 | videoSendPdu.fromNodeId = GlobalConfig.nodeId;//发起人 |
| @@ -99,3 +99,10 @@ RCPduPackage.RCPDU_INDEX_SERVER_USERS = 301; | @@ -99,3 +99,10 @@ RCPduPackage.RCPDU_INDEX_SERVER_USERS = 301; | ||
| 99 | RCPduPackage.RCPDU_INDEX_CONFERENCE_USER_JOINED = 302; | 99 | RCPduPackage.RCPDU_INDEX_CONFERENCE_USER_JOINED = 302; |
| 100 | RCPduPackage.RCPDU_INDEX_CONFERENCE_USER_EXITED = 303; | 100 | RCPduPackage.RCPDU_INDEX_CONFERENCE_USER_EXITED = 303; |
| 101 | RCPduPackage.RCPDU_INDEX_CONFERENCE_USERS = 304; | 101 | RCPduPackage.RCPDU_INDEX_CONFERENCE_USERS = 304; |
| 102 | + | ||
| 103 | + | ||
| 104 | +RCPduPackage.RCPDU_SEND_CONFERENCE_DATA_REQUEST =500; | ||
| 105 | +RCPduPackage.RCPDU_SEND_VIDEO_DATA_REQUEST = 501; | ||
| 106 | +RCPduPackage.RCPDU_SEND_AUDIO_DATA_REQUEST = 502; | ||
| 107 | +RCPduPackage.RCPDU_SEND_GIFT_DATA_REQUEST = 503; | ||
| 108 | +RCPduPackage.RCPDU_SEND_CHAT_DATA_REQUEST = 504; |
-
请 注册 或 登录 后发表评论