diff --git a/src/EngineEntrance.js b/src/EngineEntrance.js
index e4e9236..56b0e3a 100644
--- a/src/EngineEntrance.js
+++ b/src/EngineEntrance.js
@@ -152,7 +152,8 @@ export default class MessageEntrance extends Emiter {
this.sendDocumentDelete = this._sassDeleteDocument;//删除文档,先通过Sass删除,sass删除成功之后再同步mcu
//this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档
this.sendDocumentCommand = this._sendDocumentCommand;//操作文档(翻页、缩放、滚动...)
- this.getDocFullPath=this._getDocFullPath;//获取文档的完整路径
+ this.getDocImageFullPath=this._getDocImageFullPath;//获取文档图片的完整路径
+ this.getDocPDFFullPath=this._getDocPDFFullPath;//获取文档的完整路径
}
@@ -869,12 +870,20 @@ export default class MessageEntrance extends Emiter {
//DocApe
//获取文档完整路径
- _getDocFullPath(_param){
+ _getDocImageFullPath(_param){
if(_doc_ape){
- return _doc_ape.getDocFullPath(_param);
+ return _doc_ape.getDocImageFullPath(_param);
}else {
loger.error("文档模块还没有创建,无法获取");
- return "";
+ return [];
+ }
+ }
+ _getDocPDFFullPath(_param){
+ if(_doc_ape){
+ return _doc_ape.getDocPDFFullPath(_param);
+ }else {
+ loger.error("文档模块还没有创建,无法获取");
+ return [];
}
}
//上传文档
diff --git a/src/GlobalConfig.js b/src/GlobalConfig.js
index cf44816..cdc2407 100644
--- a/src/GlobalConfig.js
+++ b/src/GlobalConfig.js
@@ -13,11 +13,6 @@ class GlobalConfig {
}
_currentStatus=null;
-
- static setDebugData (_deBugData){
- this.isDebug=true;
- this.deBugData=_deBugData;
- }
static getCurrentStatus(){
if(this._currentStatus==null){
this._currentStatus=this.statusCode_0;
@@ -273,9 +268,6 @@ GlobalConfig.RecordServerPort ="";
GlobalConfig.maxVideoChannels=0;
GlobalConfig.maxAudioChannels=0;
-GlobalConfig.isDebug=false;
-GlobalConfig.deBugData={};
-
GlobalConfig.hasCamera=false;//摄像头是否可用
GlobalConfig.hasMicrophone=false;//麦克风是否可用
diff --git a/src/Sass.js b/src/Sass.js
index 60d086e..055b9b6 100644
--- a/src/Sass.js
+++ b/src/Sass.js
@@ -416,11 +416,11 @@ class Sass extends Emiter {
}
})
.then(ret => {
- if (ret.code === 0) {
+ if (ret.errorCode === 0) {
loger.log('保存开始录制信息 完成');
this._emit(Sass.CLASS_SAVE_RECORD_INFO_SUCCESS, _param);
} else {
- loger.warn('保存开始录制信息 失败.');
+ loger.warn('保存开始录制信息 失败.',ret);
}
})
.catch(err => {
diff --git a/src/apes/AudioApe.js b/src/apes/AudioApe.js
index 6997084..8cf66a3 100644
--- a/src/apes/AudioApe.js
+++ b/src/apes/AudioApe.js
@@ -29,7 +29,7 @@ class AudioApe extends Ape {
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);
// 广播消息,用户之间的消息传递
- this.on(pdu.RCPDU_AUDIO_SEND_DATA_REQUEST, this.receiveAudiooCommandHandler.bind(this));
+ this.on(pdu.RCPDU_SEND_AUDIO_DATA_REQUEST, this.receiveAudiooCommandHandler.bind(this));
}
//ape加入成功
onJoinChannelHandlerSuccess(){
@@ -162,7 +162,7 @@ class AudioApe extends Ape {
let audioSendPdu = new pdu['RCAudioSendDataRequestPdu'];
- audioSendPdu.type = pdu.RCPDU_AUDIO_SEND_DATA_REQUEST;
+ audioSendPdu.type = pdu.RCPDU_SEND_AUDIO_DATA_REQUEST;
audioSendPdu.isPublic = true;
audioSendPdu.fromNodeId = GlobalConfig.nodeId;//发起人
diff --git a/src/apes/ChatApe.js b/src/apes/ChatApe.js
index 64c86aa..7773273 100644
--- a/src/apes/ChatApe.js
+++ b/src/apes/ChatApe.js
@@ -35,7 +35,8 @@ class ChatApe extends Ape {
ApeConsts.CHAT_OBJ_TABLE_NAME, ApeConsts.CHAT_OBJ_TABLE_TAG, 0, new ArrayBuffer);
// ape listeners
- this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this));
+ //this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this));
+ this.on(pdu.RCPDU_SEND_CHAT_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this));
}
sendChatMsg(_messageInfo) {
@@ -52,7 +53,8 @@ class ChatApe extends Ape {
loger.log('发送聊天消息.', _messageInfo.to, _messageInfo.message);
let chatSendPdu = new pdu['RCChatSendDataRequestPdu'];
- chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST;
+ //chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST;
+ chatSendPdu.type = pdu.RCPDU_SEND_CHAT_DATA_REQUEST;
chatSendPdu.initiator = this._classInfo.nodeId;//发起人
chatSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id
diff --git a/src/apes/ConferApe.js b/src/apes/ConferApe.js
index 31453e6..15b6313 100644
--- a/src/apes/ConferApe.js
+++ b/src/apes/ConferApe.js
@@ -54,7 +54,7 @@ class ConferApe extends Ape {
this.on(pdu.RCPDU_SESSION_JOIN_RESPONSE, this._joinSessionHandler.bind(this));
- this.on(pdu.RCPDU_CONFERENCE_SEND_DATA_REQUEST, this.conferMsgComingHandler.bind(this));//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理
+ this.on(pdu.RCPDU_SEND_CONFERENCE_DATA_REQUEST, this.conferMsgComingHandler.bind(this));//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理
this.on(pdu.RCPDU_CONFERENCE_RECORD_REQUEST,this.onSendConferRecordRequestHandler.bind(this));//发送录制和停止录制消息
}
@@ -116,7 +116,7 @@ class ConferApe extends Ape {
*/
let conferSendPdu = new pdu['RCConferenceSendDataRequestPdu'];
- conferSendPdu.type = pdu.RCPDU_CONFERENCE_SEND_DATA_REQUEST;
+ conferSendPdu.type = pdu.RCPDU_SEND_CONFERENCE_DATA_REQUEST;
conferSendPdu.initiator = this._classInfo.nodeId;//发起人
conferSendPdu.peer = parseInt(_messageInfo.to);//发送给谁,公聊的时候是0,私聊的时候是指定的用户id
diff --git a/src/apes/DocApe.js b/src/apes/DocApe.js
index 765b8e6..1f7fa2d 100644
--- a/src/apes/DocApe.js
+++ b/src/apes/DocApe.js
@@ -137,40 +137,70 @@ class DocApe extends Ape {
loger.log("发送更新文档.itemIdx="+tableItemPdu.itemIdx);
this.sendUniform(adapterPdu,true);
}
- //获取文档的完整地址
- getDocFullPath(_param){
+ //获取文档的图片完整地址
+ getDocImageFullPath(_param){
if(_param==null||_param.relativeUrl==null){
loger.warn('获取文档完整地址,传递的参数不对.',_param);
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_JOIN_PARAM);
- return "";
+ return [];
}
let port = (GlobalConfig.DOCServerPort == "" || GlobalConfig.DOCServerPort == null) ? "":":" + GlobalConfig.DOCServerPort;
let fullPath=GlobalConfig.DOCServerIP+port+_param.relativeUrl;
- var index;
+ if(fullPath&&fullPath.indexOf("http://")<0){
+ fullPath="http://"+fullPath;
+ }
+
+ var fileType="jpg";
switch (_param.type){
case "jpg":
+ fileType="jpg";
fullPath=this.replacePathType(fullPath)+".jpg";
break;
case "png":
+ fileType="png";
fullPath=this.replacePathType(fullPath)+".png";
break;
- case "pdf":
- fullPath=this.replacePathType(fullPath)+".pdf";
- break;
default :
//不做处理,直接返回拼接的地址
break;
}
+ if(_param.pageNum&&parseInt(_param.pageNum)>1){
+ //如果是多页的,需要返回序列
+ var lastIndex=fullPath.lastIndexOf("/");
+ if(lastIndex>0){
+ let newPath=fullPath.substr(0,lastIndex);
+ let pathArr=[];
+ for(let i=1;i<_param.pageNum;i++){
+ pathArr.push(newPath+"/"+i+"."+fileType);
+ }
+ return pathArr;
+ }else {
+ return [fullPath];
+ }
+ }else {
+ return [fullPath];
+ }
+ }
+
+ //获取文档的pdf完整地址
+ getDocPDFFullPath(_param){
+ if(_param==null||_param.relativeUrl==null){
+ loger.warn('获取文档完整地址,传递的参数不对.',_param);
+ this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_JOIN_PARAM);
+ return [];
+ }
+ let port = (GlobalConfig.DOCServerPort == "" || GlobalConfig.DOCServerPort == null) ? "":":" + GlobalConfig.DOCServerPort;
+ let fullPath=GlobalConfig.DOCServerIP+port+_param.relativeUrl;
if(fullPath&&fullPath.indexOf("http://")<0){
fullPath="http://"+fullPath;
}
- loger.warn('getDocFullPath ->',fullPath);
+ fullPath=this.replacePathType(fullPath)+".pdf";
return [fullPath];
}
- // 去除文件的后缀格式名称
+ // 去除文件的后缀格式名称
replacePathType(_path){
let path=_path;
path=path.replace(/.jpg/g,"");
diff --git a/src/apes/VideoApe.js b/src/apes/VideoApe.js
index 2999154..28169fa 100644
--- a/src/apes/VideoApe.js
+++ b/src/apes/VideoApe.js
@@ -30,7 +30,7 @@ class VideoApe extends Ape {
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);
// videoApe 监听视频控制消息,用户之间的消息传递
- this.on(pdu.RCPDU_VIDEO_SEND_DATA_REQUEST, this.receiveVideoCommandHandler.bind(this));
+ this.on(pdu.RCPDU_SEND_VIDEO_DATA_REQUEST, this.receiveVideoCommandHandler.bind(this));
}
//ape加入成功
onJoinChannelHandlerSuccess(){
@@ -172,7 +172,7 @@ class VideoApe extends Ape {
}*/
let videoSendPdu = new pdu['RCVideoSendDataRequestPdu'];
- videoSendPdu.type = pdu.RCPDU_VIDEO_SEND_DATA_REQUEST;
+ videoSendPdu.type = pdu.RCPDU_SEND_VIDEO_DATA_REQUEST;
videoSendPdu.isPublic = true;
videoSendPdu.fromNodeId = GlobalConfig.nodeId;//发起人
diff --git a/src/pdus/PduType.js b/src/pdus/PduType.js
index 4b2d222..e228cee 100644
--- a/src/pdus/PduType.js
+++ b/src/pdus/PduType.js
@@ -99,3 +99,10 @@ RCPduPackage.RCPDU_INDEX_SERVER_USERS = 301;
RCPduPackage.RCPDU_INDEX_CONFERENCE_USER_JOINED = 302;
RCPduPackage.RCPDU_INDEX_CONFERENCE_USER_EXITED = 303;
RCPduPackage.RCPDU_INDEX_CONFERENCE_USERS = 304;
+
+
+RCPduPackage.RCPDU_SEND_CONFERENCE_DATA_REQUEST =500;
+RCPduPackage.RCPDU_SEND_VIDEO_DATA_REQUEST = 501;
+RCPduPackage.RCPDU_SEND_AUDIO_DATA_REQUEST = 502;
+RCPduPackage.RCPDU_SEND_GIFT_DATA_REQUEST = 503;
+RCPduPackage.RCPDU_SEND_CHAT_DATA_REQUEST = 504;
\ No newline at end of file