1.server数据不再从本地加载,直接获取从Sass返回的数据;2.增加日志上报;3.人员属性中增加噪音消除的字段和自动调整麦克风音量的字段
正在显示
19 个修改的文件
包含
441 行增加
和
345 行删除
| @@ -33,6 +33,7 @@ import MediaSharedApe from 'apes/MediaSharedApe'; | @@ -33,6 +33,7 @@ import MediaSharedApe from 'apes/MediaSharedApe'; | ||
| 33 | import MusicSharedApe from 'apes/MusicSharedApe'; | 33 | import MusicSharedApe from 'apes/MusicSharedApe'; |
| 34 | import QuestionApe from 'apes/QuestionApe'; | 34 | import QuestionApe from 'apes/QuestionApe'; |
| 35 | import UTF8 from 'utf-8'; | 35 | import UTF8 from 'utf-8'; |
| 36 | +import LogManager from 'LogManager'; | ||
| 36 | 37 | ||
| 37 | let loger = Loger.getLoger('McuClient'); | 38 | let loger = Loger.getLoger('McuClient'); |
| 38 | 39 | ||
| @@ -57,8 +58,8 @@ export default class MessageEntrance extends Emiter { | @@ -57,8 +58,8 @@ export default class MessageEntrance extends Emiter { | ||
| 57 | constructor() { | 58 | constructor() { |
| 58 | super(); | 59 | super(); |
| 59 | //sdk 信息 | 60 | //sdk 信息 |
| 60 | - GlobalConfig.sdkVersion="v1.63.1.20170731"; | ||
| 61 | - loger.warn("sdkVersion:"+GlobalConfig.sdkVersion); | 61 | + GlobalConfig.sdkVersion = "v1.65.24.20170806"; |
| 62 | + loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); | ||
| 62 | 63 | ||
| 63 | //获取设备和系统信息 | 64 | //获取设备和系统信息 |
| 64 | SystemConfig.getSystemInfo(); | 65 | SystemConfig.getSystemInfo(); |
| @@ -258,8 +259,14 @@ export default class MessageEntrance extends Emiter { | @@ -258,8 +259,14 @@ export default class MessageEntrance extends Emiter { | ||
| 258 | this.switchServer = this._switchMcuIpHandler.bind(this); //切换mcu服务器 | 259 | this.switchServer = this._switchMcuIpHandler.bind(this); //切换mcu服务器 |
| 259 | this.switchMediaServer = this._switchMediaServer.bind(this); //手动切换ms服务器 | 260 | this.switchMediaServer = this._switchMediaServer.bind(this); //手动切换ms服务器 |
| 260 | this.setDebugInfo = this._setDebugInfo.bind(this); //设置debug信息 | 261 | this.setDebugInfo = this._setDebugInfo.bind(this); //设置debug信息 |
| 262 | + this.setOpenSendLogToServer = this._setOpenSendLogToServer.bind(this); //设置是否上报日志 | ||
| 263 | + | ||
| 264 | + this.addLog = this._addLog.bind(this); | ||
| 265 | + this.addWarn = this._addWarn.bind(this); | ||
| 266 | + this.addError = this._addError.bind(this); | ||
| 261 | } | 267 | } |
| 262 | 268 | ||
| 269 | + //设置是否输出日志 | ||
| 263 | _setDebugInfo(_data) { | 270 | _setDebugInfo(_data) { |
| 264 | loger.log("设置debug信息-->", _data); | 271 | loger.log("设置debug信息-->", _data); |
| 265 | if (_data) { | 272 | if (_data) { |
| @@ -267,6 +274,37 @@ export default class MessageEntrance extends Emiter { | @@ -267,6 +274,37 @@ export default class MessageEntrance extends Emiter { | ||
| 267 | } | 274 | } |
| 268 | } | 275 | } |
| 269 | 276 | ||
| 277 | + //设置是否上报日志 | ||
| 278 | + _setOpenSendLogToServer(_data) { | ||
| 279 | + loger.log("设置日志上报状态-->", _data); | ||
| 280 | + if (_data) { | ||
| 281 | + LogManager.IS_OPEN_SEND_LOG = _data.isOpen | ||
| 282 | + } | ||
| 283 | + } | ||
| 284 | + | ||
| 285 | + //--------------外部上传日志的接口------------------------ | ||
| 286 | + //上传log日志 | ||
| 287 | + _addLog(_data) { | ||
| 288 | + if (_data) { | ||
| 289 | + LogManager.addLog(LogManager.LOG, _data); | ||
| 290 | + } | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + //上传warn日志 | ||
| 294 | + _addWarn(_data) { | ||
| 295 | + if (_data) { | ||
| 296 | + LogManager.addLog(LogManager.WARN, _data); | ||
| 297 | + } | ||
| 298 | + } | ||
| 299 | + | ||
| 300 | + //上传error日志 | ||
| 301 | + _addError(_data) { | ||
| 302 | + if (_data) { | ||
| 303 | + LogManager.addLog(LogManager.ERROR, _data); | ||
| 304 | + } | ||
| 305 | + } | ||
| 306 | + | ||
| 307 | + //--------------外部上传日志的接口--END ---------------------- | ||
| 270 | //设置设备信息 | 308 | //设置设备信息 |
| 271 | _setDeviceInfo(_data) { | 309 | _setDeviceInfo(_data) { |
| 272 | loger.log("设置设备信息-->", _data); | 310 | loger.log("设置设备信息-->", _data); |
| @@ -276,6 +314,8 @@ export default class MessageEntrance extends Emiter { | @@ -276,6 +314,8 @@ export default class MessageEntrance extends Emiter { | ||
| 276 | GlobalConfig.videoQuality = parseInt(_data.videoQuality); | 314 | GlobalConfig.videoQuality = parseInt(_data.videoQuality); |
| 277 | GlobalConfig.curVideoQuality = parseInt(_data.curVideoQuality); | 315 | GlobalConfig.curVideoQuality = parseInt(_data.curVideoQuality); |
| 278 | GlobalConfig.micGain = _data.micGain || 50; | 316 | GlobalConfig.micGain = _data.micGain || 50; |
| 317 | + GlobalConfig.micNoise = _data.micNoise || 50; | ||
| 318 | + GlobalConfig.autoGain = _data.autoGain || false; | ||
| 279 | GlobalConfig.speakerVolume = _data.speakerVolume || 50; | 319 | GlobalConfig.speakerVolume = _data.speakerVolume || 50; |
| 280 | GlobalConfig.micCode = _data.micCode || 0; | 320 | GlobalConfig.micCode = _data.micCode || 0; |
| 281 | GlobalConfig.curCamera = _data.curCamera || ''; | 321 | GlobalConfig.curCamera = _data.curCamera || ''; |
| @@ -301,18 +341,18 @@ export default class MessageEntrance extends Emiter { | @@ -301,18 +341,18 @@ export default class MessageEntrance extends Emiter { | ||
| 301 | 341 | ||
| 302 | //mcu异常监听 | 342 | //mcu异常监听 |
| 303 | _mcuErrorHandler(_data) { | 343 | _mcuErrorHandler(_data) { |
| 304 | - let errorMessage={}; | 344 | + let errorMessage = {}; |
| 305 | 345 | ||
| 306 | //目前只有 userId和身份相同时被踢的时候有type值判断 | 346 | //目前只有 userId和身份相同时被踢的时候有type值判断 |
| 307 | - switch (_data.type){ | 347 | + switch (_data.type) { |
| 308 | case MessageTypes.ERR_CLASS_KICK_OUT: | 348 | case MessageTypes.ERR_CLASS_KICK_OUT: |
| 309 | case MessageTypes.ERR_CLASS_REMOTE_LANDING: | 349 | case MessageTypes.ERR_CLASS_REMOTE_LANDING: |
| 310 | - if(_data){ | ||
| 311 | - errorMessage = {"code": _data.type, "reson": MessageTypes.ErrorReson[_data.type],"data":_data.data}; | 350 | + if (_data) { |
| 351 | + errorMessage = {"code": _data.type, "reson": MessageTypes.ErrorReson[_data.type], "data": _data.data}; | ||
| 312 | } | 352 | } |
| 313 | break; | 353 | break; |
| 314 | default : | 354 | default : |
| 315 | - errorMessage = {"code": _data, "reson": MessageTypes.ErrorReson[_data],"data":{}}; | 355 | + errorMessage = {"code": _data, "reson": MessageTypes.ErrorReson[_data], "data": {}}; |
| 316 | break; | 356 | break; |
| 317 | } | 357 | } |
| 318 | 358 | ||
| @@ -580,17 +620,21 @@ export default class MessageEntrance extends Emiter { | @@ -580,17 +620,21 @@ export default class MessageEntrance extends Emiter { | ||
| 580 | //先加载本地Server.json文件,然后获取userIp新 | 620 | //先加载本地Server.json文件,然后获取userIp新 |
| 581 | _ipManager.loadServerJosn(function (_callbackData) { | 621 | _ipManager.loadServerJosn(function (_callbackData) { |
| 582 | //本地Server.json加载后需要判断是否有数据,如果没有数据就用Sass的 | 622 | //本地Server.json加载后需要判断是否有数据,如果没有数据就用Sass的 |
| 583 | - //_callbackData.data=ret; | ||
| 584 | - //_callbackData.ret=1; | ||
| 585 | - ServerConfig.localServerJson=_callbackData.data; | ||
| 586 | - console.warn("本地SERVER数据",_callbackData); | ||
| 587 | - if(!ServerConfig.localServerJson||!ServerConfig.localServerJson.MCU||!ServerConfig.localServerJson.MS){ | ||
| 588 | - ServerConfig.serverList=ServerConfig.sassServerJson;//本地JSON数据加载完数据无效,使用Sass的 | 623 | + if (_callbackData) { |
| 624 | + ServerConfig.localServerJson = _callbackData.data; | ||
| 625 | + console.warn("本地SERVER数据", _callbackData); | ||
| 626 | + } else { | ||
| 627 | + ServerConfig.localServerJson = {}; | ||
| 628 | + } | ||
| 629 | + | ||
| 630 | + if (!ServerConfig.localServerJson || !ServerConfig.localServerJson.MCU || !ServerConfig.localServerJson.MS) { | ||
| 631 | + ServerConfig.serverList = ServerConfig.sassServerJson;//本地JSON数据加载完数据无效,使用Sass的 | ||
| 589 | loger.warn("使用从Sass获取的server"); | 632 | loger.warn("使用从Sass获取的server"); |
| 590 | - }else { | ||
| 591 | - ServerConfig.serverList=ServerConfig.localServerJson; | 633 | + } else { |
| 634 | + ServerConfig.serverList = ServerConfig.localServerJson; | ||
| 592 | loger.warn("使用从本地获取的server"); | 635 | loger.warn("使用从本地获取的server"); |
| 593 | } | 636 | } |
| 637 | + //通过userIp获取用户的信息 | ||
| 594 | _ipManager.getUserIpInfo("", GlobalConfig.userIp, _this._getUserIpCallbackHandler.bind(_this), 2000); | 638 | _ipManager.getUserIpInfo("", GlobalConfig.userIp, _this._getUserIpCallbackHandler.bind(_this), 2000); |
| 595 | }) | 639 | }) |
| 596 | } | 640 | } |
| @@ -618,7 +662,7 @@ export default class MessageEntrance extends Emiter { | @@ -618,7 +662,7 @@ export default class MessageEntrance extends Emiter { | ||
| 618 | } | 662 | } |
| 619 | 663 | ||
| 620 | //开始加入课堂前第一次测速 | 664 | //开始加入课堂前第一次测速 |
| 621 | - _startFirstTestBestServer(){ | 665 | + _startFirstTestBestServer() { |
| 622 | //加入课堂之前开始第一次选点 | 666 | //加入课堂之前开始第一次选点 |
| 623 | let _this = this; | 667 | let _this = this; |
| 624 | //推流地址测速 | 668 | //推流地址测速 |
| @@ -749,9 +793,9 @@ export default class MessageEntrance extends Emiter { | @@ -749,9 +793,9 @@ export default class MessageEntrance extends Emiter { | ||
| 749 | GlobalConfig.hlsPullListFinal = GlobalConfig.rsPullListFinal; | 793 | GlobalConfig.hlsPullListFinal = GlobalConfig.rsPullListFinal; |
| 750 | } | 794 | } |
| 751 | 795 | ||
| 752 | - if(!ServerConfig.localServerJson||!ServerConfig.localServerJson.MCU||!ServerConfig.localServerJson.MS){ | 796 | + if (!ServerConfig.localServerJson || !ServerConfig.localServerJson.MCU || !ServerConfig.localServerJson.MS) { |
| 753 | loger.warn("课堂最终使用的服务列表->来自Sass"); | 797 | loger.warn("课堂最终使用的服务列表->来自Sass"); |
| 754 | - }else { | 798 | + } else { |
| 755 | loger.warn("课堂最终使用的服务列表->来自本地Server.json"); | 799 | loger.warn("课堂最终使用的服务列表->来自本地Server.json"); |
| 756 | } | 800 | } |
| 757 | 801 | ||
| @@ -761,6 +805,7 @@ export default class MessageEntrance extends Emiter { | @@ -761,6 +805,7 @@ export default class MessageEntrance extends Emiter { | ||
| 761 | loger.warn("hlsListFinal", GlobalConfig.hlsPullListFinal); | 805 | loger.warn("hlsListFinal", GlobalConfig.hlsPullListFinal); |
| 762 | loger.warn("rsListFinal", GlobalConfig.rsPullListFinal); | 806 | loger.warn("rsListFinal", GlobalConfig.rsPullListFinal); |
| 763 | } | 807 | } |
| 808 | + | ||
| 764 | //从Sass中选择的mcu、ms列表 | 809 | //从Sass中选择的mcu、ms列表 |
| 765 | _choiceMcuAndMsListFromSass() { | 810 | _choiceMcuAndMsListFromSass() { |
| 766 | //1.根据user信息获取服务器列表 | 811 | //1.根据user信息获取服务器列表 |
| @@ -781,7 +826,7 @@ export default class MessageEntrance extends Emiter { | @@ -781,7 +826,7 @@ export default class MessageEntrance extends Emiter { | ||
| 781 | GlobalConfig.isp, | 826 | GlobalConfig.isp, |
| 782 | ServerConfig.serverList); | 827 | ServerConfig.serverList); |
| 783 | 828 | ||
| 784 | - GlobalConfig.rtmpPullListFinal= _ipManager.getServerListForUserInfo( | 829 | + GlobalConfig.rtmpPullListFinal = _ipManager.getServerListForUserInfo( |
| 785 | "RTMP_PULL", | 830 | "RTMP_PULL", |
| 786 | GlobalConfig.country, | 831 | GlobalConfig.country, |
| 787 | GlobalConfig.province, | 832 | GlobalConfig.province, |
| @@ -797,7 +842,7 @@ export default class MessageEntrance extends Emiter { | @@ -797,7 +842,7 @@ export default class MessageEntrance extends Emiter { | ||
| 797 | GlobalConfig.isp, | 842 | GlobalConfig.isp, |
| 798 | ServerConfig.serverList); | 843 | ServerConfig.serverList); |
| 799 | 844 | ||
| 800 | - GlobalConfig.hlsPullListFinal= _ipManager.getServerListForUserInfo( | 845 | + GlobalConfig.hlsPullListFinal = _ipManager.getServerListForUserInfo( |
| 801 | "HLS_PULL", | 846 | "HLS_PULL", |
| 802 | GlobalConfig.country, | 847 | GlobalConfig.country, |
| 803 | GlobalConfig.province, | 848 | GlobalConfig.province, |
| @@ -925,19 +970,19 @@ export default class MessageEntrance extends Emiter { | @@ -925,19 +970,19 @@ export default class MessageEntrance extends Emiter { | ||
| 925 | loger.warn('HLS拉流地址->HLS->', GlobalConfig.MS_PLAY_HLS_IP, GlobalConfig.MS_PLAY_HLS_PORT); | 970 | loger.warn('HLS拉流地址->HLS->', GlobalConfig.MS_PLAY_HLS_IP, GlobalConfig.MS_PLAY_HLS_PORT); |
| 926 | loger.warn('HLS录制回放拉流地址->HLS->', GlobalConfig.RS_RECORD_PLAY_IP, GlobalConfig.RS_RECORD_PLAY_PORT); | 971 | loger.warn('HLS录制回放拉流地址->HLS->', GlobalConfig.RS_RECORD_PLAY_IP, GlobalConfig.RS_RECORD_PLAY_PORT); |
| 927 | 972 | ||
| 928 | - if(!GlobalConfig.MS_PUBLISH_IP){ | 973 | + if (!GlobalConfig.MS_PUBLISH_IP) { |
| 929 | loger.error("推流MS地址地址无效"); | 974 | loger.error("推流MS地址地址无效"); |
| 930 | } | 975 | } |
| 931 | - if(!GlobalConfig.MS_PLAY_RTMP_IP){ | 976 | + if (!GlobalConfig.MS_PLAY_RTMP_IP) { |
| 932 | loger.warn("RTMP拉流地址无效->使用推流地址作为RTMP拉流地址"); | 977 | loger.warn("RTMP拉流地址无效->使用推流地址作为RTMP拉流地址"); |
| 933 | - GlobalConfig.MS_PLAY_RTMP_IP=GlobalConfig.MS_PUBLISH_IP; | ||
| 934 | - GlobalConfig.MS_PLAY_RTMP_PORT=GlobalConfig.MS_PUBLISH_PORT | 978 | + GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.MS_PUBLISH_IP; |
| 979 | + GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.MS_PUBLISH_PORT | ||
| 935 | } | 980 | } |
| 936 | 981 | ||
| 937 | - if(!GlobalConfig.MS_PLAY_HLS_IP){ | 982 | + if (!GlobalConfig.MS_PLAY_HLS_IP) { |
| 938 | loger.warn("HLS拉流地址无效->使用HLS回放地址作为HLS拉流地址"); | 983 | loger.warn("HLS拉流地址无效->使用HLS回放地址作为HLS拉流地址"); |
| 939 | - GlobalConfig.MS_PLAY_HLS_IP=GlobalConfig.MS_PLAY_HLS_PORT; | ||
| 940 | - GlobalConfig.RS_RECORD_PLAY_IP=GlobalConfig.RS_RECORD_PLAY_PORT | 984 | + GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.MS_PLAY_HLS_PORT; |
| 985 | + GlobalConfig.RS_RECORD_PLAY_IP = GlobalConfig.RS_RECORD_PLAY_PORT | ||
| 941 | } | 986 | } |
| 942 | 987 | ||
| 943 | if (_mcu) { | 988 | if (_mcu) { |
| @@ -1023,6 +1068,14 @@ export default class MessageEntrance extends Emiter { | @@ -1023,6 +1068,14 @@ export default class MessageEntrance extends Emiter { | ||
| 1023 | joinClassSuccessCallBackData.explorerVersion = GlobalConfig.explorerVersion; | 1068 | joinClassSuccessCallBackData.explorerVersion = GlobalConfig.explorerVersion; |
| 1024 | joinClassSuccessCallBackData.os = GlobalConfig.os; | 1069 | joinClassSuccessCallBackData.os = GlobalConfig.os; |
| 1025 | 1070 | ||
| 1071 | + //设置日志上报所需的信息 | ||
| 1072 | + LogManager.serverAndLoacTimeDistanc = GlobalConfig.serverAndLoacTimeDistanc;//本地时间和服务器时间的差值(秒) | ||
| 1073 | + LogManager.classId = GlobalConfig.classId;//课堂号 | ||
| 1074 | + LogManager.userId = GlobalConfig.userId;//userId | ||
| 1075 | + LogManager.nodeId = GlobalConfig.nodeId;//nodeId | ||
| 1076 | + LogManager.userName = GlobalConfig.userName;//用户名称 | ||
| 1077 | + LogManager.logUrl = GlobalConfig.logUrl;//日志服务器地址 //http://log.3mang.com:8888 | ||
| 1078 | + | ||
| 1026 | loger.log('加入课堂成功->'); | 1079 | loger.log('加入课堂成功->'); |
| 1027 | loger.log(joinClassSuccessCallBackData); | 1080 | loger.log(joinClassSuccessCallBackData); |
| 1028 | 1081 | ||
| @@ -1141,7 +1194,7 @@ export default class MessageEntrance extends Emiter { | @@ -1141,7 +1194,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1141 | loger.warn('录制回放->不进行MS-PULL动态选点'); | 1194 | loger.warn('录制回放->不进行MS-PULL动态选点'); |
| 1142 | return; | 1195 | return; |
| 1143 | } | 1196 | } |
| 1144 | - if(!GlobalConfig.rtmpPullListFinal||GlobalConfig.rtmpPullListFinal.length<1){ | 1197 | + if (!GlobalConfig.rtmpPullListFinal || GlobalConfig.rtmpPullListFinal.length < 1) { |
| 1145 | return; | 1198 | return; |
| 1146 | } | 1199 | } |
| 1147 | let _this = this; | 1200 | let _this = this; |
| @@ -1151,15 +1204,15 @@ export default class MessageEntrance extends Emiter { | @@ -1151,15 +1204,15 @@ export default class MessageEntrance extends Emiter { | ||
| 1151 | GlobalConfig.MS_PLAY_RTMP_IP = _data.ip || ""; | 1204 | GlobalConfig.MS_PLAY_RTMP_IP = _data.ip || ""; |
| 1152 | GlobalConfig.MS_PLAY_RTMP_PORT = _data.port || ""; | 1205 | GlobalConfig.MS_PLAY_RTMP_PORT = _data.port || ""; |
| 1153 | } else { | 1206 | } else { |
| 1154 | - //随机选择一个 | ||
| 1155 | - if (GlobalConfig.rtmpPullListFinal && GlobalConfig.rtmpPullListFinal.length > 0) { | ||
| 1156 | - let index = parseInt(Math.random() * GlobalConfig.rtmpPullListFinal.length); | ||
| 1157 | - GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.rtmpPullListFinal[index].ip || ""; | ||
| 1158 | - GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.rtmpPullListFinal[index].port || ""; | ||
| 1159 | - } | 1207 | + //随机选择一个 |
| 1208 | + if (GlobalConfig.rtmpPullListFinal && GlobalConfig.rtmpPullListFinal.length > 0) { | ||
| 1209 | + let index = parseInt(Math.random() * GlobalConfig.rtmpPullListFinal.length); | ||
| 1210 | + GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.rtmpPullListFinal[index].ip || ""; | ||
| 1211 | + GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.rtmpPullListFinal[index].port || ""; | ||
| 1212 | + } | ||
| 1160 | } | 1213 | } |
| 1161 | //如果RTMP没有配置地址,那么还是使用推流的地址 | 1214 | //如果RTMP没有配置地址,那么还是使用推流的地址 |
| 1162 | - if(!GlobalConfig.MS_PLAY_RTMP_IP){ | 1215 | + if (!GlobalConfig.MS_PLAY_RTMP_IP) { |
| 1163 | GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.MS_PUBLISH_IP; | 1216 | GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.MS_PUBLISH_IP; |
| 1164 | GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.MS_PUBLISH_PORT; | 1217 | GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.MS_PUBLISH_PORT; |
| 1165 | } | 1218 | } |
| @@ -1173,7 +1226,7 @@ export default class MessageEntrance extends Emiter { | @@ -1173,7 +1226,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1173 | loger.warn('录制回放->不进行MS-HLS动态选点'); | 1226 | loger.warn('录制回放->不进行MS-HLS动态选点'); |
| 1174 | return; | 1227 | return; |
| 1175 | } | 1228 | } |
| 1176 | - if(!GlobalConfig.hlsPullListFinal||GlobalConfig.hlsPullListFinal.length<1){ | 1229 | + if (!GlobalConfig.hlsPullListFinal || GlobalConfig.hlsPullListFinal.length < 1) { |
| 1177 | return; | 1230 | return; |
| 1178 | } | 1231 | } |
| 1179 | let _this = this; | 1232 | let _this = this; |
| @@ -1184,14 +1237,14 @@ export default class MessageEntrance extends Emiter { | @@ -1184,14 +1237,14 @@ export default class MessageEntrance extends Emiter { | ||
| 1184 | GlobalConfig.MS_PLAY_HLS_PORT = _data.port || ""; | 1237 | GlobalConfig.MS_PLAY_HLS_PORT = _data.port || ""; |
| 1185 | } else { | 1238 | } else { |
| 1186 | //随机选择一个 | 1239 | //随机选择一个 |
| 1187 | - if (GlobalConfig.hlsPullListFinal && GlobalConfig.hlsPullListFinal.length > 0) { | ||
| 1188 | - let index = parseInt(Math.random() * GlobalConfig.hlsPullListFinal.length); | ||
| 1189 | - GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.hlsPullListFinal[index].ip || ""; | ||
| 1190 | - GlobalConfig.MS_PLAY_HLS_PORT = GlobalConfig.hlsPullListFinal[index].port || ""; | ||
| 1191 | - } | 1240 | + if (GlobalConfig.hlsPullListFinal && GlobalConfig.hlsPullListFinal.length > 0) { |
| 1241 | + let index = parseInt(Math.random() * GlobalConfig.hlsPullListFinal.length); | ||
| 1242 | + GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.hlsPullListFinal[index].ip || ""; | ||
| 1243 | + GlobalConfig.MS_PLAY_HLS_PORT = GlobalConfig.hlsPullListFinal[index].port || ""; | ||
| 1244 | + } | ||
| 1192 | } | 1245 | } |
| 1193 | //如果HLS没有配置地址,那么还是使用推流的地址 | 1246 | //如果HLS没有配置地址,那么还是使用推流的地址 |
| 1194 | - if(!GlobalConfig.MS_PLAY_HLS_IP){ | 1247 | + if (!GlobalConfig.MS_PLAY_HLS_IP) { |
| 1195 | GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.RS_RECORD_PLAY_IP; | 1248 | GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.RS_RECORD_PLAY_IP; |
| 1196 | GlobalConfig.MS_PLAY_HLS_PORT = GlobalConfig.RS_RECORD_PLAY_PORT; | 1249 | GlobalConfig.MS_PLAY_HLS_PORT = GlobalConfig.RS_RECORD_PLAY_PORT; |
| 1197 | } | 1250 | } |
| @@ -1406,6 +1459,7 @@ export default class MessageEntrance extends Emiter { | @@ -1406,6 +1459,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1406 | callBack.type = 0; | 1459 | callBack.type = 0; |
| 1407 | } | 1460 | } |
| 1408 | loger.warn('离开课堂->', MessageTypes.CLASS_EXIT, callBack); | 1461 | loger.warn('离开课堂->', MessageTypes.CLASS_EXIT, callBack); |
| 1462 | + LogManager.sendLogToServer(); | ||
| 1409 | this._emit(MessageTypes.CLASS_EXIT, callBack); | 1463 | this._emit(MessageTypes.CLASS_EXIT, callBack); |
| 1410 | 1464 | ||
| 1411 | //断开MCU连接 | 1465 | //断开MCU连接 |
| @@ -1430,6 +1484,7 @@ export default class MessageEntrance extends Emiter { | @@ -1430,6 +1484,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1430 | GlobalConfig.maxAudioChannels = _data.maxAudioChannels; | 1484 | GlobalConfig.maxAudioChannels = _data.maxAudioChannels; |
| 1431 | GlobalConfig.maxMediaChannels = Math.max(GlobalConfig.maxVideoChannels, GlobalConfig.maxAudioChannels); | 1485 | GlobalConfig.maxMediaChannels = Math.max(GlobalConfig.maxVideoChannels, GlobalConfig.maxAudioChannels); |
| 1432 | 1486 | ||
| 1487 | + loger.warn("当前课堂允许最大推流数量-" + GlobalConfig.maxMediaChannels + " 视频频:" + GlobalConfig.maxVideoChannels + " 音频:" + GlobalConfig.maxAudioChannels); | ||
| 1433 | GlobalConfig.ssTunnelAppURL = _data.ssTunnelAppURL || ''; //屏幕共享插件的地址 | 1488 | GlobalConfig.ssTunnelAppURL = _data.ssTunnelAppURL || ''; //屏幕共享插件的地址 |
| 1434 | 1489 | ||
| 1435 | //视频质量相关设置,每次加入课堂都按最新的获取设置 | 1490 | //视频质量相关设置,每次加入课堂都按最新的获取设置 |
| @@ -1440,7 +1495,7 @@ export default class MessageEntrance extends Emiter { | @@ -1440,7 +1495,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1440 | 1495 | ||
| 1441 | //是否自动开始(身份是host的时候才用到的) | 1496 | //是否自动开始(身份是host的时候才用到的) |
| 1442 | GlobalConfig.isAutoStartClass = _data.autoRecord || 0; | 1497 | GlobalConfig.isAutoStartClass = _data.autoRecord || 0; |
| 1443 | - GlobalConfig.logUrl=_data.logUrl||""; | 1498 | + GlobalConfig.logUrl = _data.logUrl || ""; |
| 1444 | GlobalConfig.serverTime = _data.serverTime || new Date().getTime(); //获取服务器时间戳 | 1499 | GlobalConfig.serverTime = _data.serverTime || new Date().getTime(); //获取服务器时间戳 |
| 1445 | GlobalConfig.serverAndLoacTimeDistanc = (new Date().getTime() - GlobalConfig.serverTime) / 1000; //当前系统时间和服务器时间的差值 (秒) | 1500 | GlobalConfig.serverAndLoacTimeDistanc = (new Date().getTime() - GlobalConfig.serverTime) / 1000; //当前系统时间和服务器时间的差值 (秒) |
| 1446 | loger.warn("服务器时间:" + GlobalConfig.serverTime + " 系统时间:" + new Date().getTime() + " 时间差:" + GlobalConfig.serverAndLoacTimeDistanc); | 1501 | loger.warn("服务器时间:" + GlobalConfig.serverTime + " 系统时间:" + new Date().getTime() + " 时间差:" + GlobalConfig.serverAndLoacTimeDistanc); |
| @@ -1473,37 +1528,37 @@ export default class MessageEntrance extends Emiter { | @@ -1473,37 +1528,37 @@ export default class MessageEntrance extends Emiter { | ||
| 1473 | 1528 | ||
| 1474 | 1529 | ||
| 1475 | //存从Sass获取的MS和MCU服务列表 | 1530 | //存从Sass获取的MS和MCU服务列表 |
| 1476 | - let serverJsonStr=_data.serverJson; | ||
| 1477 | - try{ | ||
| 1478 | - ServerConfig.sassServerJson=JSON.parse(serverJsonStr);///Sass返回的Server数据 | ||
| 1479 | - }catch (err){ | ||
| 1480 | - loger.error("从SASS获取的SERVER数据解析失败",err.message); | 1531 | + let serverJsonStr = _data.serverJson; |
| 1532 | + try { | ||
| 1533 | + ServerConfig.sassServerJson = JSON.parse(serverJsonStr);///Sass返回的Server数据 | ||
| 1534 | + } catch (err) { | ||
| 1535 | + loger.error("从SASS获取的SERVER数据解析失败", err.message); | ||
| 1481 | } | 1536 | } |
| 1482 | 1537 | ||
| 1483 | /* | 1538 | /* |
| 1484 | - if (_data.msList2) { | ||
| 1485 | - GlobalConfig.setMsList(_data.msList2.msList); //储存Sass ms拉流地址 | ||
| 1486 | - GlobalConfig.setRtmpPullList(_data.msList2.rtmpPullArray); //储存Sass ms拉流地址 | ||
| 1487 | - GlobalConfig.setHlsPullList(_data.msList2.hlsPullArray); //储存Sass ms拉流地址 | ||
| 1488 | - GlobalConfig.setRsList(_data.msList2.rsList); //储存Sass 录制回放hls拉流地址 | ||
| 1489 | - } | ||
| 1490 | - //Sass mcu | ||
| 1491 | - GlobalConfig.setMcuList(_data.mcuList); //mcu | ||
| 1492 | - | ||
| 1493 | - | ||
| 1494 | - loger.warn('从Sass获取的推流拉流列表数据:'); | ||
| 1495 | - loger.warn('Sass->msList->', GlobalConfig.msList); | ||
| 1496 | - loger.warn('Sass->rtmpPullList->', GlobalConfig.rtmpPullList); | ||
| 1497 | - loger.warn('Sass->hlsPullList->', GlobalConfig.hlsPullList); | ||
| 1498 | - loger.warn('Sass->rsList->', GlobalConfig.rsList); | ||
| 1499 | - | ||
| 1500 | - //没有加载server.json之前,最终的服务列表按Sass的为准,server.json加载完成后会选点 | ||
| 1501 | - GlobalConfig.msListFinal=GlobalConfig.msList; | ||
| 1502 | - GlobalConfig.rtmpPullListFinal=GlobalConfig.rtmpPullList; | ||
| 1503 | - GlobalConfig.hlsListFinal=GlobalConfig.hlsPullList; | ||
| 1504 | - GlobalConfig.rsListFinal=GlobalConfig.rsList; | ||
| 1505 | - GlobalConfig.mcuListFinal=GlobalConfig.mcuList;*/ | ||
| 1506 | - } | 1539 | + if (_data.msList2) { |
| 1540 | + GlobalConfig.setMsList(_data.msList2.msList); //储存Sass ms拉流地址 | ||
| 1541 | + GlobalConfig.setRtmpPullList(_data.msList2.rtmpPullArray); //储存Sass ms拉流地址 | ||
| 1542 | + GlobalConfig.setHlsPullList(_data.msList2.hlsPullArray); //储存Sass ms拉流地址 | ||
| 1543 | + GlobalConfig.setRsList(_data.msList2.rsList); //储存Sass 录制回放hls拉流地址 | ||
| 1544 | + } | ||
| 1545 | + //Sass mcu | ||
| 1546 | + GlobalConfig.setMcuList(_data.mcuList); //mcu | ||
| 1547 | + | ||
| 1548 | + | ||
| 1549 | + loger.warn('从Sass获取的推流拉流列表数据:'); | ||
| 1550 | + loger.warn('Sass->msList->', GlobalConfig.msList); | ||
| 1551 | + loger.warn('Sass->rtmpPullList->', GlobalConfig.rtmpPullList); | ||
| 1552 | + loger.warn('Sass->hlsPullList->', GlobalConfig.hlsPullList); | ||
| 1553 | + loger.warn('Sass->rsList->', GlobalConfig.rsList); | ||
| 1554 | + | ||
| 1555 | + //没有加载server.json之前,最终的服务列表按Sass的为准,server.json加载完成后会选点 | ||
| 1556 | + GlobalConfig.msListFinal=GlobalConfig.msList; | ||
| 1557 | + GlobalConfig.rtmpPullListFinal=GlobalConfig.rtmpPullList; | ||
| 1558 | + GlobalConfig.hlsListFinal=GlobalConfig.hlsPullList; | ||
| 1559 | + GlobalConfig.rsListFinal=GlobalConfig.rsList; | ||
| 1560 | + GlobalConfig.mcuListFinal=GlobalConfig.mcuList;*/ | ||
| 1561 | + } | ||
| 1507 | 1562 | ||
| 1508 | //课堂获取Sass数据完成 | 1563 | //课堂获取Sass数据完成 |
| 1509 | this._emit(MessageTypes.CLASS_GET_INFO_SUCCESS, GlobalConfig.getClassInfo()); | 1564 | this._emit(MessageTypes.CLASS_GET_INFO_SUCCESS, GlobalConfig.getClassInfo()); |
| @@ -1530,7 +1585,7 @@ export default class MessageEntrance extends Emiter { | @@ -1530,7 +1585,7 @@ export default class MessageEntrance extends Emiter { | ||
| 1530 | //开启录制回放流程 | 1585 | //开启录制回放流程 |
| 1531 | loger.warn("开启录制回放流程"); | 1586 | loger.warn("开启录制回放流程"); |
| 1532 | //根据用户的userIp信息从sever.json和Sass中选择最终mcu和推流拉流数据列表 | 1587 | //根据用户的userIp信息从sever.json和Sass中选择最终mcu和推流拉流数据列表 |
| 1533 | - ServerConfig.serverList=ServerConfig.sassServerJson; | 1588 | + ServerConfig.serverList = ServerConfig.sassServerJson; |
| 1534 | this._choiceMcuAndMsListFromSass(); | 1589 | this._choiceMcuAndMsListFromSass(); |
| 1535 | //获取MCU和MS 推流拉流、录制回放的默认地址 | 1590 | //获取MCU和MS 推流拉流、录制回放的默认地址 |
| 1536 | this.getMcuAndMsDefaultServerIp(); | 1591 | this.getMcuAndMsDefaultServerIp(); |
| @@ -1603,184 +1658,6 @@ export default class MessageEntrance extends Emiter { | @@ -1603,184 +1658,6 @@ export default class MessageEntrance extends Emiter { | ||
| 1603 | 1658 | ||
| 1604 | } | 1659 | } |
| 1605 | 1660 | ||
| 1606 | - //获取课堂所有参数 api/meeting/detail.do? flash中的接口文件是 getClassParam.do(20170727之前的规则) | ||
| 1607 | - /*_sassGetClassParamSuccessHandler(_data) { | ||
| 1608 | - loger.log('获取课堂课堂信息完成.'); | ||
| 1609 | - //包含整个课堂最全的信息,储存数据 | ||
| 1610 | - if (_data) { | ||
| 1611 | - GlobalConfig.mcuDelay = _data.h5Delay || 0; //mcu消息延迟的时间间隔,单位(秒),结合客户端传的messageDelay的值使用 | ||
| 1612 | - GlobalConfig.className = _data.meetingName || ""; | ||
| 1613 | - GlobalConfig.classBeginTime = _data.beginTime || ""; | ||
| 1614 | - GlobalConfig.classEndTime = _data.endTime || ""; | ||
| 1615 | - GlobalConfig.userIp = _data.userIp || ""; | ||
| 1616 | - | ||
| 1617 | - GlobalConfig.maxVideoChannels = _data.maxVideoChannels; | ||
| 1618 | - GlobalConfig.maxAudioChannels = _data.maxAudioChannels; | ||
| 1619 | - GlobalConfig.maxMediaChannels = Math.max(GlobalConfig.maxVideoChannels, GlobalConfig.maxAudioChannels); | ||
| 1620 | - | ||
| 1621 | - GlobalConfig.ssTunnelAppURL = _data.ssTunnelAppURL || ''; //屏幕共享插件的地址 | ||
| 1622 | - | ||
| 1623 | - //视频质量相关设置,每次加入课堂都按最新的获取设置 | ||
| 1624 | - GlobalConfig.fps = _data.fps || 15; | ||
| 1625 | - GlobalConfig.gop = _data.gop || 3; | ||
| 1626 | - GlobalConfig.videoQuality = parseInt(_data.videoQuality); | ||
| 1627 | - GlobalConfig.curVideoQuality = GlobalConfig.videoQuality; | ||
| 1628 | - | ||
| 1629 | - //是否自动开始(身份是host的时候才用到的) | ||
| 1630 | - GlobalConfig.isAutoStartClass = _data.autoRecord || 0; | ||
| 1631 | - | ||
| 1632 | - GlobalConfig.serverTime = _data.serverTime || new Date().getTime(); //获取服务器时间戳 | ||
| 1633 | - GlobalConfig.serverAndLoacTimeDistanc = (new Date().getTime() - GlobalConfig.serverTime) / 1000; //当前系统时间和服务器时间的差值 (秒) | ||
| 1634 | - loger.warn("服务器时间:" + GlobalConfig.serverTime + " 系统时间:" + new Date().getTime() + " 时间差:" + GlobalConfig.serverAndLoacTimeDistanc); | ||
| 1635 | - | ||
| 1636 | - GlobalConfig.setDocListPrepare(_data.docListPrepare); //提前上传的文档列表 | ||
| 1637 | - GlobalConfig.setRecordList(_data.recordList); //录制回放地址 | ||
| 1638 | - GlobalConfig.setDocList(_data.docList); //文档地址 | ||
| 1639 | - GlobalConfig.setMsList(_data.msList); //推流播流服务器地址(需要对列表中的地址进行分类,里面包含了推流和拉流的地址,目前主要是乐视的需要区分开) | ||
| 1640 | - GlobalConfig.setRsList(_data.rsList); //播放m3u8格式的地址(录制回放时使用) | ||
| 1641 | - GlobalConfig.setMcuList(_data.mcuList); //mcu | ||
| 1642 | - GlobalConfig.setMusicList(_data.musicList); // | ||
| 1643 | - GlobalConfig.setMusicListPrepare(_data.musicListPrepare); //提前上传的声音文件列表 | ||
| 1644 | - GlobalConfig.setVideoCDNAddr(_data.videoCDNAddr); //cdn加速的拉流地址,直播的时候才使用 | ||
| 1645 | - GlobalConfig.setMediaShareList(_data.sharedMediaList); //提前上传的媒体共享文件列表 | ||
| 1646 | - | ||
| 1647 | - //MCU地址 | ||
| 1648 | - if (_data.mcuList && _data.mcuList.length > 0) { | ||
| 1649 | - //随机选择一个 | ||
| 1650 | - let index = parseInt(Math.random() * _data.mcuList.length); | ||
| 1651 | - GlobalConfig.MCUServerIP = _data.mcuList[index].ip || ""; | ||
| 1652 | - GlobalConfig.MCUServerPort = _data.mcuList[index].port || ""; | ||
| 1653 | - loger.log('初始->MCU->.', GlobalConfig.MCUServerIP, GlobalConfig.MCUServerPort); | ||
| 1654 | - } | ||
| 1655 | - | ||
| 1656 | - //录制回放时m3u8播流地址 | ||
| 1657 | - if (_data.rsList && _data.rsList.length > 0) { | ||
| 1658 | - let index = parseInt(Math.random() * _data.rsList.length); | ||
| 1659 | - GlobalConfig.RS_RECORD_PLAY_IP = _data.rsList[index].ip || ""; | ||
| 1660 | - GlobalConfig.RS_RECORD_PLAY_PORT = _data.rsList[index].port || ""; | ||
| 1661 | - loger.log('初始->RS->.', GlobalConfig.RS_RECORD_PLAY_IP, GlobalConfig.RS_RECORD_PLAY_PORT); | ||
| 1662 | - } | ||
| 1663 | - | ||
| 1664 | - //上课中音视频推流地址 | ||
| 1665 | - if (GlobalConfig.msList && GlobalConfig.msList.length > 0) { | ||
| 1666 | - let index = parseInt(Math.random() * GlobalConfig.msList.length); | ||
| 1667 | - GlobalConfig.MS_PUBLISH_IP = GlobalConfig.msList[index].ip || ""; | ||
| 1668 | - GlobalConfig.MS_PUBLISH_PORT = GlobalConfig.msList[index].port || ""; | ||
| 1669 | - } | ||
| 1670 | - loger.log('初始->MS->.', GlobalConfig.MS_PUBLISH_IP, GlobalConfig.MS_PUBLISH_PORT); | ||
| 1671 | - | ||
| 1672 | - //播流的地址和推流地址需要分开的时候,单独设置拉流的地址 rtmp(目前乐视使用) | ||
| 1673 | - if (GlobalConfig.rtmpPullList && GlobalConfig.rtmpPullList.length > 0) { | ||
| 1674 | - //有单独的rtmp拉流地址 | ||
| 1675 | - let index = parseInt(Math.random() * GlobalConfig.rtmpPullList.length); | ||
| 1676 | - GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.rtmpPullList[index].ip || ""; | ||
| 1677 | - GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.rtmpPullList[index].port || ""; | ||
| 1678 | - } else { | ||
| 1679 | - //如果没有单独的rtmp拉流地址,和推流地址一样即可 | ||
| 1680 | - GlobalConfig.MS_PLAY_RTMP_IP = GlobalConfig.MS_PUBLISH_IP; | ||
| 1681 | - GlobalConfig.MS_PLAY_RTMP_PORT = GlobalConfig.MS_PUBLISH_PORT; | ||
| 1682 | - } | ||
| 1683 | - | ||
| 1684 | - loger.log('初始->MSPull->.', GlobalConfig.MS_PLAY_RTMP_IP, GlobalConfig.MS_PLAY_RTMP_PORT); | ||
| 1685 | - | ||
| 1686 | - //播流的地址和推流地址需要分开的时候,单独设置拉流的地址 hls(目前乐视使用) | ||
| 1687 | - if (GlobalConfig.hlsList && GlobalConfig.hlsList.length > 0) { | ||
| 1688 | - //有单独的hls拉流地址 | ||
| 1689 | - let index = parseInt(Math.random() * GlobalConfig.hlsList.length); | ||
| 1690 | - GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.hlsList[index].ip || ""; | ||
| 1691 | - GlobalConfig.MS_PLAY_HLS_PORT = GlobalConfig.hlsList[index].port || ""; | ||
| 1692 | - } else { | ||
| 1693 | - //没有单独的hls拉流地址,和录制回放地址一样即可 | ||
| 1694 | - GlobalConfig.MS_PLAY_HLS_IP = GlobalConfig.RS_RECORD_PLAY_IP; | ||
| 1695 | - GlobalConfig.MS_PLAY_HLS_PORT = GlobalConfig.RS_RECORD_PLAY_PORT; | ||
| 1696 | - } | ||
| 1697 | - loger.log('初始->MSHls->.', GlobalConfig.MS_PLAY_HLS_IP, GlobalConfig.MS_PLAY_HLS_PORT); | ||
| 1698 | - | ||
| 1699 | - //直播的时候,拉流(rtmp和hls)需要从 videoCDNAddr中获取 | ||
| 1700 | - //20170531-新规则,所有课堂类型都支持加速 | ||
| 1701 | - // if(GlobalConfig.classType==ApeConsts.CLASS_TYPE_2&&GlobalConfig.videoCDNAddrList.length>0){ | ||
| 1702 | - | ||
| 1703 | - //20170629-直播课堂和移动端设备的时候支持 | ||
| 1704 | - if (GlobalConfig.classType == ApeConsts.CLASS_TYPE_2 || GlobalConfig.isMobile) { | ||
| 1705 | - if (GlobalConfig.videoCDNAddrList.length > 0) { | ||
| 1706 | - //videoCDNAddrList中rtmppush和hls是混在一起的,需要分离开; | ||
| 1707 | - let listLen = GlobalConfig.videoCDNAddrList.length; | ||
| 1708 | - for (let i = 0; i < listLen; i++) { | ||
| 1709 | - let ipItem = GlobalConfig.videoCDNAddrList[i]; | ||
| 1710 | - if (ipItem) { | ||
| 1711 | - if (ipItem.indexOf('hls') >= 0) { | ||
| 1712 | - //直播的时候m3u8拉流地址 | ||
| 1713 | - GlobalConfig.MS_PLAY_HLS_IP = ipItem; //ip包含了端口 | ||
| 1714 | - GlobalConfig.MS_PLAY_HLS_PORT = ""; | ||
| 1715 | - loger.log('videoCDNAddr>初始->MSHls', GlobalConfig.MS_PLAY_HLS_IP); | ||
| 1716 | - } | ||
| 1717 | - if (ipItem.indexOf('rtmppull')>= 0) { | ||
| 1718 | - //直播的时候rtmp拉流地址 | ||
| 1719 | - GlobalConfig.MS_PLAY_RTMP_IP = ipItem; //ip包含了端口 | ||
| 1720 | - GlobalConfig.MS_PLAY_RTMP_PORT = ''; | ||
| 1721 | - loger.log('videoCDNAddr->初始->MSPull', GlobalConfig.MS_PLAY_RTMP_IP); | ||
| 1722 | - } | ||
| 1723 | - } | ||
| 1724 | - } | ||
| 1725 | - } else { | ||
| 1726 | - loger.error('videoCDNAddr数据无效->', GlobalConfig.videoCDNAddr); | ||
| 1727 | - } | ||
| 1728 | - } else { | ||
| 1729 | - loger.warn('非直播课堂或不是移动端->不需要videoCDN加速'); | ||
| 1730 | - } | ||
| 1731 | - | ||
| 1732 | - //文档地址 | ||
| 1733 | - if (_data.docList && _data.docList.length > 0) { | ||
| 1734 | - //doc上传地址,随机获取一个 | ||
| 1735 | - let index = parseInt(Math.random() * _data.docList.length); | ||
| 1736 | - loger.log("docServer->", _data.docList[index]); | ||
| 1737 | - GlobalConfig.DOCServerIP = _data.docList[index].ip || ""; | ||
| 1738 | - GlobalConfig.DOCServerPort = _data.docList[index].port || ""; | ||
| 1739 | - loger.log('初始->DOC->.', GlobalConfig.DOCServerIP, GlobalConfig.DOCServerPort); | ||
| 1740 | - } | ||
| 1741 | - | ||
| 1742 | - //record | ||
| 1743 | - if (_data.recordList && _data.recordList.length > 0) { | ||
| 1744 | - let index = parseInt(Math.random() * _data.recordList.length); | ||
| 1745 | - GlobalConfig.RecordServerIP = _data.recordList[index].ip || ""; | ||
| 1746 | - GlobalConfig.RecordServerPort = _data.recordList[index].port || ""; | ||
| 1747 | - loger.log('初始->RECORD->.', GlobalConfig.RecordServerIP, GlobalConfig.RecordServerPort); | ||
| 1748 | - } | ||
| 1749 | - | ||
| 1750 | - } | ||
| 1751 | - //这里需要考虑是否加延迟处理,课堂信息刚获取完成,客户端需要根据数据创建界面UI,等创建完成后再加入课堂是最合适的(目前没有加延迟) | ||
| 1752 | - this._emit(MessageTypes.CLASS_GET_INFO_SUCCESS, GlobalConfig.getClassInfo()); | ||
| 1753 | - | ||
| 1754 | - if (_data.currentInfo) { | ||
| 1755 | - //根据从Sass获取的数据信息,同步最后一次保存的课堂状态信息 | ||
| 1756 | - loger.log("本地同步最后一次保存过的课堂状态信息"); | ||
| 1757 | - try { | ||
| 1758 | - GlobalConfig.setClassStatusInfo(JSON.parse(_data.currentInfo)); | ||
| 1759 | - } catch (err) { | ||
| 1760 | - loger.warn("从Sass获取的课堂数据JSON转换失败->"); | ||
| 1761 | - console.log("currentInfo", _data.currentInfo); | ||
| 1762 | - GlobalConfig.setClassStatusInfo(_data.currentInfo); | ||
| 1763 | - } | ||
| 1764 | - loger.log(GlobalConfig.classStatusInfo); | ||
| 1765 | - } else { | ||
| 1766 | - loger.log("还没有保存过课堂状信息"); | ||
| 1767 | - } | ||
| 1768 | - | ||
| 1769 | - //录制回放不需要获取ip信息和选点 | ||
| 1770 | - if (GlobalConfig.isRecordPlayBack) { | ||
| 1771 | - if (_recordPlayback) { | ||
| 1772 | - //开启录制回放流程 | ||
| 1773 | - loger.log("开启录制回放流程"); | ||
| 1774 | - _recordPlayback.readyRecordPlay(); | ||
| 1775 | - } else { | ||
| 1776 | - loger.warn("开启录制回放流程失败->还未创建模块"); | ||
| 1777 | - } | ||
| 1778 | - } else { | ||
| 1779 | - //根据用户的userIp获取信息,选点 | ||
| 1780 | - this.getUserIpInfo(); | ||
| 1781 | - } | ||
| 1782 | - }*/ | ||
| 1783 | - | ||
| 1784 | //ChatApe | 1661 | //ChatApe |
| 1785 | // 发送聊天消息 | 1662 | // 发送聊天消息 |
| 1786 | _sendChatMsg(_messageInfo) { | 1663 | _sendChatMsg(_messageInfo) { |
| @@ -2330,7 +2207,7 @@ export default class MessageEntrance extends Emiter { | @@ -2330,7 +2207,7 @@ export default class MessageEntrance extends Emiter { | ||
| 2330 | "fileId": "" + value.id, | 2207 | "fileId": "" + value.id, |
| 2331 | "fileName": value.name, | 2208 | "fileName": value.name, |
| 2332 | "seek": 0, | 2209 | "seek": 0, |
| 2333 | - "duration":parseInt(value.duration)||0 | 2210 | + "duration": parseInt(value.duration) || 0 |
| 2334 | }; | 2211 | }; |
| 2335 | this._sendMusicSharedUpload(paramInfo); | 2212 | this._sendMusicSharedUpload(paramInfo); |
| 2336 | } | 2213 | } |
| @@ -2356,7 +2233,7 @@ export default class MessageEntrance extends Emiter { | @@ -2356,7 +2233,7 @@ export default class MessageEntrance extends Emiter { | ||
| 2356 | "fileId": "" + value.id, | 2233 | "fileId": "" + value.id, |
| 2357 | "fileName": value.name, | 2234 | "fileName": value.name, |
| 2358 | "seek": 0, | 2235 | "seek": 0, |
| 2359 | - "duration":parseInt(value.duration)||0 | 2236 | + "duration": parseInt(value.duration) || 0 |
| 2360 | }; | 2237 | }; |
| 2361 | this._sendMediaSharedUpload(paramInfo); | 2238 | this._sendMediaSharedUpload(paramInfo); |
| 2362 | } | 2239 | } |
| @@ -2440,6 +2317,7 @@ export default class MessageEntrance extends Emiter { | @@ -2440,6 +2317,7 @@ export default class MessageEntrance extends Emiter { | ||
| 2440 | //录制回放加入 课堂成功 | 2317 | //录制回放加入 课堂成功 |
| 2441 | _joinRecordPlaybackSuccessHandler(_data) { | 2318 | _joinRecordPlaybackSuccessHandler(_data) { |
| 2442 | loger.log('加入录制回放成功.'); | 2319 | loger.log('加入录制回放成功.'); |
| 2320 | + LogManager.IS_OPEN_SEND_LOG=false;//录制回放不需要上报日志 | ||
| 2443 | GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_2); | 2321 | GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_2); |
| 2444 | 2322 | ||
| 2445 | //返回给客户端初始化成功的数据 | 2323 | //返回给客户端初始化成功的数据 |
| @@ -29,6 +29,9 @@ class EverSocket extends Emiter { | @@ -29,6 +29,9 @@ class EverSocket extends Emiter { | ||
| 29 | begin(ip, port) { | 29 | begin(ip, port) { |
| 30 | this._clearHistory(); | 30 | this._clearHistory(); |
| 31 | loger.log('开始WebSocket应用.'); | 31 | loger.log('开始WebSocket应用.'); |
| 32 | + if(!ip){ | ||
| 33 | + loger.error('开始MCU连接->MCU连接地址无效'); | ||
| 34 | + } | ||
| 32 | this._enableEverSocket = true; | 35 | this._enableEverSocket = true; |
| 33 | this.wsURL = 'ws://' + ip + ':' + port; | 36 | this.wsURL = 'ws://' + ip + ':' + port; |
| 34 | this._newConnection(); | 37 | this._newConnection(); |
| @@ -51,10 +54,8 @@ class EverSocket extends Emiter { | @@ -51,10 +54,8 @@ class EverSocket extends Emiter { | ||
| 51 | 54 | ||
| 52 | send(data) { | 55 | send(data) { |
| 53 | if (this._connected) { | 56 | if (this._connected) { |
| 54 | - if (data) { | ||
| 55 | - loger.log('SEND MESSAGE-->byteLength->', data.byteLength); | ||
| 56 | - } else { | ||
| 57 | - loger.log('SEND MESSAGE---->'); | 57 | + if (data&& data.byteLength>1024) { |
| 58 | + loger.warn('发送到MCU的数据文件超过1k-->byteLength->', data.byteLength); | ||
| 58 | } | 59 | } |
| 59 | this.websocket.send(data); | 60 | this.websocket.send(data); |
| 60 | } else { | 61 | } else { |
| @@ -168,7 +169,7 @@ class EverSocket extends Emiter { | @@ -168,7 +169,7 @@ class EverSocket extends Emiter { | ||
| 168 | _onMessage(messageEvent) { | 169 | _onMessage(messageEvent) { |
| 169 | this._lastActiveTime = Date.now(); | 170 | this._lastActiveTime = Date.now(); |
| 170 | const bufferData = messageEvent.data; | 171 | const bufferData = messageEvent.data; |
| 171 | - loger.log('RECEIVE MESSAGE-->byteLength->',bufferData.byteLength); | 172 | + //loger.log('RECEIVE MESSAGE-->byteLength->',bufferData.byteLength); |
| 172 | if (bufferData.byteLength > 0) { | 173 | if (bufferData.byteLength > 0) { |
| 173 | this._emit(EverSocket.MESSAGE, bufferData); | 174 | this._emit(EverSocket.MESSAGE, bufferData); |
| 174 | } | 175 | } |
| @@ -452,7 +452,9 @@ GlobalConfig.microphones = []; //麦克风列表 | @@ -452,7 +452,9 @@ GlobalConfig.microphones = []; //麦克风列表 | ||
| 452 | 452 | ||
| 453 | GlobalConfig.curCamera = ""; //当前选择的摄像头 | 453 | GlobalConfig.curCamera = ""; //当前选择的摄像头 |
| 454 | GlobalConfig.curMicrophone = ''; //当前选择的麦克风 | 454 | GlobalConfig.curMicrophone = ''; //当前选择的麦克风 |
| 455 | -GlobalConfig.micGain = 50; //音量(0-80) | 455 | +GlobalConfig.micGain = 50; //音量(0-100) |
| 456 | +GlobalConfig.micNoise = 50; //(0-100) | ||
| 457 | +GlobalConfig.autoGain = false; //自动调节麦克风音量 | ||
| 456 | GlobalConfig.speakerVolume = 50; //扬声器音量(0-80) | 458 | GlobalConfig.speakerVolume = 50; //扬声器音量(0-80) |
| 457 | GlobalConfig.micCode = 0; //麦克风模式 | 459 | GlobalConfig.micCode = 0; //麦克风模式 |
| 458 | 460 |
| @@ -24,6 +24,14 @@ class IpManager extends Emiter { | @@ -24,6 +24,14 @@ class IpManager extends Emiter { | ||
| 24 | } | 24 | } |
| 25 | //获取本地Server JSON | 25 | //获取本地Server JSON |
| 26 | loadServerJosn(_callback){ | 26 | loadServerJosn(_callback){ |
| 27 | + //20170803-不再加载本地的server.json数据,以后都从Sass获取 | ||
| 28 | + if (_callback) { | ||
| 29 | + _callback(serverInfo); | ||
| 30 | + return; | ||
| 31 | + } | ||
| 32 | + return; | ||
| 33 | + | ||
| 34 | + //-------------加载本地数据的代码------------------- | ||
| 27 | let serverInfo = { | 35 | let serverInfo = { |
| 28 | ret: -1 | 36 | ret: -1 |
| 29 | }; | 37 | }; |
src/LogManager.js
0 → 100644
| 1 | +/** | ||
| 2 | + * | ||
| 3 | + * LOG 信息管理(上传和输出) | ||
| 4 | + * */ | ||
| 5 | + | ||
| 6 | +class LogManager { | ||
| 7 | + constructor() { | ||
| 8 | + | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + /* | ||
| 12 | + * 添加需要上报的日志信息到队列中 | ||
| 13 | + * _type | ||
| 14 | + * _msg | ||
| 15 | + * */ | ||
| 16 | + static addLog(_type, _msg) { | ||
| 17 | + //无效的数据不上报 | ||
| 18 | + if (!_msg) { | ||
| 19 | + return; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + if (this.IS_OPEN_SEND_LOG == true || this.IS_OPEN_SEND_LOG == "true") { | ||
| 23 | + //显示格式20170729 16:42:00 INFO _msg | ||
| 24 | + let sendMsgStr = ""; | ||
| 25 | + switch (_type) { | ||
| 26 | + case this.ERROR: | ||
| 27 | + sendMsgStr = this.getCurrentDateTime() + " ERROR " + _msg; | ||
| 28 | + //this.errorList.push(sendMsgStr); | ||
| 29 | + break; | ||
| 30 | + case this.WARN: | ||
| 31 | + sendMsgStr = this.getCurrentDateTime() + " WARN " + _msg; | ||
| 32 | + //this.warnList.push(sendMsgStr); | ||
| 33 | + break; | ||
| 34 | + case this.LOG: | ||
| 35 | + sendMsgStr = this.getCurrentDateTime() + " INFO " + _msg; | ||
| 36 | + // this.logList.push(sendMsgStr); | ||
| 37 | + break; | ||
| 38 | + default: | ||
| 39 | + sendMsgStr = this.getCurrentDateTime() + " INFO " + _msg; | ||
| 40 | + // this.logList.push(sendMsgStr); | ||
| 41 | + break; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + this.allLogList.push(sendMsgStr); | ||
| 45 | + let _this = this; | ||
| 46 | + clearTimeout(this.logDelayTimer); | ||
| 47 | + this.logDelayTimer = setTimeout(function () { | ||
| 48 | + _this.checkAndSendLog(); | ||
| 49 | + }, 1600); | ||
| 50 | + } | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + static checkAndSendLog() { | ||
| 54 | + //发送日志 | ||
| 55 | + /*this.sendLogToServer(LogManager.ERROR); | ||
| 56 | + this.sendLogToServer(LogManager.WARN); | ||
| 57 | + this.sendLogToServer(LogManager.LOG);*/ | ||
| 58 | + //不区分日志类型,按时间先后顺序发送 | ||
| 59 | + this.sendLogToServer(-1); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + //发送log到服务器 | ||
| 63 | + static sendLogToServer(_msgType) { | ||
| 64 | + if (!this.logUrl) { | ||
| 65 | + console.warn("日志服务器地址无效->无法上传日志"); | ||
| 66 | + return; | ||
| 67 | + } | ||
| 68 | + const msgType = _msgType; | ||
| 69 | + let msgData = ""; | ||
| 70 | + let tempArr = []; | ||
| 71 | + let msgLen = 0; | ||
| 72 | + | ||
| 73 | + /* switch (msgType) { | ||
| 74 | + case LogManager.ERROR: | ||
| 75 | + msgLen = this.errorList.length; | ||
| 76 | + for (let i = 0; i < msgLen; i++) { | ||
| 77 | + let item = this.errorList.shift(); | ||
| 78 | + if (item) { | ||
| 79 | + tempArr.push(item); | ||
| 80 | + msgData += item + " \n "; | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + break; | ||
| 84 | + case LogManager.WARN: | ||
| 85 | + msgLen = this.warnList.length; | ||
| 86 | + for (let i = 0; i < msgLen; i++) { | ||
| 87 | + let item = this.warnList.shift(); | ||
| 88 | + if (item) { | ||
| 89 | + tempArr.push(item); | ||
| 90 | + msgData += item + " \n "; | ||
| 91 | + } | ||
| 92 | + } | ||
| 93 | + break; | ||
| 94 | + case LogManager.LOG: | ||
| 95 | + msgLen = this.logList.length; | ||
| 96 | + for (let i = 0; i < msgLen; i++) { | ||
| 97 | + let item = this.logList.shift(); | ||
| 98 | + if (item) { | ||
| 99 | + tempArr.push(item); | ||
| 100 | + msgData += item + " \n "; | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + break; | ||
| 104 | + default: | ||
| 105 | + msgLen = this.allLogList.length; | ||
| 106 | + for (let i = 0; i < msgLen; i++) { | ||
| 107 | + let item = this.allLogList.shift(); | ||
| 108 | + if (item) { | ||
| 109 | + tempArr.push(item); | ||
| 110 | + msgData += item + " \n "; | ||
| 111 | + } | ||
| 112 | + } | ||
| 113 | + break; | ||
| 114 | + } | ||
| 115 | + */ | ||
| 116 | + msgLen = this.allLogList.length; | ||
| 117 | + for (let i = 0; i < msgLen; i++) { | ||
| 118 | + let item = this.allLogList.shift(); | ||
| 119 | + if (item) { | ||
| 120 | + tempArr.push(item); | ||
| 121 | + msgData += item + " \n "; | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + if (tempArr.length < 1 || !msgData) { | ||
| 126 | + //console.log("没有数据->不需要上报"); | ||
| 127 | + return; | ||
| 128 | + } | ||
| 129 | + //console.log("上报的日志->", tempArr, msgData); | ||
| 130 | + //需要过滤掉&字符,否则Sass无法取数据 | ||
| 131 | + msgData=msgData.replace(/&/g,"#"); | ||
| 132 | + fetch(encodeURI(this.logUrl), { | ||
| 133 | + method: 'POST', | ||
| 134 | + headers: { | ||
| 135 | + "Content-Type": "application/x-www-form-urlencoded; charset=utf-8" | ||
| 136 | + }, | ||
| 137 | + body: `classId=${this.classId}&userId=${this.userId}&nodeId=${this.nodeId}&type=${msgType}&data=${msgData}`, | ||
| 138 | + timeout: 3000 | ||
| 139 | + }) | ||
| 140 | + .then(ret => { | ||
| 141 | + if (ret.ok) { | ||
| 142 | + return ret.json(); | ||
| 143 | + } else { | ||
| 144 | + console.error(`保存日志信息-网络异常.状态码:${ret.status}`); | ||
| 145 | + throw ''; | ||
| 146 | + } | ||
| 147 | + }) | ||
| 148 | + .then(ret => { | ||
| 149 | + if (ret == 0) { | ||
| 150 | + console.log('保存日志信息 完成'); | ||
| 151 | + tempArr=[]; | ||
| 152 | + } else { | ||
| 153 | + console.warn('保存日志信息 失败.', ret); | ||
| 154 | + this.allLogList=tempArr.concat(this.allLogList); | ||
| 155 | + tempArr=[]; | ||
| 156 | + } | ||
| 157 | + }) | ||
| 158 | + .catch(err => { | ||
| 159 | + console.error(`保存日志信息.状态码:${err}`); | ||
| 160 | + this.allLogList=tempArr.concat(this.allLogList); | ||
| 161 | + tempArr=[] | ||
| 162 | + }); | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + //计算当前服务器时间 | ||
| 166 | + static getCurrentDateTime() { | ||
| 167 | + let currentServerTime = new Date().getTime() - this.serverAndLoacTimeDistanc * 1000;//计算当前服务器时间 | ||
| 168 | + let timeStr = new Date(currentServerTime).toLocaleString(); | ||
| 169 | + if (timeStr) { | ||
| 170 | + timeStr = timeStr.replace(/年|月/g, "-").replace(/日/g, " "); | ||
| 171 | + } | ||
| 172 | + return timeStr; | ||
| 173 | + } | ||
| 174 | +} | ||
| 175 | +LogManager.allLogList = [];//所有需要上报的日志列表 | ||
| 176 | +LogManager.logList = [];//日志上报列表 | ||
| 177 | +LogManager.warnList = [];//警告日志上报列表 | ||
| 178 | +LogManager.errorList = [];//错误日志上报列表 | ||
| 179 | + | ||
| 180 | +LogManager.serverAndLoacTimeDistanc = 0;//本地时间和服务器时间的差值(秒) | ||
| 181 | +LogManager.classId = 0;//课堂号 | ||
| 182 | +LogManager.userId = "";//userId | ||
| 183 | +LogManager.nodeId = 0;//nodeId | ||
| 184 | +LogManager.userName = "";//用户名称 | ||
| 185 | +LogManager.logUrl = "";//日志服务器地址 //http://log.3mang.com:8888 | ||
| 186 | + | ||
| 187 | +LogManager.ERROR = 1; | ||
| 188 | +LogManager.WARN = 2; | ||
| 189 | +LogManager.LOG = 3; | ||
| 190 | + | ||
| 191 | +LogManager.DATA = 5; | ||
| 192 | +LogManager.logDelayTimer = 0; | ||
| 193 | +LogManager.IS_OPEN_SEND_LOG = true;//是否上报日志 | ||
| 194 | +export default LogManager; | ||
| 195 | + |
| @@ -13,6 +13,8 @@ | @@ -13,6 +13,8 @@ | ||
| 13 | // | 13 | // |
| 14 | // ////////////////////////////////////////////////////////////////////////////// | 14 | // ////////////////////////////////////////////////////////////////////////////// |
| 15 | 15 | ||
| 16 | +import LogManager from "./LogManager"; | ||
| 17 | + | ||
| 16 | class Loger { | 18 | class Loger { |
| 17 | constructor(info) { | 19 | constructor(info) { |
| 18 | this.sdkInfo = info || ''; | 20 | this.sdkInfo = info || ''; |
| @@ -20,8 +22,8 @@ class Loger { | @@ -20,8 +22,8 @@ class Loger { | ||
| 20 | } | 22 | } |
| 21 | 23 | ||
| 22 | initId() { | 24 | initId() { |
| 23 | - if(!this.sdkInfo){ | ||
| 24 | - console.log("this.sdkInfo无效-->",this.sdkInfo); | 25 | + if (!this.sdkInfo) { |
| 26 | + console.log("this.sdkInfo无效-->", this.sdkInfo); | ||
| 25 | return ''; | 27 | return ''; |
| 26 | } | 28 | } |
| 27 | const infoType = Object.prototype.toString.call(this.sdkInfo); | 29 | const infoType = Object.prototype.toString.call(this.sdkInfo); |
| @@ -32,15 +34,6 @@ class Loger { | @@ -32,15 +34,6 @@ class Loger { | ||
| 32 | return this.sdkInfo.mid || ''; | 34 | return this.sdkInfo.mid || ''; |
| 33 | } | 35 | } |
| 34 | return ''; | 36 | return ''; |
| 35 | - | ||
| 36 | - /* const infoType = this.sdkInfo.constructor.name.toLowerCase(); | ||
| 37 | - if (infoType === 'string') { | ||
| 38 | - return this.sdkInfo; | ||
| 39 | - } | ||
| 40 | - if (infoType === 'object') { | ||
| 41 | - return this.sdkInfo.mid || ''; | ||
| 42 | - } | ||
| 43 | - return '';*/ | ||
| 44 | } | 37 | } |
| 45 | 38 | ||
| 46 | log(...msg) { | 39 | log(...msg) { |
| @@ -54,40 +47,57 @@ class Loger { | @@ -54,40 +47,57 @@ class Loger { | ||
| 54 | error(...msg) { | 47 | error(...msg) { |
| 55 | this._log(Loger.ERROR, msg); | 48 | this._log(Loger.ERROR, msg); |
| 56 | } | 49 | } |
| 50 | + | ||
| 57 | data(...msg) { | 51 | data(...msg) { |
| 58 | this._log(Loger.DATA, msg); | 52 | this._log(Loger.DATA, msg); |
| 59 | } | 53 | } |
| 54 | + | ||
| 60 | _log(type, msg) { | 55 | _log(type, msg) { |
| 61 | - if(!Loger.IS_DEBUG){ | ||
| 62 | - return; | ||
| 63 | - } | ||
| 64 | msg = JSON.stringify(msg); | 56 | msg = JSON.stringify(msg); |
| 65 | let logMsg = `${this.id} -> ${msg}`; | 57 | let logMsg = `${this.id} -> ${msg}`; |
| 66 | - if (type >= Loger.logLevel) { | ||
| 67 | - switch (type) { | 58 | + switch (type) { |
| 68 | case Loger.LOG: | 59 | case Loger.LOG: |
| 69 | - console.log(logMsg); | 60 | + Loger.LogManager.addLog(Loger.LOG, logMsg); |
| 61 | + //如果是debug模式就输出 | ||
| 62 | + if (Loger.IS_DEBUG) { | ||
| 63 | + console.log(logMsg); | ||
| 64 | + } | ||
| 70 | break; | 65 | break; |
| 71 | case Loger.WARN: | 66 | case Loger.WARN: |
| 72 | - console.warn(logMsg); | 67 | + Loger.LogManager.addLog(Loger.WARN, logMsg); |
| 68 | + //如果是debug模式就输出 | ||
| 69 | + if (Loger.IS_DEBUG) { | ||
| 70 | + console.warn(logMsg); | ||
| 71 | + } | ||
| 73 | break; | 72 | break; |
| 74 | case Loger.ERROR: | 73 | case Loger.ERROR: |
| 75 | - console.error(logMsg); | 74 | + Loger.LogManager.addLog(Loger.ERROR, logMsg); |
| 75 | + //如果是debug模式就输出 | ||
| 76 | + if (Loger.IS_DEBUG) { | ||
| 77 | + console.error(logMsg); | ||
| 78 | + } | ||
| 76 | break; | 79 | break; |
| 77 | case Loger.DATA: | 80 | case Loger.DATA: |
| 81 | + //如果是debug模式就输出 | ||
| 82 | + if (Loger.IS_DEBUG) { | ||
| 78 | console.log(logMsg); | 83 | console.log(logMsg); |
| 79 | - break; | ||
| 80 | - } | 84 | + } |
| 85 | + break; | ||
| 86 | + default : | ||
| 87 | + break; | ||
| 81 | } | 88 | } |
| 82 | } | 89 | } |
| 83 | } | 90 | } |
| 84 | -Loger.IS_DEBUG=true; | ||
| 85 | -Loger.LOG = 0; | ||
| 86 | -Loger.WARN = 1; | ||
| 87 | -Loger.ERROR = 2; | 91 | + |
| 92 | +Loger.IS_DEBUG = true; | ||
| 93 | +Loger.LOG = 3; | ||
| 94 | +Loger.WARN = 2; | ||
| 95 | +Loger.ERROR = 1; | ||
| 88 | Loger.NO = Infinity; | 96 | Loger.NO = Infinity; |
| 89 | -Loger.logLevel = Loger.LOG; | 97 | +Loger.logLevel = 0; |
| 90 | Loger.DATA = 5; | 98 | Loger.DATA = 5; |
| 99 | +Loger.LogManager = LogManager; | ||
| 100 | + | ||
| 91 | export default { | 101 | export default { |
| 92 | getLoger: function getLoger(info) { | 102 | getLoger: function getLoger(info) { |
| 93 | return new Loger(info); | 103 | return new Loger(info); |
| @@ -103,6 +113,7 @@ export default { | @@ -103,6 +113,7 @@ export default { | ||
| 103 | ERROR: Loger.ERROR, | 113 | ERROR: Loger.ERROR, |
| 104 | NO: Loger.NO, | 114 | NO: Loger.NO, |
| 105 | DATA: Loger.DATA, | 115 | DATA: Loger.DATA, |
| 106 | - IS_DEBUG:Loger.IS_DEBUG, | 116 | + IS_DEBUG: Loger.IS_DEBUG, |
| 117 | + LogManager: LogManager | ||
| 107 | }; | 118 | }; |
| 108 | 119 |
| @@ -221,7 +221,7 @@ class RecordPlayBackParse extends Emiter { | @@ -221,7 +221,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 221 | 221 | ||
| 222 | _timerCounterUptate() { | 222 | _timerCounterUptate() { |
| 223 | this._recordPlaybackTimestamp = this._recordPlaybackTimestamp + 1;//计时 | 223 | this._recordPlaybackTimestamp = this._recordPlaybackTimestamp + 1;//计时 |
| 224 | - loger.log("录制回放中...", this._recordPlaybackTimestamp); | 224 | + //loger.log("录制回放中...", this._recordPlaybackTimestamp); |
| 225 | this._emit(MessageTypes.CLASS_UPDATE_TIMER, {"classTimestamp": this._recordPlaybackTimestamp}); | 225 | this._emit(MessageTypes.CLASS_UPDATE_TIMER, {"classTimestamp": this._recordPlaybackTimestamp}); |
| 226 | 226 | ||
| 227 | if (this._recordPlaybackTimestamp >= this._recordPlaybackMaxTime) { | 227 | if (this._recordPlaybackTimestamp >= this._recordPlaybackMaxTime) { |
| @@ -118,11 +118,11 @@ export default class Ape extends Emiter { | @@ -118,11 +118,11 @@ export default class Ape extends Emiter { | ||
| 118 | let object_id = regUpdatedItem.objId; | 118 | let object_id = regUpdatedItem.objId; |
| 119 | let user_data = regUpdatedItem.userData; | 119 | let user_data = regUpdatedItem.userData; |
| 120 | 120 | ||
| 121 | - loger.log('REG OBJECT EVENT ->', pdu.id2type(sub_type)); | 121 | + //loger.log('REG OBJECT EVENT ->', pdu.id2type(sub_type)); |
| 122 | switch (sub_type) { | 122 | switch (sub_type) { |
| 123 | case pdu.RCPDU_REG_ROSTER_INSERT_PDU: | 123 | case pdu.RCPDU_REG_ROSTER_INSERT_PDU: |
| 124 | //let rosterInsertData = pdu['RCRegstryRosterInsertItemPdu'].decode(user_data); | 124 | //let rosterInsertData = pdu['RCRegstryRosterInsertItemPdu'].decode(user_data); |
| 125 | - loger.log('RCPDU_REG_ROSTER_INSERT_PDU---->'); | 125 | + //loger.log('RCPDU_REG_ROSTER_INSERT_PDU---->'); |
| 126 | console.log(user_data); | 126 | console.log(user_data); |
| 127 | let rosterInsertData = pdu['RCRegistryRosterInsertItemPdu'].decode(user_data); | 127 | let rosterInsertData = pdu['RCRegistryRosterInsertItemPdu'].decode(user_data); |
| 128 | let rosterInsertItems = rosterInsertData.items; | 128 | let rosterInsertItems = rosterInsertData.items; |
| @@ -329,7 +329,7 @@ export default class Ape extends Emiter { | @@ -329,7 +329,7 @@ export default class Ape extends Emiter { | ||
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | send(appPdu) { | 331 | send(appPdu) { |
| 332 | - loger.log('Ape发送数据NORMAL PDU'); | 332 | + //loger.log('Ape发送数据NORMAL PDU'); |
| 333 | //console.log(appPdu); | 333 | //console.log(appPdu); |
| 334 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); | 334 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); |
| 335 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { | 335 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { |
| @@ -359,14 +359,6 @@ export default class Ape extends Emiter { | @@ -359,14 +359,6 @@ export default class Ape extends Emiter { | ||
| 359 | 359 | ||
| 360 | // 发送当前APE(session uniform包) | 360 | // 发送当前APE(session uniform包) |
| 361 | sendUniform(appPdu, top) { | 361 | sendUniform(appPdu, top) { |
| 362 | - loger.log('Ape发送数据UNIFORM PDU'); | ||
| 363 | - //console.log(appPdu); | ||
| 364 | - //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); | ||
| 365 | - //if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { | ||
| 366 | - // this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); | ||
| 367 | - // return; | ||
| 368 | - //} | ||
| 369 | - | ||
| 370 | if(!this._classInfo){ | 362 | if(!this._classInfo){ |
| 371 | loger.warn('Ape发送数据UNIFORM PDU->失败->ape课堂数据无效->', this._classInfo); | 363 | loger.warn('Ape发送数据UNIFORM PDU->失败->ape课堂数据无效->', this._classInfo); |
| 372 | return; | 364 | return; |
| @@ -412,7 +404,7 @@ export default class Ape extends Emiter { | @@ -412,7 +404,7 @@ export default class Ape extends Emiter { | ||
| 412 | PduConsts.SEG_ONCE | 404 | PduConsts.SEG_ONCE |
| 413 | ); | 405 | ); |
| 414 | uniformPdu.data = appPdu.toArrayBuffer(); | 406 | uniformPdu.data = appPdu.toArrayBuffer(); |
| 415 | - loger.log('Ape发送数据UNIFORM PDU',uniformPdu); | 407 | + //loger.log('Ape发送数据UNIFORM PDU',uniformPdu); |
| 416 | // Mcu发送 | 408 | // Mcu发送 |
| 417 | this.mcu.send(uniformPdu); | 409 | this.mcu.send(uniformPdu); |
| 418 | } | 410 | } |
| @@ -67,7 +67,7 @@ class ConferApe extends Ape { | @@ -67,7 +67,7 @@ class ConferApe extends Ape { | ||
| 67 | nodeInfoRecordPdu.userData = userDataPdu.toArrayBuffer(); | 67 | nodeInfoRecordPdu.userData = userDataPdu.toArrayBuffer(); |
| 68 | nodeInfoRecordPdu.deviceType = GlobalConfig.deviceType; //设备类型 | 68 | nodeInfoRecordPdu.deviceType = GlobalConfig.deviceType; //设备类型 |
| 69 | 69 | ||
| 70 | - loger.log('开始加入->', nodeInfoRecordPdu); | 70 | + //loger.log('开始加入->', nodeInfoRecordPdu); |
| 71 | 71 | ||
| 72 | let item = new pdu['RCRegistryRosterItemPdu']; | 72 | let item = new pdu['RCRegistryRosterItemPdu']; |
| 73 | item.nodeId = nodeInfoRecordPdu.nodeId; | 73 | item.nodeId = nodeInfoRecordPdu.nodeId; |
| @@ -118,6 +118,8 @@ class ConferApe extends Ape { | @@ -118,6 +118,8 @@ class ConferApe extends Ape { | ||
| 118 | 118 | ||
| 119 | nodeInfoRecordPdu.curVideoQuality = GlobalConfig.curVideoQuality; | 119 | nodeInfoRecordPdu.curVideoQuality = GlobalConfig.curVideoQuality; |
| 120 | nodeInfoRecordPdu.micGain = GlobalConfig.micGain; | 120 | nodeInfoRecordPdu.micGain = GlobalConfig.micGain; |
| 121 | + nodeInfoRecordPdu.micNoise = GlobalConfig.micNoise; | ||
| 122 | + nodeInfoRecordPdu.autoGain = GlobalConfig.autoGain; | ||
| 121 | nodeInfoRecordPdu.speakerVolume = GlobalConfig.speakerVolume; | 123 | nodeInfoRecordPdu.speakerVolume = GlobalConfig.speakerVolume; |
| 122 | nodeInfoRecordPdu.micCode = GlobalConfig.micCode; | 124 | nodeInfoRecordPdu.micCode = GlobalConfig.micCode; |
| 123 | nodeInfoRecordPdu.curCamera = GlobalConfig.curCamera; | 125 | nodeInfoRecordPdu.curCamera = GlobalConfig.curCamera; |
| @@ -151,14 +153,13 @@ class ConferApe extends Ape { | @@ -151,14 +153,13 @@ class ConferApe extends Ape { | ||
| 151 | nodeInfoRecordPdu.explorerVersion = GlobalConfig.explorerVersion; | 153 | nodeInfoRecordPdu.explorerVersion = GlobalConfig.explorerVersion; |
| 152 | nodeInfoRecordPdu.os = GlobalConfig.os; | 154 | nodeInfoRecordPdu.os = GlobalConfig.os; |
| 153 | nodeInfoRecordPdu.sdkVersion = GlobalConfig.sdkVersion || "未知版本"; | 155 | nodeInfoRecordPdu.sdkVersion = GlobalConfig.sdkVersion || "未知版本"; |
| 154 | - | ||
| 155 | return nodeInfoRecordPdu; | 156 | return nodeInfoRecordPdu; |
| 156 | } | 157 | } |
| 157 | 158 | ||
| 158 | //更新角色数据 | 159 | //更新角色数据 |
| 159 | updateUserInfo() { | 160 | updateUserInfo() { |
| 160 | let nodeInfoRecordPdu = this.getNodeInfo(); | 161 | let nodeInfoRecordPdu = this.getNodeInfo(); |
| 161 | - loger.log('更新用户信息->', nodeInfoRecordPdu); | 162 | + //loger.log('更新用户信息->', nodeInfoRecordPdu); |
| 162 | let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; | 163 | let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; |
| 163 | userDataPdu.qq = ''; | 164 | userDataPdu.qq = ''; |
| 164 | userDataPdu.skype = ''; | 165 | userDataPdu.skype = ''; |
| @@ -646,8 +647,6 @@ class ConferApe extends Ape { | @@ -646,8 +647,6 @@ class ConferApe extends Ape { | ||
| 646 | tableUpdateHandler(owner, itemIdx, itemData) { | 647 | tableUpdateHandler(owner, itemIdx, itemData) { |
| 647 | try { | 648 | try { |
| 648 | let model = this.unPackPdu(owner, itemIdx, itemData); | 649 | let model = this.unPackPdu(owner, itemIdx, itemData); |
| 649 | - console.log('课堂数据更新->', model); | ||
| 650 | - | ||
| 651 | //处理课堂更新的信息 | 650 | //处理课堂更新的信息 |
| 652 | if (model && model.classStatusInfo) { | 651 | if (model && model.classStatusInfo) { |
| 653 | try { | 652 | try { |
| @@ -663,10 +662,10 @@ class ConferApe extends Ape { | @@ -663,10 +662,10 @@ class ConferApe extends Ape { | ||
| 663 | this._emit(MessageTypes.STOP_ALL_MEDIA_PUBLISH); | 662 | this._emit(MessageTypes.STOP_ALL_MEDIA_PUBLISH); |
| 664 | } | 663 | } |
| 665 | } | 664 | } |
| 666 | - | 665 | + // loger.log('课堂数据更新->'); |
| 667 | //通知应用层更新课堂状态 | 666 | //通知应用层更新课堂状态 |
| 668 | let classInfo = GlobalConfig.classStatusInfo; | 667 | let classInfo = GlobalConfig.classStatusInfo; |
| 669 | - loger.log('通知应用层更新课堂状态->CLASS_UPTATE_STATUS') | 668 | + //loger.log('通知应用层更新课堂状态->CLASS_UPTATE_STATUS') |
| 670 | this._emit(MessageTypes.CLASS_UPTATE_STATUS, classInfo); | 669 | this._emit(MessageTypes.CLASS_UPTATE_STATUS, classInfo); |
| 671 | 670 | ||
| 672 | //如果MCU已经断开连接,停止计时器 | 671 | //如果MCU已经断开连接,停止计时器 |
| @@ -923,7 +922,7 @@ class ConferApe extends Ape { | @@ -923,7 +922,7 @@ class ConferApe extends Ape { | ||
| 923 | this.rosterLen = Object.keys(this.rosters).length; | 922 | this.rosterLen = Object.keys(this.rosters).length; |
| 924 | GlobalConfig.rosterNumber = this.rosterLen;//记录当前的总人数 | 923 | GlobalConfig.rosterNumber = this.rosterLen;//记录当前的总人数 |
| 925 | newNodeData.rosterLen = this.rosterLen; | 924 | newNodeData.rosterLen = this.rosterLen; |
| 926 | - loger.log("人员加入->", newNodeData); | 925 | + //loger.log("人员加入->", newNodeData); |
| 927 | this._emit(MessageTypes.CLASS_INSERT_ROSTER, {"nodeId": nodeId, "nodeData": newNodeData}); | 926 | this._emit(MessageTypes.CLASS_INSERT_ROSTER, {"nodeId": nodeId, "nodeData": newNodeData}); |
| 928 | this.emitRosterChange(); | 927 | this.emitRosterChange(); |
| 929 | } else { | 928 | } else { |
| @@ -1001,7 +1000,7 @@ class ConferApe extends Ape { | @@ -1001,7 +1000,7 @@ class ConferApe extends Ape { | ||
| 1001 | } else { | 1000 | } else { |
| 1002 | let user = this.rosters[nodeId]; | 1001 | let user = this.rosters[nodeId]; |
| 1003 | if (user) { | 1002 | if (user) { |
| 1004 | - loger.log(nodeId, "->离开课堂->身份->", user.role); | 1003 | + loger.log(nodeId, "->离开课堂->身份->", user.userRole); |
| 1005 | } | 1004 | } |
| 1006 | delete this.rosters[nodeId]; | 1005 | delete this.rosters[nodeId]; |
| 1007 | this.rosterLen = Object.keys(this.rosters).length; | 1006 | this.rosterLen = Object.keys(this.rosters).length; |
| @@ -1040,7 +1039,7 @@ class ConferApe extends Ape { | @@ -1040,7 +1039,7 @@ class ConferApe extends Ape { | ||
| 1040 | 1039 | ||
| 1041 | ///////数据的封包和解包///////////////////////////////////////// | 1040 | ///////数据的封包和解包///////////////////////////////////////// |
| 1042 | packPdu(_param, _itemIdx) { | 1041 | packPdu(_param, _itemIdx) { |
| 1043 | - loger.log("课堂===packPdu "); | 1042 | + //loger.log("课堂===packPdu "); |
| 1044 | //验证坐标点集合数组是否合法 | 1043 | //验证坐标点集合数组是否合法 |
| 1045 | if (_param == null || _itemIdx == null) { | 1044 | if (_param == null || _itemIdx == null) { |
| 1046 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 1045 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -1071,7 +1070,7 @@ class ConferApe extends Ape { | @@ -1071,7 +1070,7 @@ class ConferApe extends Ape { | ||
| 1071 | classStatusInfo.currentSceneTableId = GlobalConfig.currentSceneTableId; | 1070 | classStatusInfo.currentSceneTableId = GlobalConfig.currentSceneTableId; |
| 1072 | classStatusInfo.silence = GlobalConfig.silence; | 1071 | classStatusInfo.silence = GlobalConfig.silence; |
| 1073 | classStatusInfo.silenceUsers = JSON.stringify(GlobalConfig.silenceUsers); | 1072 | classStatusInfo.silenceUsers = JSON.stringify(GlobalConfig.silenceUsers); |
| 1074 | - loger.log("classStatusInfo--->", classStatusInfo); | 1073 | + //loger.log("classStatusInfo--->", classStatusInfo); |
| 1075 | 1074 | ||
| 1076 | /* | 1075 | /* |
| 1077 | optional uint32 item_idx=1; | 1076 | optional uint32 item_idx=1; |
| @@ -1091,7 +1090,7 @@ class ConferApe extends Ape { | @@ -1091,7 +1090,7 @@ class ConferApe extends Ape { | ||
| 1091 | } | 1090 | } |
| 1092 | 1091 | ||
| 1093 | unPackPdu(owner, itemIdx, itemData) { | 1092 | unPackPdu(owner, itemIdx, itemData) { |
| 1094 | - loger.log("课堂数据->unPackPdu "); | 1093 | + //loger.log("课堂数据->unPackPdu "); |
| 1095 | if (owner == null || itemIdx == null || itemData == null) { | 1094 | if (owner == null || itemIdx == null || itemData == null) { |
| 1096 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 1095 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 1097 | return null; | 1096 | return null; |
| @@ -43,7 +43,7 @@ class CursorApe extends Ape { | @@ -43,7 +43,7 @@ class CursorApe extends Ape { | ||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | _joinSessionHandler(_data) { | 45 | _joinSessionHandler(_data) { |
| 46 | - loger.log("RCPDU_SESSION_JOIN_RESPONSE"); | 46 | + //loger.log("RCPDU_SESSION_JOIN_RESPONSE"); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | // 添加鼠标 | 49 | // 添加鼠标 |
| @@ -100,7 +100,7 @@ class DocApe extends Ape { | @@ -100,7 +100,7 @@ class DocApe extends Ape { | ||
| 100 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 100 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 101 | return null; | 101 | return null; |
| 102 | } | 102 | } |
| 103 | - loger.log("文档->updaterDoc ", _docDataModel); | 103 | + //loger.log("文档->updaterDoc ", _docDataModel); |
| 104 | 104 | ||
| 105 | let docDataModelPdu = this.packPdu(_docDataModel, _itemIdx); | 105 | let docDataModelPdu = this.packPdu(_docDataModel, _itemIdx); |
| 106 | let tableItemPdu = new pdu['RCRegistryTableItemPdu']; | 106 | let tableItemPdu = new pdu['RCRegistryTableItemPdu']; |
| @@ -130,7 +130,7 @@ class DocApe extends Ape { | @@ -130,7 +130,7 @@ class DocApe extends Ape { | ||
| 130 | adapterPdu.type = pdu.RCPDU_REG_ADAPTER; | 130 | adapterPdu.type = pdu.RCPDU_REG_ADAPTER; |
| 131 | adapterPdu.item.push(adapterItemPdu); | 131 | adapterPdu.item.push(adapterItemPdu); |
| 132 | 132 | ||
| 133 | - loger.log("发送更新文档.itemIdx=" + tableItemPdu.itemIdx); | 133 | + //loger.log("发送更新文档.itemIdx=" + tableItemPdu.itemIdx); |
| 134 | this.sendUniform(adapterPdu, true); | 134 | this.sendUniform(adapterPdu, true); |
| 135 | } | 135 | } |
| 136 | //获取文档的完整地址和所有图片 | 136 | //获取文档的完整地址和所有图片 |
| @@ -296,6 +296,7 @@ class DocApe extends Ape { | @@ -296,6 +296,7 @@ class DocApe extends Ape { | ||
| 296 | _docPackFullInfo(_itemDataInfo){ | 296 | _docPackFullInfo(_itemDataInfo){ |
| 297 | let itemDataInfo=_itemDataInfo; | 297 | let itemDataInfo=_itemDataInfo; |
| 298 | let getDocAddress=this.getDocFullAddress(_itemDataInfo); | 298 | let getDocAddress=this.getDocFullAddress(_itemDataInfo); |
| 299 | + loger.log('docPackFullInfo->', itemDataInfo); | ||
| 299 | if(getDocAddress.code==ApeConsts.RETURN_SUCCESS){ | 300 | if(getDocAddress.code==ApeConsts.RETURN_SUCCESS){ |
| 300 | itemDataInfo.images=getDocAddress.docFullAddress.images||[]; | 301 | itemDataInfo.images=getDocAddress.docFullAddress.images||[]; |
| 301 | itemDataInfo.pdf=getDocAddress.docFullAddress.pdf||""; | 302 | itemDataInfo.pdf=getDocAddress.docFullAddress.pdf||""; |
| @@ -305,7 +306,7 @@ class DocApe extends Ape { | @@ -305,7 +306,7 @@ class DocApe extends Ape { | ||
| 305 | itemDataInfo.pdf=''; | 306 | itemDataInfo.pdf=''; |
| 306 | itemDataInfo.html=''; | 307 | itemDataInfo.html=''; |
| 307 | } | 308 | } |
| 308 | - loger.log('docPackFullInfo->', itemDataInfo); | 309 | + |
| 309 | return itemDataInfo; | 310 | return itemDataInfo; |
| 310 | } | 311 | } |
| 311 | //更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次 | 312 | //更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次 |
| @@ -439,7 +440,6 @@ class DocApe extends Ape { | @@ -439,7 +440,6 @@ class DocApe extends Ape { | ||
| 439 | loger.log('文档切换显示模式', paramInfo); | 440 | loger.log('文档切换显示模式', paramInfo); |
| 440 | //获取已经存在的数据 | 441 | //获取已经存在的数据 |
| 441 | let docDataModel = this.docList[paramInfo.itemIdx]; | 442 | let docDataModel = this.docList[paramInfo.itemIdx]; |
| 442 | - | ||
| 443 | if (docDataModel == null) { | 443 | if (docDataModel == null) { |
| 444 | loger.log('文档切换显示模式->文档不存在', paramInfo); | 444 | loger.log('文档切换显示模式->文档不存在', paramInfo); |
| 445 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 445 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -459,13 +459,16 @@ class DocApe extends Ape { | @@ -459,13 +459,16 @@ class DocApe extends Ape { | ||
| 459 | //获取已经存在的数据 | 459 | //获取已经存在的数据 |
| 460 | let docDataModel = this.docList[paramInfo.itemIdx]; | 460 | let docDataModel = this.docList[paramInfo.itemIdx]; |
| 461 | if (docDataModel == null) { | 461 | if (docDataModel == null) { |
| 462 | - loger.log('documentCommand失败,文档不存在', paramInfo); | 462 | + loger.log('文档显示控制失败->文档不存在', paramInfo); |
| 463 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 463 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 464 | return; | 464 | return; |
| 465 | } | 465 | } |
| 466 | //更新数据的字段 | 466 | //更新数据的字段 |
| 467 | docDataModel.action = ApeConsts.DOC_ACTION_COMMAND; | 467 | docDataModel.action = ApeConsts.DOC_ACTION_COMMAND; |
| 468 | docDataModel.showType = parseInt(paramInfo.showType) || 0;//0;//完整显示;1;//按宽度显示;2;//按高度显示 | 468 | docDataModel.showType = parseInt(paramInfo.showType) || 0;//0;//完整显示;1;//按宽度显示;2;//按高度显示 |
| 469 | + docDataModel.curV= parseInt(paramInfo.curV) || 0;//垂直方向的滚动条进度百分比 0-100 | ||
| 470 | + docDataModel.curH= parseInt(paramInfo.curH) || 0;//水平方向的滚动条进度百分比 0-100 | ||
| 471 | + docDataModel.scale= parseInt(paramInfo.scale) || 100;//文档缩放百分比 0-100 | ||
| 469 | this.updaterDoc(docDataModel, docDataModel.itemIdx); | 472 | this.updaterDoc(docDataModel, docDataModel.itemIdx); |
| 470 | } | 473 | } |
| 471 | 474 | ||
| @@ -598,7 +601,7 @@ class DocApe extends Ape { | @@ -598,7 +601,7 @@ class DocApe extends Ape { | ||
| 598 | 601 | ||
| 599 | tableUpdateApeHandler(_tableUpdateItems, _seekTime) { | 602 | tableUpdateApeHandler(_tableUpdateItems, _seekTime) { |
| 600 | let tableUpdateItemsLen = _tableUpdateItems.length; | 603 | let tableUpdateItemsLen = _tableUpdateItems.length; |
| 601 | - loger.log('更新文档->', "activeDocId->", GlobalConfig.activeDocId, "更新的数量->", tableUpdateItemsLen); | 604 | + //loger.log('更新文档->', "activeDocId->", GlobalConfig.activeDocId, "更新的数量->", tableUpdateItemsLen); |
| 602 | for (let i = 0; i < tableUpdateItemsLen; ++i) { | 605 | for (let i = 0; i < tableUpdateItemsLen; ++i) { |
| 603 | let tableItem = _tableUpdateItems[i]; | 606 | let tableItem = _tableUpdateItems[i]; |
| 604 | if(tableItem) { | 607 | if(tableItem) { |
| @@ -689,7 +692,7 @@ class DocApe extends Ape { | @@ -689,7 +692,7 @@ class DocApe extends Ape { | ||
| 689 | 692 | ||
| 690 | ///////数据的封包和解包///////////////////////////////////////// | 693 | ///////数据的封包和解包///////////////////////////////////////// |
| 691 | packPdu(_param, _itemIdx) { | 694 | packPdu(_param, _itemIdx) { |
| 692 | - loger.log("文档->packPdu"); | 695 | + //loger.log("文档->packPdu"); |
| 693 | //验证坐标点集合数组是否合法 | 696 | //验证坐标点集合数组是否合法 |
| 694 | if (_param == null || _itemIdx == null) { | 697 | if (_param == null || _itemIdx == null) { |
| 695 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 698 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -706,8 +709,8 @@ class DocApe extends Ape { | @@ -706,8 +709,8 @@ class DocApe extends Ape { | ||
| 706 | docModelPdu.creatUserId = _param.creatUserId || "0"; | 709 | docModelPdu.creatUserId = _param.creatUserId || "0"; |
| 707 | docModelPdu.url = _param.url||"";//这个地址没用到,数据太长占用资源 暂停使用//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; | 710 | docModelPdu.url = _param.url||"";//这个地址没用到,数据太长占用资源 暂停使用//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; |
| 708 | docModelPdu.relativeUrl = _param.relativeUrl || "";//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; | 711 | docModelPdu.relativeUrl = _param.relativeUrl || "";//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg"; |
| 709 | - docModelPdu.curV = _param.curV || 0; | ||
| 710 | - docModelPdu.curH = _param.curH || 0; | 712 | + docModelPdu.curV = parseInt(_param.curV) || 0; |
| 713 | + docModelPdu.curH = parseInt(_param.curH) || 0; | ||
| 711 | docModelPdu.scale = _param.scale || 100;//按百分比 | 714 | docModelPdu.scale = _param.scale || 100;//按百分比 |
| 712 | docModelPdu.visible = _param.visible || false; | 715 | docModelPdu.visible = _param.visible || false; |
| 713 | docModelPdu.action = _param.action || ApeConsts.DOC_ACTION_NORMAL;//0,无操作, 1翻页、2.显示/隐藏, 3缩放/滚动 | 716 | docModelPdu.action = _param.action || ApeConsts.DOC_ACTION_NORMAL;//0,无操作, 1翻页、2.显示/隐藏, 3缩放/滚动 |
| @@ -728,7 +731,7 @@ class DocApe extends Ape { | @@ -728,7 +731,7 @@ class DocApe extends Ape { | ||
| 728 | } | 731 | } |
| 729 | try { | 732 | try { |
| 730 | let docModelPdu = pdu['RCDocSendDataModelPdu'].decode(itemData); | 733 | let docModelPdu = pdu['RCDocSendDataModelPdu'].decode(itemData); |
| 731 | - loger.log("文档===>unPackPdu"); | 734 | + //loger.log("文档===>unPackPdu"); |
| 732 | return docModelPdu; | 735 | return docModelPdu; |
| 733 | } catch (err) { | 736 | } catch (err) { |
| 734 | loger.log("文档===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); | 737 | loger.log("文档===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); |
| @@ -470,7 +470,7 @@ class MediaSharedApe extends Ape { | @@ -470,7 +470,7 @@ class MediaSharedApe extends Ape { | ||
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | onJoinChannelHandlerSuccess() { | 472 | onJoinChannelHandlerSuccess() { |
| 473 | - loger.log(this._session_name + ' 媒体共享加入频道成功'); | 473 | + // loger.log(this._session_name + ' 媒体共享加入频道成功'); |
| 474 | if (this._apeDelayed) { | 474 | if (this._apeDelayed) { |
| 475 | setTimeout(() => { | 475 | setTimeout(() => { |
| 476 | this._emit(MediaSharedApe.MEDIASHARED_JOIN_CHANNEL_SUCCESS); | 476 | this._emit(MediaSharedApe.MEDIASHARED_JOIN_CHANNEL_SUCCESS); |
| @@ -503,7 +503,7 @@ class MediaSharedApe extends Ape { | @@ -503,7 +503,7 @@ class MediaSharedApe extends Ape { | ||
| 503 | 503 | ||
| 504 | ///////数据的封包和解包///////////////////////////////////////// | 504 | ///////数据的封包和解包///////////////////////////////////////// |
| 505 | packPdu(_param, _itemIdx) { | 505 | packPdu(_param, _itemIdx) { |
| 506 | - loger.log("媒体文件->packPdu"); | 506 | + //loger.log("媒体文件->packPdu"); |
| 507 | //验证坐标点集合数组是否合法 | 507 | //验证坐标点集合数组是否合法 |
| 508 | if (_param == null || _itemIdx == null) { | 508 | if (_param == null || _itemIdx == null) { |
| 509 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 509 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -544,7 +544,7 @@ class MediaSharedApe extends Ape { | @@ -544,7 +544,7 @@ class MediaSharedApe extends Ape { | ||
| 544 | } | 544 | } |
| 545 | try { | 545 | try { |
| 546 | let pduDataModel = pdu['RCMediaSharedSendDataModelPdu'].decode(itemData); | 546 | let pduDataModel = pdu['RCMediaSharedSendDataModelPdu'].decode(itemData); |
| 547 | - loger.log("媒体文件===>unPackPdu"); | 547 | + // loger.log("媒体文件===>unPackPdu"); |
| 548 | return pduDataModel; | 548 | return pduDataModel; |
| 549 | } catch (err) { | 549 | } catch (err) { |
| 550 | loger.log("媒体文件===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); | 550 | loger.log("媒体文件===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); |
| @@ -466,7 +466,7 @@ class MusicSharedApe extends Ape { | @@ -466,7 +466,7 @@ class MusicSharedApe extends Ape { | ||
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | onJoinChannelHandlerSuccess() { | 468 | onJoinChannelHandlerSuccess() { |
| 469 | - loger.log(this._session_name + ' 伴音模块共享加入频道成功'); | 469 | + //loger.log(this._session_name + ' 伴音模块共享加入频道成功'); |
| 470 | if (this._apeDelayed) { | 470 | if (this._apeDelayed) { |
| 471 | setTimeout(() => { | 471 | setTimeout(() => { |
| 472 | this._emit(MusicSharedApe.MUSICSHARED_JOIN_CHANNEL_SUCCESS); | 472 | this._emit(MusicSharedApe.MUSICSHARED_JOIN_CHANNEL_SUCCESS); |
| @@ -499,7 +499,7 @@ class MusicSharedApe extends Ape { | @@ -499,7 +499,7 @@ class MusicSharedApe extends Ape { | ||
| 499 | 499 | ||
| 500 | ///////数据的封包和解包///////////////////////////////////////// | 500 | ///////数据的封包和解包///////////////////////////////////////// |
| 501 | packPdu(_param, _itemIdx) { | 501 | packPdu(_param, _itemIdx) { |
| 502 | - loger.log("伴音伴音文件->packPdu"); | 502 | + //loger.log("伴音伴音文件->packPdu"); |
| 503 | //验证坐标点集合数组是否合法 | 503 | //验证坐标点集合数组是否合法 |
| 504 | if (_param == null || _itemIdx == null) { | 504 | if (_param == null || _itemIdx == null) { |
| 505 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 505 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -540,7 +540,7 @@ class MusicSharedApe extends Ape { | @@ -540,7 +540,7 @@ class MusicSharedApe extends Ape { | ||
| 540 | } | 540 | } |
| 541 | try { | 541 | try { |
| 542 | let pduDataModel = pdu['RCMusicSharedSendDataModelPdu'].decode(itemData); | 542 | let pduDataModel = pdu['RCMusicSharedSendDataModelPdu'].decode(itemData); |
| 543 | - loger.log("伴音文件===>unPackPdu"); | 543 | + // loger.log("伴音文件===>unPackPdu"); |
| 544 | return pduDataModel; | 544 | return pduDataModel; |
| 545 | } catch (err) { | 545 | } catch (err) { |
| 546 | loger.log("伴音文件===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); | 546 | loger.log("伴音文件===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); |
| @@ -277,7 +277,7 @@ class QuestionApe extends Ape { | @@ -277,7 +277,7 @@ class QuestionApe extends Ape { | ||
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | unPackPdu(owner, itemIdx, itemData) { | 279 | unPackPdu(owner, itemIdx, itemData) { |
| 280 | - loger.log("答题卡->unPackPdu "); | 280 | + //loger.log("答题卡->unPackPdu "); |
| 281 | if (owner == null || itemIdx == null || itemData == null) { | 281 | if (owner == null || itemIdx == null || itemData == null) { |
| 282 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 282 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 283 | return null; | 283 | return null; |
| @@ -15,12 +15,16 @@ class ShareApe extends Emiter { | @@ -15,12 +15,16 @@ class ShareApe extends Emiter { | ||
| 15 | super(); | 15 | super(); |
| 16 | this.channelId=ApeConsts.SCREENSHARING_OBJ_TABLE_ID; | 16 | this.channelId=ApeConsts.SCREENSHARING_OBJ_TABLE_ID; |
| 17 | this.streamId=''; | 17 | this.streamId=''; |
| 18 | - this.publishUrl='';//rtmp://123.56.205.116/live/alexwang | 18 | + this.publishUrl=''; |
| 19 | this.isConnect=false; | 19 | this.isConnect=false; |
| 20 | + this.isStopPublish=false; | ||
| 20 | //this.shareScreen=new ShareScreen(); | 21 | //this.shareScreen=new ShareScreen(); |
| 21 | this.shareScreen=ShareScreen; | 22 | this.shareScreen=ShareScreen; |
| 22 | - this.ip='127.0.0.1'; | ||
| 23 | - this.port=8090; | 23 | + this.defaultPort='605';//以前用的是8089 |
| 24 | + this.defaultIp='127.0.0.1'; | ||
| 25 | + this.ip=this.defaultIp; | ||
| 26 | + this.port=this.defaultPort; | ||
| 27 | + | ||
| 24 | this.init(); | 28 | this.init(); |
| 25 | } | 29 | } |
| 26 | init(){ | 30 | init(){ |
| @@ -122,11 +126,14 @@ class ShareApe extends Emiter { | @@ -122,11 +126,14 @@ class ShareApe extends Emiter { | ||
| 122 | "data":"", | 126 | "data":"", |
| 123 | "mediaId":shareChannel, | 127 | "mediaId":shareChannel, |
| 124 | "publishUrl": publishUrl, | 128 | "publishUrl": publishUrl, |
| 125 | - "streamId":streamId | 129 | + "streamId":streamId, |
| 130 | + "port":"" | ||
| 126 | };*/ | 131 | };*/ |
| 127 | if(_result){ | 132 | if(_result){ |
| 128 | this.publishUrl=_result.publishUrl||''; | 133 | this.publishUrl=_result.publishUrl||''; |
| 129 | - this.streamId=_result.streamId||'' | 134 | + this.streamId=_result.streamId||''; |
| 135 | + this.port=_result.port||this.defaultPort; | ||
| 136 | + this.ip=_result.ip||this.defaultIp; | ||
| 130 | } | 137 | } |
| 131 | clearTimeout(this.reConnectTimer); | 138 | clearTimeout(this.reConnectTimer); |
| 132 | if(!this.isConnect){ | 139 | if(!this.isConnect){ |
| @@ -151,7 +158,6 @@ class ShareApe extends Emiter { | @@ -151,7 +158,6 @@ class ShareApe extends Emiter { | ||
| 151 | this.shareScreen.stopShareScreen(); | 158 | this.shareScreen.stopShareScreen(); |
| 152 | }catch (err){ | 159 | }catch (err){ |
| 153 | console.log('关闭屏幕共享->失败',err.message); | 160 | console.log('关闭屏幕共享->失败',err.message); |
| 154 | - | ||
| 155 | } | 161 | } |
| 156 | } | 162 | } |
| 157 | this.publishUrl='' | 163 | this.publishUrl='' |
| @@ -239,6 +239,8 @@ class VideoApe extends Ape { | @@ -239,6 +239,8 @@ class VideoApe extends Ape { | ||
| 239 | if(GlobalConfig.isHost) { | 239 | if(GlobalConfig.isHost) { |
| 240 | //获取屏幕共享推流的地址 | 240 | //获取屏幕共享推流的地址 |
| 241 | let shareResult = this.mediaModule.getMediaPublishPathForScreenShare(this.shareApe.channelId, publishType); | 241 | let shareResult = this.mediaModule.getMediaPublishPathForScreenShare(this.shareApe.channelId, publishType); |
| 242 | + shareResult.ip=_param.ip||"";//外部可以设置屏幕共享的IP | ||
| 243 | + shareResult.port=_param.port||"";//外部可以设置屏幕共享的端口 | ||
| 242 | this.shareApe.publish(shareResult); | 244 | this.shareApe.publish(shareResult); |
| 243 | } | 245 | } |
| 244 | } | 246 | } |
| @@ -372,7 +374,7 @@ class VideoApe extends Ape { | @@ -372,7 +374,7 @@ class VideoApe extends Ape { | ||
| 372 | } | 374 | } |
| 373 | //发送到mcu同步(更新数据) | 375 | //发送到mcu同步(更新数据) |
| 374 | sendTableUpdateHandler(_channelInfo) { | 376 | sendTableUpdateHandler(_channelInfo) { |
| 375 | - loger.log("video===sendTableUpdateHandler "); | 377 | + //loger.log("video===sendTableUpdateHandler "); |
| 376 | let updateModelPdu = this.packPdu(_channelInfo, _channelInfo.channelId);//let updateModelPdu=this.packPdu({},ApeConsts.VIDEO_OBJ_TABLE_ID+2); | 378 | let updateModelPdu = this.packPdu(_channelInfo, _channelInfo.channelId);//let updateModelPdu=this.packPdu({},ApeConsts.VIDEO_OBJ_TABLE_ID+2); |
| 377 | 379 | ||
| 378 | if(updateModelPdu==null){ | 380 | if(updateModelPdu==null){ |
| @@ -54,7 +54,7 @@ class WhiteBoardApe extends Ape { | @@ -54,7 +54,7 @@ class WhiteBoardApe extends Ape { | ||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | _joinSessionHandler(_data) { | 56 | _joinSessionHandler(_data) { |
| 57 | - loger.log("RCPDU_SESSION_JOIN_RESPONSE"); | 57 | + //loger.log("RCPDU_SESSION_JOIN_RESPONSE"); |
| 58 | this.insertHistory = []; | 58 | this.insertHistory = []; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| @@ -345,7 +345,7 @@ class WhiteBoardApe extends Ape { | @@ -345,7 +345,7 @@ class WhiteBoardApe extends Ape { | ||
| 345 | 345 | ||
| 346 | //文档更新,白板也要更新 | 346 | //文档更新,白板也要更新 |
| 347 | docUpdateHandler(_data) { | 347 | docUpdateHandler(_data) { |
| 348 | - loger.log("白板收到文档更新的消息"); | 348 | + //loger.log("白板收到文档更新的消息"); |
| 349 | //loger.log(_data); | 349 | //loger.log(_data); |
| 350 | 350 | ||
| 351 | //如果切换了文档或翻页,清除之前的添加步骤记录 | 351 | //如果切换了文档或翻页,清除之前的添加步骤记录 |
| @@ -380,7 +380,7 @@ class WhiteBoardApe extends Ape { | @@ -380,7 +380,7 @@ class WhiteBoardApe extends Ape { | ||
| 380 | "isFresh": false, | 380 | "isFresh": false, |
| 381 | "annotaionItems": annotaionItems | 381 | "annotaionItems": annotaionItems |
| 382 | }; | 382 | }; |
| 383 | - loger.log("新增一条标注数据->显示到界面"); | 383 | + //loger.log("新增一条标注数据->显示到界面"); |
| 384 | this._emit(MessageTypes.WHITEBOARD_ANNOTATION_UPDATE, updateObj); | 384 | this._emit(MessageTypes.WHITEBOARD_ANNOTATION_UPDATE, updateObj); |
| 385 | } | 385 | } |
| 386 | 386 | ||
| @@ -450,7 +450,7 @@ class WhiteBoardApe extends Ape { | @@ -450,7 +450,7 @@ class WhiteBoardApe extends Ape { | ||
| 450 | 450 | ||
| 451 | unPackPdu(owner, itemIdx, itemData) { | 451 | unPackPdu(owner, itemIdx, itemData) { |
| 452 | try { | 452 | try { |
| 453 | - loger.log("白板标注数据->unPackPdu"); | 453 | + //loger.log("白板标注数据->unPackPdu"); |
| 454 | let whiteBoardModelPdu = pdu['RCWhiteBoardDataModelPdu'].decode(itemData); | 454 | let whiteBoardModelPdu = pdu['RCWhiteBoardDataModelPdu'].decode(itemData); |
| 455 | let _pointGroup = EngineUtils.arrayFromJsonString(whiteBoardModelPdu.pointGroup); | 455 | let _pointGroup = EngineUtils.arrayFromJsonString(whiteBoardModelPdu.pointGroup); |
| 456 | whiteBoardModelPdu.pointGroup = _pointGroup; | 456 | whiteBoardModelPdu.pointGroup = _pointGroup; |
| @@ -184,10 +184,10 @@ class MCU extends Emiter { | @@ -184,10 +184,10 @@ class MCU extends Emiter { | ||
| 184 | // 课堂发送消息 -- 消息同意序列号 | 184 | // 课堂发送消息 -- 消息同意序列号 |
| 185 | send(msg) { | 185 | send(msg) { |
| 186 | if (this.connected) { | 186 | if (this.connected) { |
| 187 | - loger.log('发送数据到服务端-------------------->'); | 187 | + // loger.log('发送数据到服务端-------------------->'); |
| 188 | this._everSocket.send(msg.toArrayBuffer()); | 188 | this._everSocket.send(msg.toArrayBuffer()); |
| 189 | } else { | 189 | } else { |
| 190 | - loger.log('发送数据到服务端-------------------->失败->未连接到服务端'); | 190 | + loger.warn('发送数据到服务端-------------------->失败->未连接到服务端'); |
| 191 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_SOCKET_DISCONNECT); | 191 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_SOCKET_DISCONNECT); |
| 192 | } | 192 | } |
| 193 | } | 193 | } |
| @@ -206,9 +206,6 @@ class MCU extends Emiter { | @@ -206,9 +206,6 @@ class MCU extends Emiter { | ||
| 206 | // 主动建立MCU连接 | 206 | // 主动建立MCU连接 |
| 207 | joinMCU(_classInfo) { | 207 | joinMCU(_classInfo) { |
| 208 | loger.log('开始建立EverSocket通道.'); | 208 | loger.log('开始建立EverSocket通道.'); |
| 209 | - if(!this.classInfo||!this.classInfo.MCUServerIP){ | ||
| 210 | - loger.error('建立MCU连接->地址无效.'); | ||
| 211 | - } | ||
| 212 | GlobalConfig.classJoinSuccess = false; | 209 | GlobalConfig.classJoinSuccess = false; |
| 213 | loger.log(_classInfo); | 210 | loger.log(_classInfo); |
| 214 | _classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形 | 211 | _classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形 |
| @@ -901,7 +901,7 @@ message RCNodeInfoRecordPdu { | @@ -901,7 +901,7 @@ message RCNodeInfoRecordPdu { | ||
| 901 | repeated string cameras = 14; | 901 | repeated string cameras = 14; |
| 902 | optional uint32 openCamera=15; | 902 | optional uint32 openCamera=15; |
| 903 | optional uint32 openMicrophones=16; | 903 | optional uint32 openMicrophones=16; |
| 904 | - optional uint32 videoQuality=17;//设置分辨率的 | 904 | + optional uint32 videoQuality=17;//画质对应分辨率 |
| 905 | optional string userIp=18; | 905 | optional string userIp=18; |
| 906 | optional uint32 curVideoQuality=19; | 906 | optional uint32 curVideoQuality=19; |
| 907 | optional uint32 micGain=20; | 907 | optional uint32 micGain=20; |
| @@ -921,6 +921,8 @@ message RCNodeInfoRecordPdu { | @@ -921,6 +921,8 @@ message RCNodeInfoRecordPdu { | ||
| 921 | optional string explorerVersion = 34;//浏览器版本 | 921 | optional string explorerVersion = 34;//浏览器版本 |
| 922 | optional string os = 35;//系统版本 | 922 | optional string os = 35;//系统版本 |
| 923 | optional string sdkVersion = 36;//SDK版本 | 923 | optional string sdkVersion = 36;//SDK版本 |
| 924 | + optional uint32 micNoise=37; | ||
| 925 | + optional bool autoGain=38; | ||
| 924 | } | 926 | } |
| 925 | 927 | ||
| 926 | message RCVotingPollSettingsPdu { | 928 | message RCVotingPollSettingsPdu { |
-
请 注册 或 登录 后发表评论