李勇

1.录制回放增加伴音模块;2.mcu根据https切换为ws或wss;3.使用https时所有80端口都替换掉,不使用

... ... @@ -58,16 +58,21 @@ export default class MessageEntrance extends Emiter {
constructor() {
super();
//sdk 信息
GlobalConfig.sdkVersion = "v1.68.2.20170812";
GlobalConfig.sdkVersion = "v1.70.5.20170812";
loger.warn("sdkVersion:" + GlobalConfig.sdkVersion);
//设置
let locationProtocol= location.protocol;
if(locationProtocol!="https:"){
GlobalConfig.locationProtocol="http://";
}else {
if(locationProtocol=="https:"){
GlobalConfig.isHttps=true;
GlobalConfig.locationProtocol="https://";
GlobalConfig.websocketProtocol="wss://";
}else {
GlobalConfig.isHttps=false;
GlobalConfig.locationProtocol="http://";
GlobalConfig.websocketProtocol="ws://";
}
loger.warn("protocol:" + GlobalConfig.locationProtocol);
//获取设备和系统信息
SystemConfig.getSystemInfo();
... ... @@ -496,7 +501,12 @@ export default class MessageEntrance extends Emiter {
//保存参数
GlobalConfig.isRecordPlayBack = false; //设置为非录制回放状态
GlobalConfig.classId = parseInt(_param.classId);
GlobalConfig.portal = _param.portal;
GlobalConfig.portal = _param.portal||"";
if(GlobalConfig.isHttps==true){
//https的时候替换所有80端口
GlobalConfig.portal= GlobalConfig.portal.replace(":80","");
}
GlobalConfig.userId = _param.userId || "0";
//H5处理
GlobalConfig.isH5 = _param.isH5 || false;//外部传入的参数,是否是H5
... ... @@ -2279,7 +2289,12 @@ export default class MessageEntrance extends Emiter {
//保存参数
GlobalConfig.isRecordPlayBack = true; //设置为录制回放状态
GlobalConfig.classId = parseInt(_param.classId);
GlobalConfig.portal = _param.portal;
GlobalConfig.portal = _param.portal||"";
if(GlobalConfig.isHttps==true){
//https的时候替换所有80端口
GlobalConfig.portal= GlobalConfig.portal.replace(":80","");
}
GlobalConfig.userRole = ApeConsts.normal; //*************很重要,录制回放的时候,身份模式是普通人********
GlobalConfig.userId = _param.userId || "0";
GlobalConfig.userName = _param.userName || "";
... ... @@ -2330,6 +2345,12 @@ export default class MessageEntrance extends Emiter {
if (_video_ape) {
_video_ape.clearData();
}
if (_mediaShareApe) {
_mediaShareApe.clearData();
}
if (_musicShareApe) {
_musicShareApe.clearData();
}
}
//录制回放加入 课堂成功
... ...
... ... @@ -14,6 +14,8 @@
import Emiter from 'Emiter';
import Loger from 'Loger';
import GlobalConfig from 'GlobalConfig';
let loger = Loger.getLoger('EverSocket');
const MCU_MAX_RECONNECTION = 4;//最多重连次数
class EverSocket extends Emiter {
... ... @@ -33,7 +35,8 @@ class EverSocket extends Emiter {
loger.error('开始MCU连接->MCU连接地址无效');
}
this._enableEverSocket = true;
this.wsURL = 'ws://' + ip + ':' + port;
//this.wsURL = 'ws://' + ip + ':' + port;
this.wsURL = GlobalConfig.websocketProtocol + ip + ':' + port;
this._newConnection();
}
... ... @@ -42,10 +45,15 @@ class EverSocket extends Emiter {
this._clear();
}
switchSocketIp(ip,port) {
if(port){
/* if(port){
this.wsURL = 'ws://' + ip + ':' + port;
}else {
this.wsURL = 'ws://' + ip;
}*/
if(port){
this.wsURL = GlobalConfig.websocketProtocol + ip + ':' + port;
}else {
this.wsURL = GlobalConfig.websocketProtocol + ip;
}
}
get connected() {
... ...
... ... @@ -352,7 +352,7 @@ GlobalConfig.messageDelay = false; //是否启用消息延迟
GlobalConfig.mcuDelay = 0; //默认的延迟时间(单位-秒)
GlobalConfig.docDelay = 1600; //文档模块加入成功之后延迟发送送成功的消息给主模块(sdk内部使用)
GlobalConfig.portal = "112.126.80.182:80"; //Sass IP
GlobalConfig.portal = ""; //Sass IP
//从Sass获取的
GlobalConfig.country = ""; //国家
... ... @@ -535,5 +535,7 @@ GlobalConfig.explorerVersion="未知";//浏览器版本
GlobalConfig.os="未知";//系统
GlobalConfig.locationProtocol="http://";//https;或http:
GlobalConfig.websocketProtocol="ws://";//wss或ws
GlobalConfig.isHttps=false;//是否是https
export default GlobalConfig;
... ...
... ... @@ -41,6 +41,7 @@ class RecordPlayBackParse extends Emiter {
this._docApeMssages = {};//文档数据
this._whiteApeMssages = {};//白板数据
this._mediaShareApeMssages={};//媒体共享
this._musicShareApeMssages={};//伴音媒体共享
this._timerCounter = new TimerCounter();//计时器
this._timerCounter.addTimerCallBack(this._timerCounterUptate.bind(this), 1);
}
... ... @@ -171,6 +172,9 @@ class RecordPlayBackParse extends Emiter {
case ApeConsts.MEDIA_SESSION_ID:
this.saveParseData(data, timestamp, this._mediaShareApeMssages);
break;
case ApeConsts.MUSIC_SESSION_ID:
this.saveParseData(data, timestamp, this._musicShareApeMssages);
break;
case ApeConsts.WHITEBOARD_SESSION_ID:
this.saveParseData(data, timestamp, this._whiteApeMssages);
break;
... ... @@ -235,7 +239,8 @@ class RecordPlayBackParse extends Emiter {
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._conferApeMssages,"conferApe");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._chatApeMssages,"chatApe");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._docApeMssages,"docApe");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._mediaShareApeMssages,"mediaShareApe")
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._mediaShareApeMssages,"mediaShareApe");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._musicShareApeMssages,"musicShareApe");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._whiteApeMssages,"whiteApe");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._videoApeMssages,"videoAp");
this._searchMessageFromTime(this._recordPlaybackTimestamp, this._audioApeMssages,"audioApe");
... ... @@ -319,7 +324,9 @@ class RecordPlayBackParse extends Emiter {
}
GlobalConfig.recordPlaybackMaxTime = this._recordPlaybackMaxTime;
console.log('MediaChannleList',this.mediaChannleList);
console.log('音视频通话模块数据',this.mediaChannleList);
console.log('媒体共享模块数据',this._mediaShareApeMssages);
console.log('伴音模块数据',this._musicShareApeMssages);
loger.log("录制回放数据解析完成,录制回放的总时间长为->", this._recordPlaybackMaxTime);
this._emit(RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS, {"recordPlaybackMaxTime": this._recordPlaybackMaxTime});
}
... ... @@ -403,6 +410,9 @@ class RecordPlayBackParse extends Emiter {
//媒体共享模块
this.searchMediaShareApeMessageKeyfram(this._mediaShareApeMssages);
//伴音共享模块
this.searchMusicShareApeMessageKeyfram(this._musicShareApeMssages);
//聊天模块、白板标注模块的比较特殊,消息是累计的,默认最多30条
this._searchChatHistoryMessageKeyfram(this._chatApeMssages, ApeConsts.CHAT_SESSION_ID);
this._searchWhiteboradHistoryMessageKeyfram(this._whiteApeMssages, ApeConsts.WHITEBOARD_SESSION_ID);
... ... @@ -486,6 +496,28 @@ class RecordPlayBackParse extends Emiter {
loger.log("SEEK->APE->媒体共享", this._recordPlaybackTimestamp, "没有查找到相连的数据");
}
//伴音共享模块查找关键帧时间戳的消息
searchMusicShareApeMessageKeyfram(_apeMessages){
if(!_apeMessages){
return;
}
let messageItem;
let keyFrameSeekTime = 0;
for (let i = this._recordPlaybackTimestamp; i > 0; i--) {
messageItem = _apeMessages[i];
if (messageItem) {
keyFrameSeekTime = (this._recordPlaybackTimestamp - i)
loger.log("SEEK->APE",'伴音共享',this._recordPlaybackTimestamp, "查找到相连的timestamp->", i, '需要seek->', keyFrameSeekTime, "秒");
//把时间点对应的数据发送,同一秒内有存在多个数据的情况
for (let k = 0; k < messageItem.length; k++) {
this._everSocketMsgReceivedHandler(messageItem[k].byteData, keyFrameSeekTime);
}
return;
}
}
loger.log("SEEK->APE->伴音共享", this._recordPlaybackTimestamp, "没有查找到相连的数据");
}
//查找聊天模块ape关键帧数据,聊天模块比较特殊,消息是累积的,当前时间戳之前的都需要显示
_searchChatHistoryMessageKeyfram(_apeMessages) {
if(!_apeMessages){
... ...
... ... @@ -42,7 +42,7 @@ class DocApe extends Ape {
//上传文档
documentUpload(paramInfo) {
if (paramInfo == null || EngineUtils.isEmptyObject(paramInfo)) {
loger.warn('上传文档->失败->参数错误->',paramInfo);
loger.warn('上传文档->失败->参数错误->', paramInfo);
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
return;
}
... ... @@ -133,84 +133,91 @@ class DocApe extends Ape {
//loger.log("发送更新文档.itemIdx=" + tableItemPdu.itemIdx);
this.sendUniform(adapterPdu, true);
}
//获取文档的完整地址和所有图片
getDocFullAddress(_param){
if (_param == null || _param.url == null || _param.itemIdx ==null) {
getDocFullAddress(_param) {
if (_param == null || _param.url == null || _param.itemIdx == null) {
loger.warn('获取文档完整地址->传递的参数不正确->', _param);
return {"code":ApeConsts.RETURN_FAILED, "data": "获取文档时传递的参数不对"};
}
let fullPath='';//文档路径地址
let pageNum=1;//总页数
let docType="";//文档地址的后缀类型
let fileType="";//文档的原始类型
let docItem=this.docList[_param.itemIdx];
if(docItem){
fullPath=docItem.url||"";
pageNum=docItem.pageNum||1;
fileType=docItem.fileType||""
}else {
fullPath =_param.url;
return {"code": ApeConsts.RETURN_FAILED, "data": "获取文档时传递的参数不对"};
}
let fullPath = '';//文档路径地址
let pageNum = 1;//总页数
let docType = "";//文档地址的后缀类型
let fileType = "";//文档的原始类型
let docItem = this.docList[_param.itemIdx];
if (docItem) {
fullPath = docItem.url || "";
pageNum = docItem.pageNum || 1;
fileType = docItem.fileType || ""
} else {
fullPath = _param.url;
}
//替换地址的协议头,如果地址栏是https开头就换成https
fullPath = fullPath.replace("http://", GlobalConfig.locationProtocol);
//获取当前文档的后缀名
docType=this._getDocType(fullPath);
let substrFullPath=this._getDocPath(fullPath);//获取去掉后缀和文件名的地址,需要获取同目录下其他文件
let imagesArr=[];
let htmlPath="";
let pdfPath="";
docType = this._getDocType(fullPath);
let substrFullPath = this._getDocPath(fullPath);//获取去掉后缀和文件名的地址,需要获取同目录下其他文件
let imagesArr = [];
let htmlPath = "";
let pdfPath = "";
//根据文件后缀名,生成对应的访问地址
if(docType=="jpg"||docType=="png"||docType=="swf"||docType=="pdf"||docType=="doc"||docType=="pptx"){
if (docType == "jpg" || docType == "png" || docType == "swf" || docType == "pdf" || docType == "doc" || docType == "pptx") {
//页数从1开始
for (let i = 1; i <=pageNum; i++) {
for (let i = 1; i <= pageNum; i++) {
imagesArr.push(substrFullPath + "/" + i + ".jpg");
}
}
if(docType=="swf"||docType=="pdf"||docType=="doc"||docType=="pptx"){
pdfPath=fullPath.replace(/\.swf/g, ".pdf")||"";
if (docType == "swf" || docType == "pdf" || docType == "doc" || docType == "pptx") {
pdfPath = fullPath.replace(/\.swf/g, ".pdf") || "";
}
//动态PPT
if(docType=="html"){
htmlPath=fullPath;
if (docType == "html") {
htmlPath = fullPath;
}
//返回文档第所有地址
return {'code':ApeConsts.RETURN_SUCCESS, 'data': '','docFullAddress':{
'images':imagesArr,
'pdf':pdfPath,
'html':htmlPath
}};
return {
'code': ApeConsts.RETURN_SUCCESS, 'data': '', 'docFullAddress': {
'images': imagesArr,
'pdf': pdfPath,
'html': htmlPath
}
};
}
_getDocType(_fullPath){
if(!_fullPath){
_getDocType(_fullPath) {
if (!_fullPath) {
return "";
}
if(_fullPath.lastIndexOf(".jpg")>=0){
if (_fullPath.lastIndexOf(".jpg") >= 0) {
return "jpg";
}
if(_fullPath.lastIndexOf(".png")>=0){
if (_fullPath.lastIndexOf(".png") >= 0) {
return "png";
}
if(_fullPath.lastIndexOf(".swf")>=0){
if (_fullPath.lastIndexOf(".swf") >= 0) {
return "swf";
}
if(_fullPath.lastIndexOf(".pdf")>=0){
if (_fullPath.lastIndexOf(".pdf") >= 0) {
return "pdf";
}
if(_fullPath.lastIndexOf(".doc")>=0){
if (_fullPath.lastIndexOf(".doc") >= 0) {
return "doc";
}
if(_fullPath.lastIndexOf(".html")>=0){
if (_fullPath.lastIndexOf(".html") >= 0) {
return "html";
}
if(_fullPath.lastIndexOf(".pptx")>=0){
if (_fullPath.lastIndexOf(".pptx") >= 0) {
return "pptx";
}
return "";
}
//获取去掉文件名和后缀名的地址 http://www.xxx.xxx/image/aa.jpg -->http://www.xxx.xxx/image/
_getDocPath(_fullPath){
if(!_fullPath){
_getDocPath(_fullPath) {
if (!_fullPath) {
return "";
}
var lastIndex = _fullPath.lastIndexOf("/");
... ... @@ -222,7 +229,8 @@ class DocApe extends Ape {
//获取文档的图片完整地址
getDocImageFullPath(_param) {
if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") {
return [];
/*if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") {
loger.warn('获取文档完整地址,传递的参数不对.', _param);
return [];
}
... ... @@ -264,11 +272,13 @@ class DocApe extends Ape {
}
} else {
return [fullPath];
}
}*/
}
//获取文档的pdf完整地址
getDocPDFFullPath(_param) {
return [];
/*
if (_param == null || _param.relativeUrl == null || _param.relativeUrl == "") {
loger.warn('获取文档完整地址,传递的参数不对.', _param);
return [];
... ... @@ -279,7 +289,7 @@ class DocApe extends Ape {
fullPath = "http://" + fullPath;
}
fullPath = this.replacePathType(fullPath) + ".pdf";
return [fullPath];
return [fullPath];*/
}
// 去除文件的后缀格式名称
... ... @@ -293,24 +303,25 @@ class DocApe extends Ape {
}
//组织完整的文档信息,包含上传时的信息和转换后的完整地址信息
_docPackFullInfo(_itemDataInfo){
let itemDataInfo=_itemDataInfo;
let getDocAddress=this.getDocFullAddress(_itemDataInfo);
_docPackFullInfo(_itemDataInfo) {
let itemDataInfo = _itemDataInfo;
let getDocAddress = this.getDocFullAddress(_itemDataInfo);
//loger.log('docPackFullInfo->', itemDataInfo);
if(getDocAddress.code==ApeConsts.RETURN_SUCCESS){
itemDataInfo.images=getDocAddress.docFullAddress.images||[];
itemDataInfo.pdf=getDocAddress.docFullAddress.pdf||"";
itemDataInfo.html=getDocAddress.docFullAddress.html||"";
}else {
itemDataInfo.images=[];
itemDataInfo.pdf='';
itemDataInfo.html='';
if (getDocAddress.code == ApeConsts.RETURN_SUCCESS) {
itemDataInfo.images = getDocAddress.docFullAddress.images || [];
itemDataInfo.pdf = getDocAddress.docFullAddress.pdf || "";
itemDataInfo.html = getDocAddress.docFullAddress.html || "";
} else {
itemDataInfo.images = [];
itemDataInfo.pdf = '';
itemDataInfo.html = '';
}
return itemDataInfo;
}
//更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次
updaterRecordApeStatus(_param){
updaterRecordApeStatus(_param) {
/* if(GlobalConfig.isHost&&!GlobalConfig.isRecordPlayBack&&GlobalConfig.activeDocId>0){
loger.log("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage);
this.documentSwitchPage({
... ... @@ -318,20 +329,22 @@ class DocApe extends Ape {
"curPageNo":GlobalConfig.activeDocCurPage
});
}*/
loger.warn("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage);
loger.warn("录制状态发送改变->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:', GlobalConfig.activeDocCurPage);
this.documentSwitchPage({
"itemIdx": GlobalConfig.activeDocId,
"curPageNo":GlobalConfig.activeDocCurPage
"curPageNo": GlobalConfig.activeDocCurPage
});
}
//清除当前文档模块的数据
clearData(){
clearData() {
loger.log("clearData->")
this.docList={};
GlobalConfig.activeDocId=0;
GlobalConfig.activeDocCurPage=1;
this.docList = {};
GlobalConfig.activeDocId = 0;
GlobalConfig.activeDocCurPage = 1;
}
//切换文档
documentSwitchDoc(paramInfo) {
loger.log('切换文档->', paramInfo);
... ... @@ -358,7 +371,7 @@ class DocApe extends Ape {
if (oldDocModel) {
oldDocModel.action = ApeConsts.DOC_ACTION_NORMAL;
oldDocModel.visible = false;//设置为不可见
oldDocModel.animationStep=1;//切换文档之后动画步数还原
oldDocModel.animationStep = 1;//切换文档之后动画步数还原
}
}
... ... @@ -373,7 +386,7 @@ class DocApe extends Ape {
//更新当前选择的文档数据的字段
docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_DOC;
docDataModel.visible = paramInfo.visible || false;//默认是false
docDataModel.animationStep=1;//切换文档之后动画步数还原
docDataModel.animationStep = 1;//切换文档之后动画步数还原
//loger.log('切换文档,当前文档和上一个显示的文档都需要更新状态');
loger.log({"oldDoc": oldDocModel, "nowDoc": docDataModel});
... ... @@ -389,7 +402,7 @@ class DocApe extends Ape {
//文档翻页
documentSwitchPage(paramInfo) {
loger.log('文档翻页->',paramInfo);
loger.log('文档翻页->', paramInfo);
//获取已经存在的数据
let docDataModel = this.docList[paramInfo.itemIdx];
//console.log(docDataModelPdu);
... ... @@ -402,7 +415,7 @@ class DocApe extends Ape {
//更新数据的字段
docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_PAGE;
docDataModel.curPageNo = parseInt(paramInfo.curPageNo) || 1;
docDataModel.animationStep=1;//切换文档之后动画步数还原
docDataModel.animationStep = 1;//切换文档之后动画步数还原
if (docDataModel.curPageNo < 1) {
docDataModel.curPageNo = 1;//默认值最小是1
}
... ... @@ -411,25 +424,25 @@ class DocApe extends Ape {
//文档动画切换
documentSwitchAnimation(paramInfo) {
loger.log('文档页面动画切换->',paramInfo);
loger.log('文档页面动画切换->', paramInfo);
//获取已经存在的数据
let docDataModel = this.docList[GlobalConfig.activeDocId];
if (docDataModel == null) {
loger.log('文档页面动画切换->文档不存在',GlobalConfig.activeDocId, paramInfo);
loger.log('文档页面动画切换->文档不存在', GlobalConfig.activeDocId, paramInfo);
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
return;
}
//更新数据的字段
docDataModel.action = ApeConsts.DOC_ACTION_SWITCH_ANIMATION;
docDataModel.animationStep=docDataModel.animationStep||1;//最少步骤是1
if(paramInfo&&paramInfo.step==-1){
docDataModel.animationStep = docDataModel.animationStep || 1;//最少步骤是1
if (paramInfo && paramInfo.step == -1) {
//上一个
docDataModel.animationStep--;
}else{
} else {
//下一个
docDataModel.animationStep++;
}
if (!docDataModel.animationStep||docDataModel.animationStep < 1) {
if (!docDataModel.animationStep || docDataModel.animationStep < 1) {
docDataModel.animationStep = 1;//默认值最小是1
}
this.updaterDoc(docDataModel, docDataModel.itemIdx);
... ... @@ -466,9 +479,9 @@ class DocApe extends Ape {
//更新数据的字段
docDataModel.action = ApeConsts.DOC_ACTION_COMMAND;
docDataModel.showType = parseInt(paramInfo.showType) || 0;//0;//完整显示;1;//按宽度显示;2;//按高度显示
docDataModel.curV= parseInt(paramInfo.curV) || 0;//垂直方向的滚动条进度百分比 0-100
docDataModel.curH= parseInt(paramInfo.curH) || 0;//水平方向的滚动条进度百分比 0-100
docDataModel.scale= parseInt(paramInfo.scale) || 100;//文档缩放百分比 0-100
docDataModel.curV = parseInt(paramInfo.curV) || 0;//垂直方向的滚动条进度百分比 0-100
docDataModel.curH = parseInt(paramInfo.curH) || 0;//水平方向的滚动条进度百分比 0-100
docDataModel.scale = parseInt(paramInfo.scale) || 100;//文档缩放百分比 0-100
this.updaterDoc(docDataModel, docDataModel.itemIdx);
}
... ... @@ -530,28 +543,29 @@ class DocApe extends Ape {
this.documentSwitchDoc(paramInfo);
}*/
}
//添加文档
tableInsertApeHandler(_tableUpdateItems, _seekTime) {
let tableInsertItems =_tableUpdateItems;
let tableInsertItems = _tableUpdateItems;
let tableInsertItemsLen = tableInsertItems.length;
loger.log('添加文档->', "activeDocId->", GlobalConfig.activeDocId, "tableUpdateItemsLen->", tableInsertItemsLen);
for (let i = 0; i < tableInsertItemsLen; ++i) {
let insertItem = tableInsertItems[i];
if(insertItem){
if (insertItem) {
//this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData);
let itemDataInfo = this.unPackPdu(insertItem.owner, insertItem.itemIdx, insertItem.itemData);
if(itemDataInfo){
if (itemDataInfo) {
this.docList[insertItem.itemIdx] = itemDataInfo;
if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) {
GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID
GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页
//loger.log('添加文档->设置当前激活的文档id');
}
let getdocPackFullInfo= this._docPackFullInfo(itemDataInfo);
loger.log('添加文档->',getdocPackFullInfo);
let getdocPackFullInfo = this._docPackFullInfo(itemDataInfo);
loger.log('添加文档->', getdocPackFullInfo);
this._emit(MessageTypes.DOC_UPDATE, getdocPackFullInfo);//用添加和更新都统一DOC_UPDATE
}else{
loger.warn('文档数据解析失败->删除->itemIdx:'+insertItem.itemIdx);
} else {
loger.warn('文档数据解析失败->删除->itemIdx:' + insertItem.itemIdx);
this.documentDelete({"itemIdx": insertItem.itemIdx});
}
}
... ... @@ -559,6 +573,7 @@ class DocApe extends Ape {
//文档数据更新完毕,如果当前没有显示的文档,默认选择一个显示
this._showDefaultDoc();
}
tableDeleteHandler(object_id, tableDeleteData) {
loger.log('删除文档数据->', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}]
if (tableDeleteData && tableDeleteData.itemIdx) {
... ... @@ -605,7 +620,7 @@ class DocApe extends Ape {
//loger.log('更新文档->', "activeDocId->", GlobalConfig.activeDocId, "更新的数量->", tableUpdateItemsLen);
for (let i = 0; i < tableUpdateItemsLen; ++i) {
let tableItem = _tableUpdateItems[i];
if(tableItem) {
if (tableItem) {
let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData);
if (itemDataInfo) {
this.docList[tableItem.itemIdx] = itemDataInfo;
... ... @@ -614,10 +629,10 @@ class DocApe extends Ape {
GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页
loger.log('更新文档->设置当前激活的文档id->', GlobalConfig.activeDocId, "curPageNum->", GlobalConfig.activeDocCurPage);
}
let getdocPackFullInfo= this._docPackFullInfo(itemDataInfo);
let getdocPackFullInfo = this._docPackFullInfo(itemDataInfo);
this._emit(MessageTypes.DOC_UPDATE, getdocPackFullInfo);
} else {
loger.warn('文档数据解析失败->删除->itemIdx:'+tableItem.itemIdx);
loger.warn('文档数据解析失败->删除->itemIdx:' + tableItem.itemIdx);
this.documentDelete({"itemIdx": tableItem.itemIdx});
}
}
... ... @@ -637,13 +652,13 @@ class DocApe extends Ape {
return;
}
//如果自己不是老师,并且当前课堂内人数大于1,不能操作
if(!GlobalConfig.isHost&&GlobalConfig.rosterNumber>1){
if (!GlobalConfig.isHost && GlobalConfig.rosterNumber > 1) {
return;
}
let tempDocItemIdx;//临时记录文档数据,用于显示默认文档
for (let key in this.docList) {
tempDocItemIdx= this.docList[key];
tempDocItemIdx = this.docList[key];
if (tempDocItemIdx) {
loger.log("选择一个文档作为默认文档显示->", tempDocItemIdx);
let paramInfo = {
... ... @@ -686,7 +701,7 @@ class DocApe extends Ape {
return true;
}
}
loger.log('查找文档->没有查找到文档->',_docId);
loger.log('查找文档->没有查找到文档->', _docId);
//储存的数据中没有查找到
return false;
}
... ... @@ -708,7 +723,7 @@ class DocApe extends Ape {
docModelPdu.pageNum = _param.pageNum || 1;
docModelPdu.fileType = _param.fileType || "";
docModelPdu.creatUserId = _param.creatUserId || "0";
docModelPdu.url = _param.url||"";//这个地址没用到,数据太长占用资源 暂停使用//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu.url = _param.url || "";//这个地址没用到,数据太长占用资源 暂停使用//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu.relativeUrl = _param.relativeUrl || "";//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu.curV = parseInt(_param.curV) || 0;
docModelPdu.curH = parseInt(_param.curH) || 0;
... ... @@ -720,7 +735,7 @@ class DocApe extends Ape {
docModelPdu.fileName = _param.fileName || "doc_" + _itemIdx;//文档的名字
docModelPdu.dynamicTS = _param.dynamicTS || "0";//文档上传后返回值中的字段dynamicTransferStatic
docModelPdu.showType = _param.showType || 0;//文档显示模式
docModelPdu.animationStep=_param.animationStep || 1;//当前页面上的动画步数(动态ppt时有这个字段)
docModelPdu.animationStep = _param.animationStep || 1;//当前页面上的动画步数(动态ppt时有这个字段)
//loger.log(docModelPdu);
return docModelPdu;
}
... ...