正在显示
5 个修改的文件
包含
161 行增加
和
24 行删除
| @@ -35,6 +35,7 @@ import QuestionApe from 'apes/QuestionApe'; | @@ -35,6 +35,7 @@ import QuestionApe from 'apes/QuestionApe'; | ||
| 35 | import UTF8 from 'utf-8'; | 35 | import UTF8 from 'utf-8'; |
| 36 | import LogManager from 'LogManager'; | 36 | import LogManager from 'LogManager'; |
| 37 | import WebRtcApe from 'apes/WebRtcApe'; | 37 | import WebRtcApe from 'apes/WebRtcApe'; |
| 38 | +import Base64Module from 'Base64Module'; | ||
| 38 | 39 | ||
| 39 | let loger = Loger.getLoger('McuClient'); | 40 | let loger = Loger.getLoger('McuClient'); |
| 40 | 41 | ||
| @@ -54,12 +55,14 @@ let _mediaShareApe; | @@ -54,12 +55,14 @@ let _mediaShareApe; | ||
| 54 | let _musicShareApe; | 55 | let _musicShareApe; |
| 55 | let _questionApe; | 56 | let _questionApe; |
| 56 | let _webRtc; | 57 | let _webRtc; |
| 58 | +let _base64; | ||
| 59 | + | ||
| 57 | //MCUClient 外部实例化主类 | 60 | //MCUClient 外部实例化主类 |
| 58 | export default class MessageEntrance extends Emiter { | 61 | export default class MessageEntrance extends Emiter { |
| 59 | constructor() { | 62 | constructor() { |
| 60 | super(); | 63 | super(); |
| 61 | //sdk 信息 | 64 | //sdk 信息 |
| 62 | - GlobalConfig.sdkVersion = "v2.2.7.20170904"; | 65 | + GlobalConfig.sdkVersion = "v2.2.16.20170905"; |
| 63 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); | 66 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); |
| 64 | 67 | ||
| 65 | //设置 | 68 | //设置 |
| @@ -112,6 +115,7 @@ export default class MessageEntrance extends Emiter { | @@ -112,6 +115,7 @@ export default class MessageEntrance extends Emiter { | ||
| 112 | 115 | ||
| 113 | //选点模块 | 116 | //选点模块 |
| 114 | _ipManager = new IpManager(); | 117 | _ipManager = new IpManager(); |
| 118 | + _base64=new Base64Module(); | ||
| 115 | 119 | ||
| 116 | // 底层MCU消息层 | 120 | // 底层MCU消息层 |
| 117 | _mcu = Mcu; | 121 | _mcu = Mcu; |
| @@ -138,7 +142,7 @@ export default class MessageEntrance extends Emiter { | @@ -138,7 +142,7 @@ export default class MessageEntrance extends Emiter { | ||
| 138 | _confer_ape.on(MessageTypes.CLASS_RECORD_START, this._onClassRecordStart.bind(this)); //课堂开始录制 | 142 | _confer_ape.on(MessageTypes.CLASS_RECORD_START, this._onClassRecordStart.bind(this)); //课堂开始录制 |
| 139 | _confer_ape.on(MessageTypes.CLASS_RECORD_SUCCESS, this._onClassRecordSuccess.bind(this)); //课堂开启录制成功 | 143 | _confer_ape.on(MessageTypes.CLASS_RECORD_SUCCESS, this._onClassRecordSuccess.bind(this)); //课堂开启录制成功 |
| 140 | 144 | ||
| 141 | - _confer_ape.on(MessageTypes.SWITCH_MS_IP, this._switchMsIpHandler.bind(this)); //MS动态选点 | 145 | + //_confer_ape.on(MessageTypes.SWITCH_MS_IP, this._switchMsIpHandler.bind(this)); //MS动态选点 |
| 142 | //_confer_ape.on(MessageTypes.SWITCH_RTMP_PULL_IP, this._switchRtmpPullIpHandler.bind(this)); //MS 拉流地址动态选点 | 146 | //_confer_ape.on(MessageTypes.SWITCH_RTMP_PULL_IP, this._switchRtmpPullIpHandler.bind(this)); //MS 拉流地址动态选点 |
| 143 | //_confer_ape.on(MessageTypes.SWITCH_HLS_IP, this._switchHlsIpHandler.bind(this)); //MS HLS动态选点 | 147 | //_confer_ape.on(MessageTypes.SWITCH_HLS_IP, this._switchHlsIpHandler.bind(this)); //MS HLS动态选点 |
| 144 | _confer_ape.on(MessageTypes.STOP_ALL_MEDIA_PUBLISH, this._stopAllMediaPublishHandler.bind(this)); //课堂状态发生改变,需要停止当前的所有推流 | 148 | _confer_ape.on(MessageTypes.STOP_ALL_MEDIA_PUBLISH, this._stopAllMediaPublishHandler.bind(this)); //课堂状态发生改变,需要停止当前的所有推流 |
| @@ -283,6 +287,9 @@ export default class MessageEntrance extends Emiter { | @@ -283,6 +287,9 @@ export default class MessageEntrance extends Emiter { | ||
| 283 | this.setLocalMediaView=this._setLocalMediaView.bind(this); | 287 | this.setLocalMediaView=this._setLocalMediaView.bind(this); |
| 284 | this.setRemoteMediaView=this._setRemoteMediaView.bind(this); | 288 | this.setRemoteMediaView=this._setRemoteMediaView.bind(this); |
| 285 | this.setInvisibleMediaView=this._setInvisibleMediaView.bind(this); | 289 | this.setInvisibleMediaView=this._setInvisibleMediaView.bind(this); |
| 290 | + this.setAppConfig=this._setAppConfig.bind(this); | ||
| 291 | + this.recordControl=this._recordControl.bind(this); | ||
| 292 | + | ||
| 286 | 293 | ||
| 287 | this.setDeviceInfo = this._setDeviceInfo.bind(this); //设置设备信息(麦克风,摄像头等等.....) | 294 | this.setDeviceInfo = this._setDeviceInfo.bind(this); //设置设备信息(麦克风,摄像头等等.....) |
| 288 | this.setMessageDelay = this._setMessageDelay.bind(this); //设置是否延迟消息 | 295 | this.setMessageDelay = this._setMessageDelay.bind(this); //设置是否延迟消息 |
| @@ -722,6 +729,7 @@ export default class MessageEntrance extends Emiter { | @@ -722,6 +729,7 @@ export default class MessageEntrance extends Emiter { | ||
| 722 | //加入课堂之前开始第一次选点 | 729 | //加入课堂之前开始第一次选点 |
| 723 | let _this = this; | 730 | let _this = this; |
| 724 | loger.warn('=====================STEP7======================='); | 731 | loger.warn('=====================STEP7======================='); |
| 732 | + loger.log("加入课堂之前开始第一次选点"); | ||
| 725 | //推流地址测速 | 733 | //推流地址测速 |
| 726 | this._getFastestIpFromServer(GlobalConfig.msListFinal, | 734 | this._getFastestIpFromServer(GlobalConfig.msListFinal, |
| 727 | function (_data) { | 735 | function (_data) { |
| @@ -861,6 +869,16 @@ export default class MessageEntrance extends Emiter { | @@ -861,6 +869,16 @@ export default class MessageEntrance extends Emiter { | ||
| 861 | loger.warn(" RTMP-List", GlobalConfig.rtmpPullListFinal); | 869 | loger.warn(" RTMP-List", GlobalConfig.rtmpPullListFinal); |
| 862 | loger.warn(" HLS-List", GlobalConfig.hlsPullListFinal); | 870 | loger.warn(" HLS-List", GlobalConfig.hlsPullListFinal); |
| 863 | loger.warn(" RS-List", GlobalConfig.rsPullListFinal); | 871 | loger.warn(" RS-List", GlobalConfig.rsPullListFinal); |
| 872 | + | ||
| 873 | + //使用webRtc不需要再使用MS列表中的数据--------- | ||
| 874 | + GlobalConfig.msListFinal=[];//清空数据 | ||
| 875 | + GlobalConfig.rtmpPullListFinal=[]; | ||
| 876 | + //不是录制回放的时候hls的也清空 | ||
| 877 | + if(!GlobalConfig.isRecordPlayBack){ | ||
| 878 | + GlobalConfig.hlsPullListFinal=[]; | ||
| 879 | + GlobalConfig.rsPullListFinal=[] | ||
| 880 | + } | ||
| 881 | + //------------------------------------------- | ||
| 864 | } | 882 | } |
| 865 | 883 | ||
| 866 | //从Sass中选择的mcu、ms列表 | 884 | //从Sass中选择的mcu、ms列表 |
| @@ -925,6 +943,17 @@ export default class MessageEntrance extends Emiter { | @@ -925,6 +943,17 @@ export default class MessageEntrance extends Emiter { | ||
| 925 | loger.warn(" HLS-List", GlobalConfig.hlsPullListFinal); | 943 | loger.warn(" HLS-List", GlobalConfig.hlsPullListFinal); |
| 926 | loger.warn(" RS-List", GlobalConfig.rsPullListFinal); | 944 | loger.warn(" RS-List", GlobalConfig.rsPullListFinal); |
| 927 | 945 | ||
| 946 | + | ||
| 947 | + //使用webRtc不需要再使用MS列表中的数据--------- | ||
| 948 | + GlobalConfig.msListFinal=[];//清空数据 | ||
| 949 | + GlobalConfig.rtmpPullListFinal=[]; | ||
| 950 | + //不是录制回放的时候hls的也清空 | ||
| 951 | + if(!GlobalConfig.isRecordPlayBack){ | ||
| 952 | + GlobalConfig.hlsPullListFinal=[]; | ||
| 953 | + GlobalConfig.rsPullListFinal=[] | ||
| 954 | + } | ||
| 955 | + //------------------------------------------- | ||
| 956 | + | ||
| 928 | } | 957 | } |
| 929 | 958 | ||
| 930 | 959 | ||
| @@ -1651,10 +1680,17 @@ export default class MessageEntrance extends Emiter { | @@ -1651,10 +1680,17 @@ export default class MessageEntrance extends Emiter { | ||
| 1651 | GlobalConfig.setVideoCDNAddr(_data.videoCDNAddr); //cdn加速的拉流地址,直播的时候才使用 | 1680 | GlobalConfig.setVideoCDNAddr(_data.videoCDNAddr); //cdn加速的拉流地址,直播的时候才使用 |
| 1652 | GlobalConfig.setMediaShareList(_data.sharedMediaList); //提前上传的媒体共享文件列表 | 1681 | GlobalConfig.setMediaShareList(_data.sharedMediaList); //提前上传的媒体共享文件列表 |
| 1653 | 1682 | ||
| 1683 | + let appConfigStr=_data.appConfig; | ||
| 1684 | + appConfigStr=_base64.decode(appConfigStr); | ||
| 1685 | + let appConfig={}; | ||
| 1686 | + try{ | ||
| 1687 | + appConfig=JSON.parse(appConfigStr); | ||
| 1688 | + //储存app相关信息 | ||
| 1689 | + this._setAppConfig(appConfig); | ||
| 1690 | + }catch (err){ | ||
| 1691 | + loger.warn("appConfig->解析失败",appConfigStr); | ||
| 1692 | + } | ||
| 1654 | 1693 | ||
| 1655 | - GlobalConfig.appId = 'eb253cc7b40c4a8b82f0a5b6f93c2ce0'; | ||
| 1656 | - GlobalConfig.appCertificate = ""; | ||
| 1657 | - GlobalConfig.appRecordingKey = ""; | ||
| 1658 | 1694 | ||
| 1659 | //文档服务器地址 | 1695 | //文档服务器地址 |
| 1660 | if (GlobalConfig.docList && GlobalConfig.docList.length > 0) { | 1696 | if (GlobalConfig.docList && GlobalConfig.docList.length > 0) { |
| @@ -1731,7 +1767,9 @@ export default class MessageEntrance extends Emiter { | @@ -1731,7 +1767,9 @@ export default class MessageEntrance extends Emiter { | ||
| 1731 | } else { | 1767 | } else { |
| 1732 | 1768 | ||
| 1733 | //初始化音视频通话sdk | 1769 | //初始化音视频通话sdk |
| 1734 | - this._initWebRtcSdk(null,()=>{ | 1770 | + this._initWebRtcSdk({ |
| 1771 | + appId:GlobalConfig.appId | ||
| 1772 | + },()=>{ | ||
| 1735 | //音视频通话SDK初始化完成之后,根据用户的userIp获取信息,获取服务列表选点,选点测速完成后才加入MCU | 1773 | //音视频通话SDK初始化完成之后,根据用户的userIp获取信息,获取服务列表选点,选点测速完成后才加入MCU |
| 1736 | this.loadServerJsonAndgetUserIpInfo(); | 1774 | this.loadServerJsonAndgetUserIpInfo(); |
| 1737 | }); | 1775 | }); |
| @@ -1808,7 +1846,6 @@ export default class MessageEntrance extends Emiter { | @@ -1808,7 +1846,6 @@ export default class MessageEntrance extends Emiter { | ||
| 1808 | } | 1846 | } |
| 1809 | 1847 | ||
| 1810 | loger.warn('默认->MCU地址->.', GlobalConfig.MCUServerIP, GlobalConfig.MCUServerPort); | 1848 | loger.warn('默认->MCU地址->.', GlobalConfig.MCUServerIP, GlobalConfig.MCUServerPort); |
| 1811 | - | ||
| 1812 | loger.warn('默认->MS推流地址->.', GlobalConfig.MS_PUBLISH_IP, GlobalConfig.MS_PUBLISH_PORT); | 1849 | loger.warn('默认->MS推流地址->.', GlobalConfig.MS_PUBLISH_IP, GlobalConfig.MS_PUBLISH_PORT); |
| 1813 | loger.warn('默认->HLS点播地址->.', GlobalConfig.RS_RECORD_PLAY_IP, GlobalConfig.RS_RECORD_PLAY_PORT); | 1850 | loger.warn('默认->HLS点播地址->.', GlobalConfig.RS_RECORD_PLAY_IP, GlobalConfig.RS_RECORD_PLAY_PORT); |
| 1814 | loger.warn('默认->HLS拉流地址->.', GlobalConfig.MS_PLAY_HLS_IP, GlobalConfig.MS_PLAY_HLS_PORT); | 1851 | loger.warn('默认->HLS拉流地址->.', GlobalConfig.MS_PLAY_HLS_IP, GlobalConfig.MS_PLAY_HLS_PORT); |
| @@ -2674,11 +2711,13 @@ export default class MessageEntrance extends Emiter { | @@ -2674,11 +2711,13 @@ export default class MessageEntrance extends Emiter { | ||
| 2674 | openCamera: GlobalConfig.openCamera, | 2711 | openCamera: GlobalConfig.openCamera, |
| 2675 | openMicrophones: GlobalConfig.openMicrophones | 2712 | openMicrophones: GlobalConfig.openMicrophones |
| 2676 | }); | 2713 | }); |
| 2714 | + this._recordControl({"recordStatus":true}); | ||
| 2677 | return ; | 2715 | return ; |
| 2678 | } | 2716 | } |
| 2679 | 2717 | ||
| 2680 | if(_webRtc){ | 2718 | if(_webRtc){ |
| 2681 | _webRtc.publish(_params); | 2719 | _webRtc.publish(_params); |
| 2720 | + this._recordControl({"recordStatus":true}); | ||
| 2682 | } | 2721 | } |
| 2683 | } | 2722 | } |
| 2684 | /* | 2723 | /* |
| @@ -2751,6 +2790,30 @@ export default class MessageEntrance extends Emiter { | @@ -2751,6 +2790,30 @@ export default class MessageEntrance extends Emiter { | ||
| 2751 | _webRtc.setInvisibleMediaView(_params); | 2790 | _webRtc.setInvisibleMediaView(_params); |
| 2752 | } | 2791 | } |
| 2753 | } | 2792 | } |
| 2793 | + //设置app相关数据 | ||
| 2794 | + _setAppConfig(_params){ | ||
| 2795 | + if(!_params){ | ||
| 2796 | + return; | ||
| 2797 | + } | ||
| 2798 | + loger.log("设置appConfig",_params); | ||
| 2799 | + GlobalConfig.appId=_params.appId||"eb253cc7b40c4a8b82f0a5b6f93c2ce0"; | ||
| 2800 | + GlobalConfig.appCertificate=_params.appCertificate||""; | ||
| 2801 | + GlobalConfig.appRecordingKey=_params.appRecordingKey||""; | ||
| 2802 | + GlobalConfig.recordInterfaces=_params.recordInterfaces||""; | ||
| 2803 | + GlobalConfig.getChannelToken=_params.getChannelToken||""; | ||
| 2804 | + } | ||
| 2805 | + //录制控制 | ||
| 2806 | + _recordControl(_params){ | ||
| 2807 | + if(!GlobalConfig.recordInterfaces){ | ||
| 2808 | + loger.log("录制控制->失败->接口地址无效",_params); | ||
| 2809 | + return ; | ||
| 2810 | + } | ||
| 2811 | + if(_params&&_params.recordStatus==true){ | ||
| 2812 | + if(_sass){ | ||
| 2813 | + _sass.startServerRecord(); | ||
| 2814 | + } | ||
| 2815 | + } | ||
| 2816 | + } | ||
| 2754 | //webRtc-----------------end -------------------------------- | 2817 | //webRtc-----------------end -------------------------------- |
| 2755 | } | 2818 | } |
| 2756 | 2819 |
| @@ -563,6 +563,7 @@ GlobalConfig.appRecordingKey = ""; | @@ -563,6 +563,7 @@ GlobalConfig.appRecordingKey = ""; | ||
| 563 | GlobalConfig.channelId = ""; | 563 | GlobalConfig.channelId = ""; |
| 564 | GlobalConfig.channelKey = null; | 564 | GlobalConfig.channelKey = null; |
| 565 | GlobalConfig.userUid = 0; | 565 | GlobalConfig.userUid = 0; |
| 566 | - | 566 | +GlobalConfig.recordInterfaces="";//控制开启录制的接口 |
| 567 | +GlobalConfig.getChannelToken="";//获取token的地址 | ||
| 567 | export default GlobalConfig; | 568 | export default GlobalConfig; |
| 568 | 569 |
| @@ -243,8 +243,8 @@ class Sass extends Emiter { | @@ -243,8 +243,8 @@ class Sass extends Emiter { | ||
| 243 | siteId String 站点号 | 243 | siteId String 站点号 |
| 244 | meetingNumber String 课堂号 对应的是classId | 244 | meetingNumber String 课堂号 对应的是classId |
| 245 | */ | 245 | */ |
| 246 | - var timestamp = new Date().getTime(); | ||
| 247 | - var authId = MD5(GlobalConfig.classId + "" + timestamp); //课堂号+时间戳 的字符串,转成MD5 | 246 | + let timestamp = new Date().getTime(); |
| 247 | + let authId = MD5(GlobalConfig.classId + "" + timestamp); //课堂号+时间戳 的字符串,转成MD5 | ||
| 248 | //let url = `http://${GlobalConfig.portal}/3m/api/meeting/detail.do?meetingNumber=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 248 | //let url = `http://${GlobalConfig.portal}/3m/api/meeting/detail.do?meetingNumber=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 249 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/meeting/detail.do?meetingNumber=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 249 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/meeting/detail.do?meetingNumber=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 250 | 250 | ||
| @@ -296,8 +296,8 @@ class Sass extends Emiter { | @@ -296,8 +296,8 @@ class Sass extends Emiter { | ||
| 296 | loger.log('录制回放中,能删除文档'); | 296 | loger.log('录制回放中,能删除文档'); |
| 297 | return; | 297 | return; |
| 298 | } | 298 | } |
| 299 | - var timestamp = new Date().getTime(); | ||
| 300 | - var authId = MD5(_param.docId + "" + _param.classId + "" + timestamp); // docId+classId+timestamp的字符串,转成MD5 | 299 | + let timestamp = new Date().getTime(); |
| 300 | + let authId = MD5(_param.docId + "" + _param.classId + "" + timestamp); // docId+classId+timestamp的字符串,转成MD5 | ||
| 301 | //let url = `http://${GlobalConfig.portal}/3m/api/document/deleteRelation.do?docId=${_param.docId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 301 | //let url = `http://${GlobalConfig.portal}/3m/api/document/deleteRelation.do?docId=${_param.docId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 302 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/document/deleteRelation.do?docId=${_param.docId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 302 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/document/deleteRelation.do?docId=${_param.docId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 303 | 303 | ||
| @@ -338,8 +338,8 @@ class Sass extends Emiter { | @@ -338,8 +338,8 @@ class Sass extends Emiter { | ||
| 338 | return; | 338 | return; |
| 339 | } | 339 | } |
| 340 | console.warn('删除Music共享实现...'); | 340 | console.warn('删除Music共享实现...'); |
| 341 | - var timestamp = new Date().getTime(); | ||
| 342 | - var authId = MD5(_param.fileId + "" + _param.classId + "" + timestamp); // docId+classId+timestamp的字符串,转成MD5 | 341 | + let timestamp = new Date().getTime(); |
| 342 | + let authId = MD5(_param.fileId + "" + _param.classId + "" + timestamp); // docId+classId+timestamp的字符串,转成MD5 | ||
| 343 | //let url = `http://${GlobalConfig.portal}/3m/api/media/deleteRelation.do?mediaId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 343 | //let url = `http://${GlobalConfig.portal}/3m/api/media/deleteRelation.do?mediaId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 344 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/media/deleteRelation.do?mediaId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 344 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/media/deleteRelation.do?mediaId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 345 | 345 | ||
| @@ -380,8 +380,8 @@ class Sass extends Emiter { | @@ -380,8 +380,8 @@ class Sass extends Emiter { | ||
| 380 | loger.log('录制回放中,能删除文件'); | 380 | loger.log('录制回放中,能删除文件'); |
| 381 | return; | 381 | return; |
| 382 | } | 382 | } |
| 383 | - var timestamp = new Date().getTime(); | ||
| 384 | - var authId = MD5(_param.fileId + "" + _param.classId + "" + timestamp); // docId+classId+timestamp的字符串,转成MD5 | 383 | + let timestamp = new Date().getTime(); |
| 384 | + let authId = MD5(_param.fileId + "" + _param.classId + "" + timestamp); // docId+classId+timestamp的字符串,转成MD5 | ||
| 385 | //let url = `http://${GlobalConfig.portal}/3m/api/sharedMedia/deleteRelation.do?fileId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 385 | //let url = `http://${GlobalConfig.portal}/3m/api/sharedMedia/deleteRelation.do?fileId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 386 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/sharedMedia/deleteRelation.do?fileId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; | 386 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/sharedMedia/deleteRelation.do?fileId=${_param.fileId}&classId=${GlobalConfig.classId}×tamp=${timestamp}&authId=${authId}`; |
| 387 | 387 | ||
| @@ -434,8 +434,8 @@ class Sass extends Emiter { | @@ -434,8 +434,8 @@ class Sass extends Emiter { | ||
| 434 | return; | 434 | return; |
| 435 | } | 435 | } |
| 436 | //{"classStatusInfo":classStatusInfo} | 436 | //{"classStatusInfo":classStatusInfo} |
| 437 | - var timestamp = new Date().getTime(); | ||
| 438 | - var authId = MD5(GlobalConfig.classId + "" + timestamp); // (classId+timestamp)的字符串,转成MD5 | 437 | + let timestamp = new Date().getTime(); |
| 438 | + let authId = MD5(GlobalConfig.classId + "" + timestamp); // (classId+timestamp)的字符串,转成MD5 | ||
| 439 | let classStatusInfo = JSON.stringify(_param.classStatusInfo); | 439 | let classStatusInfo = JSON.stringify(_param.classStatusInfo); |
| 440 | //let url = `http://${GlobalConfig.portal}/3m/api/meeting/saveInfo.do`; | 440 | //let url = `http://${GlobalConfig.portal}/3m/api/meeting/saveInfo.do`; |
| 441 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/meeting/saveInfo.do`; | 441 | let url = `${GlobalConfig.locationProtocol+GlobalConfig.portal}/3m/api/meeting/saveInfo.do`; |
| @@ -537,6 +537,63 @@ class Sass extends Emiter { | @@ -537,6 +537,63 @@ class Sass extends Emiter { | ||
| 537 | loger.error(`保存开始录制信息异常.状态码:${err}`); | 537 | loger.error(`保存开始录制信息异常.状态码:${err}`); |
| 538 | }); | 538 | }); |
| 539 | } | 539 | } |
| 540 | + //调用服务器端开启录制 | ||
| 541 | + startServerRecord(){ | ||
| 542 | + if(!GlobalConfig.recordInterfaces){ | ||
| 543 | + loger.log("调用服务器端开启录制->失败->接口地址无效") | ||
| 544 | + } | ||
| 545 | + fetch(encodeURI(GlobalConfig.recordInterfaces), { | ||
| 546 | + method: 'POST', | ||
| 547 | + headers: { | ||
| 548 | + "Content-Type": "application/x-www-form-urlencoded" | ||
| 549 | + }, | ||
| 550 | + body: `appID=${GlobalConfig.appId}&channel=${GlobalConfig.channelId}&channelKey=${GlobalConfig.channelKey}&uid=${GlobalConfig.userUid}`, | ||
| 551 | + timeout: 4000 | ||
| 552 | + }) | ||
| 553 | + .then(ret => { | ||
| 554 | + if (ret.ok) { | ||
| 555 | + return ret.json(); | ||
| 556 | + } else { | ||
| 557 | + loger.error(`调用服务器端开启录制-网络异常.状态码:${ret.status}`); | ||
| 558 | + throw ''; | ||
| 559 | + } | ||
| 560 | + }) | ||
| 561 | + .then(ret => { | ||
| 562 | + if (ret.errorCode === 0) { | ||
| 563 | + loger.log('调用服务器端开启录制 完成'); | ||
| 564 | + this._emit(Sass.CLASS_SAVE_RECORD_INFO_SUCCESS, _param); | ||
| 565 | + } else { | ||
| 566 | + loger.warn('调用服务器端开启录制 失败.', ret); | ||
| 567 | + } | ||
| 568 | + }) | ||
| 569 | + .catch(err => { | ||
| 570 | + loger.error(`调用服务器端开启录制.状态码:${err}`); | ||
| 571 | + }); | ||
| 572 | + | ||
| 573 | + /*let userIpInfo={ | ||
| 574 | + "appID":GlobalConfig.appId, | ||
| 575 | + "channel":GlobalConfig.channelId, | ||
| 576 | + "channelKey": GlobalConfig.channelKey, | ||
| 577 | + "uid": GlobalConfig.userUid | ||
| 578 | + } | ||
| 579 | + let location=GlobalConfig.recordInterfaces;//'http://123.56.73.119:3000/users/Recording'; | ||
| 580 | + loger.log("调用服务器端开启录制->",location,userIpInfo); | ||
| 581 | + $.ajax( | ||
| 582 | + { | ||
| 583 | + type:'post', | ||
| 584 | + url : location, | ||
| 585 | + dataType : 'json', | ||
| 586 | + data: userIpInfo, | ||
| 587 | + success : function(data) { | ||
| 588 | + loger.log("调用服务器端开启录制->success",data); | ||
| 589 | + }, | ||
| 590 | + error : function(data) { | ||
| 591 | + //alert(data.code); | ||
| 592 | + loger.log("调用服务器端开启录制->error",data); | ||
| 593 | + } | ||
| 594 | + } | ||
| 595 | + );*/ | ||
| 596 | + } | ||
| 540 | 597 | ||
| 541 | //答题卡------------------------------------------------------- | 598 | //答题卡------------------------------------------------------- |
| 542 | //创建答题数据 | 599 | //创建答题数据 |
| @@ -559,7 +616,7 @@ class Sass extends Emiter { | @@ -559,7 +616,7 @@ class Sass extends Emiter { | ||
| 559 | return; | 616 | return; |
| 560 | } | 617 | } |
| 561 | let classId = GlobalConfig.classId; //课堂号 | 618 | let classId = GlobalConfig.classId; //课堂号 |
| 562 | - var timestamp = new Date().getTime(); | 619 | + let timestamp = new Date().getTime(); |
| 563 | let authId = MD5(classId + "" + timestamp); | 620 | let authId = MD5(classId + "" + timestamp); |
| 564 | 621 | ||
| 565 | let type = parseInt(_param.type); //1单选,2多选,3判断,4点名 | 622 | let type = parseInt(_param.type); //1单选,2多选,3判断,4点名 |
| @@ -635,7 +692,7 @@ class Sass extends Emiter { | @@ -635,7 +692,7 @@ class Sass extends Emiter { | ||
| 635 | userName String 用户名字*/ | 692 | userName String 用户名字*/ |
| 636 | 693 | ||
| 637 | let classId = GlobalConfig.classId; //课堂号 | 694 | let classId = GlobalConfig.classId; //课堂号 |
| 638 | - var timestamp = new Date().getTime(); | 695 | + let timestamp = new Date().getTime(); |
| 639 | let authId = MD5(classId + "" + timestamp); | 696 | let authId = MD5(classId + "" + timestamp); |
| 640 | 697 | ||
| 641 | let type = parseInt(_param.type); //1单选,2多选,3判断,4点名 | 698 | let type = parseInt(_param.type); //1单选,2多选,3判断,4点名 |
| @@ -129,7 +129,7 @@ class ConferApe extends Ape { | @@ -129,7 +129,7 @@ class ConferApe extends Ape { | ||
| 129 | nodeInfoRecordPdu.city = GlobalConfig.city; //城市 | 129 | nodeInfoRecordPdu.city = GlobalConfig.city; //城市 |
| 130 | nodeInfoRecordPdu.province = GlobalConfig.province; //服务商 | 130 | nodeInfoRecordPdu.province = GlobalConfig.province; //服务商 |
| 131 | nodeInfoRecordPdu.isp = GlobalConfig.isp; //服务商 | 131 | nodeInfoRecordPdu.isp = GlobalConfig.isp; //服务商 |
| 132 | - | 132 | + nodeInfoRecordPdu.msList=[]; |
| 133 | //用户的MS列表 | 133 | //用户的MS列表 |
| 134 | let msListAll = GlobalConfig.msListFinal; | 134 | let msListAll = GlobalConfig.msListFinal; |
| 135 | for (let k = 0; k < msListAll.length; k++) { | 135 | for (let k = 0; k < msListAll.length; k++) { |
| @@ -36,6 +36,12 @@ class WebRtcApe extends Emiter { | @@ -36,6 +36,12 @@ class WebRtcApe extends Emiter { | ||
| 36 | 36 | ||
| 37 | this.isPublish=false;//当前是否正在推流 | 37 | this.isPublish=false;//当前是否正在推流 |
| 38 | 38 | ||
| 39 | + this.localVideoWidth=320; | ||
| 40 | + this.localVideoHeight=240; | ||
| 41 | + | ||
| 42 | + this.remoteVideoWidth=320; | ||
| 43 | + this.remoteVideoHeight=240; | ||
| 44 | + | ||
| 39 | this.localViewId = ""; | 45 | this.localViewId = ""; |
| 40 | this.localStyle = ""; | 46 | this.localStyle = ""; |
| 41 | 47 | ||
| @@ -113,7 +119,7 @@ class WebRtcApe extends Emiter { | @@ -113,7 +119,7 @@ class WebRtcApe extends Emiter { | ||
| 113 | let stream = evt.stream; | 119 | let stream = evt.stream; |
| 114 | if(stream){ | 120 | if(stream){ |
| 115 | loger.log("获取远程视频流成功: " + stream.getId()); | 121 | loger.log("获取远程视频流成功: " + stream.getId()); |
| 116 | - let viewDiv=`<div id="${this.xdyRemote + stream.getId()}" style="width:320px;height:240px;"></div>`; | 122 | + let viewDiv=`<div id="${this.xdyRemote + stream.getId()}" style="width:${this.remoteVideoWidth}px;height:${this.remoteVideoHeight}px;"></div>`; |
| 117 | if(GlobalConfig.getUserRoleFromeNodeId(stream.getId())==ApeConsts.invisible){ | 123 | if(GlobalConfig.getUserRoleFromeNodeId(stream.getId())==ApeConsts.invisible){ |
| 118 | //显示隐藏用户 | 124 | //显示隐藏用户 |
| 119 | $(this.invisibleViewId).append(viewDiv); | 125 | $(this.invisibleViewId).append(viewDiv); |
| @@ -286,8 +292,10 @@ class WebRtcApe extends Emiter { | @@ -286,8 +292,10 @@ class WebRtcApe extends Emiter { | ||
| 286 | * */ | 292 | * */ |
| 287 | setLoaclView(_params) { | 293 | setLoaclView(_params) { |
| 288 | loger.log("设置本地回显视图"); | 294 | loger.log("设置本地回显视图"); |
| 289 | - this.localViewId = _params.divId||"";; | ||
| 290 | - this.localStyle = _params.styleStr||"";; | 295 | + this.localViewId = _params.divId||""; |
| 296 | + this.localStyle = _params.styleStr||""; | ||
| 297 | + this.localVideoWidth=parseInt(_params.width)||320; | ||
| 298 | + this.localVideoHeight=parseInt(_params.height)||240; | ||
| 291 | } | 299 | } |
| 292 | 300 | ||
| 293 | /* | 301 | /* |
| @@ -297,6 +305,8 @@ class WebRtcApe extends Emiter { | @@ -297,6 +305,8 @@ class WebRtcApe extends Emiter { | ||
| 297 | loger.log("设置其他人的video视图容器"); | 305 | loger.log("设置其他人的video视图容器"); |
| 298 | this.remoteViewId = _params.divId||""; | 306 | this.remoteViewId = _params.divId||""; |
| 299 | this.remoteStyle = _params.styleStr||""; | 307 | this.remoteStyle = _params.styleStr||""; |
| 308 | + this.remoteVideoWidth=parseInt(_params.width)||320; | ||
| 309 | + this.remoteVideoHeight=parseInt(_params.height)||240; | ||
| 300 | } | 310 | } |
| 301 | 311 | ||
| 302 | /* | 312 | /* |
| @@ -367,9 +377,15 @@ class WebRtcApe extends Emiter { | @@ -367,9 +377,15 @@ class WebRtcApe extends Emiter { | ||
| 367 | let device = devices[i]; | 377 | let device = devices[i]; |
| 368 | //{"deviceId":"default","kind":"audiooutput","label":"默认","groupId":"cf49a03ca26700235629fc13d3e6630bd34407c66438d157056a34dd3ae03ef5"} | 378 | //{"deviceId":"default","kind":"audiooutput","label":"默认","groupId":"cf49a03ca26700235629fc13d3e6630bd34407c66438d157056a34dd3ae03ef5"} |
| 369 | if (device.kind == 'audioinput') { | 379 | if (device.kind == 'audioinput') { |
| 380 | + if(!device.label){ | ||
| 381 | + device.label="麦克风_"+i; | ||
| 382 | + } | ||
| 370 | this.microphones.push(device); | 383 | this.microphones.push(device); |
| 371 | GlobalConfig.microphones.push(device.label); | 384 | GlobalConfig.microphones.push(device.label); |
| 372 | } else if (device.kind == 'videoinput') { | 385 | } else if (device.kind == 'videoinput') { |
| 386 | + if(!device.label){ | ||
| 387 | + device.label="摄像头_"+i; | ||
| 388 | + } | ||
| 373 | this.cameras.push(device); | 389 | this.cameras.push(device); |
| 374 | GlobalConfig.cameras.push(device.label); | 390 | GlobalConfig.cameras.push(device.label); |
| 375 | } else { | 391 | } else { |
-
请 注册 或 登录 后发表评论