正在显示
3 个修改的文件
包含
58 行增加
和
20 行删除
| @@ -62,7 +62,7 @@ export default class MessageEntrance extends Emiter { | @@ -62,7 +62,7 @@ export default class MessageEntrance extends Emiter { | ||
| 62 | constructor() { | 62 | constructor() { |
| 63 | super(); | 63 | super(); |
| 64 | //sdk 信息 | 64 | //sdk 信息 |
| 65 | - GlobalConfig.sdkVersion = "v2.18.15.20171020"; | 65 | + GlobalConfig.sdkVersion = "v2.19.8.20171020"; |
| 66 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); | 66 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); |
| 67 | 67 | ||
| 68 | //设置 | 68 | //设置 |
| @@ -261,7 +261,7 @@ export default class MessageEntrance extends Emiter { | @@ -261,7 +261,7 @@ export default class MessageEntrance extends Emiter { | ||
| 261 | this.getDocPDFFullPath = this._getDocPDFFullPath.bind(this); //获取文档的完整路径 | 261 | this.getDocPDFFullPath = this._getDocPDFFullPath.bind(this); //获取文档的完整路径 |
| 262 | this.getDocFullAddress = this._getDocFullAddress.bind(this); //获取文档资源地址 | 262 | this.getDocFullAddress = this._getDocFullAddress.bind(this); //获取文档资源地址 |
| 263 | this.hideCurrentDocument=this._hideCurrentDocument.bind(this);//隐藏当前显示的文档 | 263 | this.hideCurrentDocument=this._hideCurrentDocument.bind(this);//隐藏当前显示的文档 |
| 264 | - | 264 | + this.switchToWhiteboard = this._switchToWhiteboard.bind(this); //切换到白板文档 |
| 265 | //媒体共享模块 | 265 | //媒体共享模块 |
| 266 | this.mediaSharedUpload = this._sendMediaSharedUpload.bind(this); //上传 | 266 | this.mediaSharedUpload = this._sendMediaSharedUpload.bind(this); //上传 |
| 267 | this.mediaSharedDelete = this._sassDeletMediaShare.bind(this); //删除,先通过Sass删除,删除成功之后才删除MCU的 | 267 | this.mediaSharedDelete = this._sassDeletMediaShare.bind(this); //删除,先通过Sass删除,删除成功之后才删除MCU的 |
| @@ -1773,6 +1773,21 @@ export default class MessageEntrance extends Emiter { | @@ -1773,6 +1773,21 @@ export default class MessageEntrance extends Emiter { | ||
| 1773 | GlobalConfig.setVideoCDNAddr(_data.videoCDNAddr); //cdn加速的拉流地址,直播的时候才使用 | 1773 | GlobalConfig.setVideoCDNAddr(_data.videoCDNAddr); //cdn加速的拉流地址,直播的时候才使用 |
| 1774 | GlobalConfig.setMediaShareList(_data.sharedMediaList); //提前上传的媒体共享文件列表 | 1774 | GlobalConfig.setMediaShareList(_data.sharedMediaList); //提前上传的媒体共享文件列表 |
| 1775 | 1775 | ||
| 1776 | + //设置白板文档,固定ID | ||
| 1777 | + let whiteBoradData={ | ||
| 1778 | + itemIdx:GlobalConfig.whiteboardId,//指定的白板文档ID | ||
| 1779 | + name: "白板.pdf", | ||
| 1780 | + creatUserId: 0, | ||
| 1781 | + md5:"b153313f6f390328a30db5389b6cee53", | ||
| 1782 | + pageNum: 30, | ||
| 1783 | + docId: "b153313f6f390328a30db5389b6cee53", | ||
| 1784 | + url:"http://pclive.xuedianyun.com/DocSharing/data/whiteboard/default/whiteboard.pdf", | ||
| 1785 | + dynamicTransferStatic: "0", | ||
| 1786 | + relativeUrl: "/DocSharing/data/whiteboard/default/whiteboard.pdf", | ||
| 1787 | + fileType: "pdf" | ||
| 1788 | + } | ||
| 1789 | + GlobalConfig.docListPrepare.push(whiteBoradData); | ||
| 1790 | + | ||
| 1776 | let appConfigStr=_data.appConfig; | 1791 | let appConfigStr=_data.appConfig; |
| 1777 | appConfigStr=_base64.decode(appConfigStr); | 1792 | appConfigStr=_base64.decode(appConfigStr); |
| 1778 | let appConfig={}; | 1793 | let appConfig={}; |
| @@ -2229,14 +2244,29 @@ export default class MessageEntrance extends Emiter { | @@ -2229,14 +2244,29 @@ export default class MessageEntrance extends Emiter { | ||
| 2229 | //切换文档 | 2244 | //切换文档 |
| 2230 | _sendDocumentSwitchDoc(_param) { | 2245 | _sendDocumentSwitchDoc(_param) { |
| 2231 | if (!_mcu.connected) { | 2246 | if (!_mcu.connected) { |
| 2232 | - loger.warn(GlobalConfig.getCurrentStatus()); | 2247 | + loger.warn("连接已经断开->不能切换文档"); |
| 2233 | return; | 2248 | return; |
| 2234 | } | 2249 | } |
| 2235 | if (_doc_ape) { | 2250 | if (_doc_ape) { |
| 2236 | _doc_ape.documentSwitchDoc(_param); | 2251 | _doc_ape.documentSwitchDoc(_param); |
| 2237 | } | 2252 | } |
| 2238 | } | 2253 | } |
| 2239 | - | 2254 | + //切换到白板文档 |
| 2255 | + _switchToWhiteboard(_param){ | ||
| 2256 | + if (!_mcu.connected) { | ||
| 2257 | + loger.warn("连接已经断开->不能切换到白板文档"); | ||
| 2258 | + return; | ||
| 2259 | + } | ||
| 2260 | + //白板文档的数据 | ||
| 2261 | + let data={ | ||
| 2262 | + itemIdx:GlobalConfig.whiteboardId, | ||
| 2263 | + visible:true | ||
| 2264 | + } | ||
| 2265 | + if (_doc_ape) { | ||
| 2266 | + loger.log("切换到白板文档"); | ||
| 2267 | + _doc_ape.documentSwitchDoc(data); | ||
| 2268 | + } | ||
| 2269 | + } | ||
| 2240 | //操作文档(翻页) | 2270 | //操作文档(翻页) |
| 2241 | _sendDocumentSwitchPage(_param) { | 2271 | _sendDocumentSwitchPage(_param) { |
| 2242 | if (!_mcu.connected) { | 2272 | if (!_mcu.connected) { |
| @@ -2321,7 +2351,6 @@ export default class MessageEntrance extends Emiter { | @@ -2321,7 +2351,6 @@ export default class MessageEntrance extends Emiter { | ||
| 2321 | //文档加入频道成功,同步到MCU服务器上的数据 | 2351 | //文档加入频道成功,同步到MCU服务器上的数据 |
| 2322 | docJoinChannelSuccess() { | 2352 | docJoinChannelSuccess() { |
| 2323 | loger.log("文档加入频道成功->isHost=", GlobalConfig.isHost, "当前总人数:", GlobalConfig.rosterNumber, "sassDoclength=", GlobalConfig.docListPrepare.length); | 2353 | loger.log("文档加入频道成功->isHost=", GlobalConfig.isHost, "当前总人数:", GlobalConfig.rosterNumber, "sassDoclength=", GlobalConfig.docListPrepare.length); |
| 2324 | - //loger.log("docJoinChannelSuccess docListPrepare="); | ||
| 2325 | //如果是主持人,那么需要判断一下文档模块同步的数据和从sass获取的文档数据是否相同,如果mcu服务器不存在的,需要上传 | 2354 | //如果是主持人,那么需要判断一下文档模块同步的数据和从sass获取的文档数据是否相同,如果mcu服务器不存在的,需要上传 |
| 2326 | if (GlobalConfig.docListPrepare && GlobalConfig.docListPrepare.length > 0) { | 2355 | if (GlobalConfig.docListPrepare && GlobalConfig.docListPrepare.length > 0) { |
| 2327 | //如果当前身份是老师或者当前课堂内只有一个人,有权限同步文档到MCU | 2356 | //如果当前身份是老师或者当前课堂内只有一个人,有权限同步文档到MCU |
| @@ -2331,15 +2360,16 @@ export default class MessageEntrance extends Emiter { | @@ -2331,15 +2360,16 @@ export default class MessageEntrance extends Emiter { | ||
| 2331 | if (value) { | 2360 | if (value) { |
| 2332 | //loger.log("判断是否需要把提前上传的文档上传到mcu", value); | 2361 | //loger.log("判断是否需要把提前上传的文档上传到mcu", value); |
| 2333 | let paramInfo = { | 2362 | let paramInfo = { |
| 2334 | - "pageNum": value.pdfSize, | 2363 | + "pageNum": value.pdfSize||value.pageNum, |
| 2335 | "fileName": value.name, | 2364 | "fileName": value.name, |
| 2336 | "fileType": value.type, | 2365 | "fileType": value.type, |
| 2337 | - "relativeUrl": value.relativeLocation, | ||
| 2338 | - "url": value.absoluteLocation, | ||
| 2339 | - "creatUserId": value.createUserID, | ||
| 2340 | - "docId": value.id, | ||
| 2341 | - "md5": value.MD5, | ||
| 2342 | - "visible": false | 2366 | + "relativeUrl": value.relativeLocation||value.relativeUrl, |
| 2367 | + "url": value.absoluteLocation||value.url, | ||
| 2368 | + "creatUserId": value.createUserID||0, | ||
| 2369 | + "docId": value.id||value.docId, | ||
| 2370 | + "md5": value.MD5||"", | ||
| 2371 | + "visible": false, | ||
| 2372 | + "itemIdx":value.itemIdx||0 | ||
| 2343 | }; | 2373 | }; |
| 2344 | this._sendDocumentUpload(paramInfo); | 2374 | this._sendDocumentUpload(paramInfo); |
| 2345 | } | 2375 | } |
| @@ -568,7 +568,7 @@ GlobalConfig.updateRecordTimeDelay = 5; //(秒),同步一次课堂录制状态 | @@ -568,7 +568,7 @@ GlobalConfig.updateRecordTimeDelay = 5; //(秒),同步一次课堂录制状态 | ||
| 568 | GlobalConfig.updateClassInfoDelay = 10; //(秒),同步一次课堂状态的并保存到Sass | 568 | GlobalConfig.updateClassInfoDelay = 10; //(秒),同步一次课堂状态的并保存到Sass |
| 569 | GlobalConfig.msDynamicChooseIpDelay = 60 * 3; //(秒)MS动态选点的间隔 | 569 | GlobalConfig.msDynamicChooseIpDelay = 60 * 3; //(秒)MS动态选点的间隔 |
| 570 | //GlobalConfig.serverTimestamp=0;//当前的系统时间戳 用get set 获取 | 570 | //GlobalConfig.serverTimestamp=0;//当前的系统时间戳 用get set 获取 |
| 571 | - | 571 | +GlobalConfig.whiteboardId=2359297;//白板文档的ID |
| 572 | GlobalConfig.activeDocId = 0; //当前激活的文档ID | 572 | GlobalConfig.activeDocId = 0; //当前激活的文档ID |
| 573 | GlobalConfig.activeDocCurPage = 1; //当前激活的文档的当前页 | 573 | GlobalConfig.activeDocCurPage = 1; //当前激活的文档的当前页 |
| 574 | 574 |
| @@ -53,14 +53,18 @@ class DocApe extends Ape { | @@ -53,14 +53,18 @@ class DocApe extends Ape { | ||
| 53 | return; | 53 | return; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | - let itemIdx = EngineUtils.creatSoleNumberFromTimestamp();// | 56 | + let itemIdx =parseInt(paramInfo.itemIdx||0);//使用外部指定的itemIdx |
| 57 | + if(itemIdx<=0){ | ||
| 58 | + //外部指定的值无效就使用时间戳 | ||
| 59 | + itemIdx = EngineUtils.creatSoleNumberFromTimestamp(); | ||
| 60 | + } | ||
| 57 | let docDataModelPdu = this.packPdu(paramInfo, itemIdx); | 61 | let docDataModelPdu = this.packPdu(paramInfo, itemIdx); |
| 58 | - if (docDataModelPdu == null) { | ||
| 59 | - loger.log('上传文档->失败->数据无效'); | 62 | + //数据无效或地址无效的不做处理 |
| 63 | + if (docDataModelPdu == null||!docDataModelPdu.url) { | ||
| 64 | + loger.log('上传文档->失败->数据无效',docDataModelPdu); | ||
| 60 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 65 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 61 | return; | 66 | return; |
| 62 | } | 67 | } |
| 63 | - //console.log(docDataModelPdu); | ||
| 64 | 68 | ||
| 65 | let tableItemPdu = new pdu['RCRegistryTableItemPdu']; | 69 | let tableItemPdu = new pdu['RCRegistryTableItemPdu']; |
| 66 | tableItemPdu.itemIdx = itemIdx;//直接用时间戳作为id | 70 | tableItemPdu.itemIdx = itemIdx;//直接用时间戳作为id |
| @@ -305,6 +309,10 @@ class DocApe extends Ape { | @@ -305,6 +309,10 @@ class DocApe extends Ape { | ||
| 305 | //组织完整的文档信息,包含上传时的信息和转换后的完整地址信息 | 309 | //组织完整的文档信息,包含上传时的信息和转换后的完整地址信息 |
| 306 | _docPackFullInfo(_itemDataInfo) { | 310 | _docPackFullInfo(_itemDataInfo) { |
| 307 | let itemDataInfo = _itemDataInfo; | 311 | let itemDataInfo = _itemDataInfo; |
| 312 | + itemDataInfo.isWhiteboard=false;//默认是普通的文档 | ||
| 313 | + if(itemDataInfo.itemIdx==GlobalConfig.whiteboardId){ | ||
| 314 | + itemDataInfo.isWhiteboard=true;//这是白板数据 | ||
| 315 | + } | ||
| 308 | let getDocAddress = this.getDocFullAddress(_itemDataInfo); | 316 | let getDocAddress = this.getDocFullAddress(_itemDataInfo); |
| 309 | //loger.log('docPackFullInfo->', itemDataInfo); | 317 | //loger.log('docPackFullInfo->', itemDataInfo); |
| 310 | if (getDocAddress.code == ApeConsts.RETURN_SUCCESS) { | 318 | if (getDocAddress.code == ApeConsts.RETURN_SUCCESS) { |
| @@ -571,7 +579,7 @@ class DocApe extends Ape { | @@ -571,7 +579,7 @@ class DocApe extends Ape { | ||
| 571 | if (insertItem) { | 579 | if (insertItem) { |
| 572 | //this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData); | 580 | //this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData); |
| 573 | let itemDataInfo = this.unPackPdu(insertItem.owner, insertItem.itemIdx, insertItem.itemData); | 581 | let itemDataInfo = this.unPackPdu(insertItem.owner, insertItem.itemIdx, insertItem.itemData); |
| 574 | - if (itemDataInfo) { | 582 | + if (itemDataInfo&&itemDataInfo.url) { |
| 575 | this.docList[insertItem.itemIdx] = itemDataInfo; | 583 | this.docList[insertItem.itemIdx] = itemDataInfo; |
| 576 | if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) { | 584 | if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) { |
| 577 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID | 585 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID |
| @@ -639,7 +647,7 @@ class DocApe extends Ape { | @@ -639,7 +647,7 @@ class DocApe extends Ape { | ||
| 639 | let tableItem = _tableUpdateItems[i]; | 647 | let tableItem = _tableUpdateItems[i]; |
| 640 | if (tableItem) { | 648 | if (tableItem) { |
| 641 | let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); | 649 | let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); |
| 642 | - if (itemDataInfo) { | 650 | + if (itemDataInfo&&itemDataInfo.url) { |
| 643 | this.docList[tableItem.itemIdx] = itemDataInfo; | 651 | this.docList[tableItem.itemIdx] = itemDataInfo; |
| 644 | if (itemDataInfo && (itemDataInfo.visible == "true" || itemDataInfo.visible == true)) { | 652 | if (itemDataInfo && (itemDataInfo.visible == "true" || itemDataInfo.visible == true)) { |
| 645 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID | 653 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID |
| @@ -713,7 +721,7 @@ class DocApe extends Ape { | @@ -713,7 +721,7 @@ class DocApe extends Ape { | ||
| 713 | //遍历查找 | 721 | //遍历查找 |
| 714 | for (let key in this.docList) { | 722 | for (let key in this.docList) { |
| 715 | let item = this.docList[key]; | 723 | let item = this.docList[key]; |
| 716 | - if (item && item.docId == _docId) { | 724 | + if (item && item.docId == _docId&&item.url) { |
| 717 | //loger.log('查找文档->已经存在->',_docId); | 725 | //loger.log('查找文档->已经存在->',_docId); |
| 718 | return true; | 726 | return true; |
| 719 | } | 727 | } |
-
请 注册 或 登录 后发表评论