正在显示
10 个修改的文件
包含
100 行增加
和
25 行删除
此 diff 太大无法显示。
| @@ -63,7 +63,7 @@ export default class MessageEntrance extends Emiter { | @@ -63,7 +63,7 @@ export default class MessageEntrance extends Emiter { | ||
| 63 | super(); | 63 | super(); |
| 64 | this.lastClassActiveTime=0;//最后一次课堂激活的时间戳 | 64 | this.lastClassActiveTime=0;//最后一次课堂激活的时间戳 |
| 65 | //sdk 信息 | 65 | //sdk 信息 |
| 66 | - GlobalConfig.sdkVersion = "v2.36.8.20171206"; | 66 | + GlobalConfig.sdkVersion = "v2.38.1.201712011"; |
| 67 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); | 67 | loger.warn("sdkVersion:" + GlobalConfig.sdkVersion); |
| 68 | console.log("sdkVersion:" + GlobalConfig.sdkVersion); | 68 | console.log("sdkVersion:" + GlobalConfig.sdkVersion); |
| 69 | //设置 | 69 | //设置 |
| @@ -307,6 +307,7 @@ export default class MessageEntrance extends Emiter { | @@ -307,6 +307,7 @@ export default class MessageEntrance extends Emiter { | ||
| 307 | this.setHostRemoteMediaView = this._setHostRemoteMediaView.bind(this);//设置远程老师的视图 | 307 | this.setHostRemoteMediaView = this._setHostRemoteMediaView.bind(this);//设置远程老师的视图 |
| 308 | this.setNormalRemoteMediaView = this._setNormalRemoteMediaView.bind(this);//设置远程学生的视图 | 308 | this.setNormalRemoteMediaView = this._setNormalRemoteMediaView.bind(this);//设置远程学生的视图 |
| 309 | this.setInvisibleMediaView = this._setInvisibleMediaView.bind(this);//设置监课身份的视图 | 309 | this.setInvisibleMediaView = this._setInvisibleMediaView.bind(this);//设置监课身份的视图 |
| 310 | + this.leaveVideoChannel = this._leaveChannel.bind(this);//离开视频频道 | ||
| 310 | 311 | ||
| 311 | this.setAppConfig = this._setAppConfig.bind(this); | 312 | this.setAppConfig = this._setAppConfig.bind(this); |
| 312 | this.recordControl = this._changeMediaRecordStatus.bind(this);//切换控制音视频的录制状态 | 313 | this.recordControl = this._changeMediaRecordStatus.bind(this);//切换控制音视频的录制状态 |
| @@ -527,12 +528,12 @@ export default class MessageEntrance extends Emiter { | @@ -527,12 +528,12 @@ export default class MessageEntrance extends Emiter { | ||
| 527 | if (_whiteboard_ape) { | 528 | if (_whiteboard_ape) { |
| 528 | _whiteboard_ape.updaterRecordApeStatus(); | 529 | _whiteboard_ape.updaterRecordApeStatus(); |
| 529 | } | 530 | } |
| 530 | - if (_video_ape) { | 531 | + /* if (_video_ape) { |
| 531 | _video_ape.updaterRecordApeStatus(); | 532 | _video_ape.updaterRecordApeStatus(); |
| 532 | } | 533 | } |
| 533 | if (_audio_ape) { | 534 | if (_audio_ape) { |
| 534 | _audio_ape.updaterRecordApeStatus(); | 535 | _audio_ape.updaterRecordApeStatus(); |
| 535 | - } | 536 | + }*/ |
| 536 | if (_mediaShareApe) { | 537 | if (_mediaShareApe) { |
| 537 | _mediaShareApe.updaterRecordApeStatus(); | 538 | _mediaShareApe.updaterRecordApeStatus(); |
| 538 | } | 539 | } |
| @@ -67,8 +67,12 @@ class EngineUtils { | @@ -67,8 +67,12 @@ class EngineUtils { | ||
| 67 | let timestamp = time % 1000000000;//time后9位 | 67 | let timestamp = time % 1000000000;//time后9位 |
| 68 | return timestamp; | 68 | return timestamp; |
| 69 | } | 69 | } |
| 70 | - | ||
| 71 | //生成时间戳毫秒 | 70 | //生成时间戳毫秒 |
| 71 | + static creatNowTime() { | ||
| 72 | + let time = new Date().getTime(); | ||
| 73 | + return time; | ||
| 74 | + } | ||
| 75 | + //生成时间戳秒 | ||
| 72 | static creatTimestamp() { | 76 | static creatTimestamp() { |
| 73 | let time = parseInt(new Date().getTime() / 1000);//精确到秒 | 77 | let time = parseInt(new Date().getTime() / 1000);//精确到秒 |
| 74 | return time; | 78 | return time; |
| @@ -184,7 +184,6 @@ class EverSocket extends Emiter { | @@ -184,7 +184,6 @@ class EverSocket extends Emiter { | ||
| 184 | loger.log('ignore errors'); | 184 | loger.log('ignore errors'); |
| 185 | } | 185 | } |
| 186 | this.websocket = undefined; | 186 | this.websocket = undefined; |
| 187 | - | ||
| 188 | } | 187 | } |
| 189 | 188 | ||
| 190 | _clearHistory() { | 189 | _clearHistory() { |
| @@ -670,7 +670,7 @@ GlobalConfig.allowRecordMaxTime = 48 * 60 * 60; //(秒)允许录制的最长时 | @@ -670,7 +670,7 @@ GlobalConfig.allowRecordMaxTime = 48 * 60 * 60; //(秒)允许录制的最长时 | ||
| 670 | GlobalConfig.siteId_letv = 'shchuanbao'; //乐视,MS不需要动态选点的站点 | 670 | GlobalConfig.siteId_letv = 'shchuanbao'; //乐视,MS不需要动态选点的站点 |
| 671 | GlobalConfig.ssTunnelAppURL = ''; //屏幕共享插件的地址 | 671 | GlobalConfig.ssTunnelAppURL = ''; //屏幕共享插件的地址 |
| 672 | GlobalConfig.serverTime = 0; //服务器当前时间戳 | 672 | GlobalConfig.serverTime = 0; //服务器当前时间戳 |
| 673 | -GlobalConfig.serverAndLoacTimeDistanc = 0; //本地时间和服务器时间错的差值; | 673 | +GlobalConfig.serverAndLoacTimeDistanc = 0; //当前系统时间和服务器时间的差值 (秒); |
| 674 | GlobalConfig.logUrl = ""; //日志上报地址; | 674 | GlobalConfig.logUrl = ""; //日志上报地址; |
| 675 | 675 | ||
| 676 | GlobalConfig.rosterNum = 0;//当前总人数 | 676 | GlobalConfig.rosterNum = 0;//当前总人数 |
| @@ -109,6 +109,7 @@ MessageTypes.WEB_RTC_INIT_FAILED = "web_rtc_init_failed"; | @@ -109,6 +109,7 @@ MessageTypes.WEB_RTC_INIT_FAILED = "web_rtc_init_failed"; | ||
| 109 | MessageTypes.WEB_RTC_JOIN_SUCCESS = "web_rtc_join_success"; | 109 | MessageTypes.WEB_RTC_JOIN_SUCCESS = "web_rtc_join_success"; |
| 110 | MessageTypes.WEB_RTC_JOIN_FAILED = "web_rtc_join_failed"; | 110 | MessageTypes.WEB_RTC_JOIN_FAILED = "web_rtc_join_failed"; |
| 111 | MessageTypes.WEB_RTC_LEAVE_CHANNEL = "web_rtc_leave_channel";//离开频道 | 111 | MessageTypes.WEB_RTC_LEAVE_CHANNEL = "web_rtc_leave_channel";//离开频道 |
| 112 | +MessageTypes.WEB_RTC_REJOIN_SUCCESS = "web_rtc_rejoin_success";//重连成功 | ||
| 112 | MessageTypes.WEB_RTC_PUBLISH_FAILED = "web_rtc_publish_failed"; | 113 | MessageTypes.WEB_RTC_PUBLISH_FAILED = "web_rtc_publish_failed"; |
| 113 | MessageTypes.GET_DEVICES_SUCCESS = "get_devices_success"; | 114 | MessageTypes.GET_DEVICES_SUCCESS = "get_devices_success"; |
| 114 | MessageTypes.MEDIA_PUBLISH_STATUS_CHANGE = "media_publish_status_change";//音视频推流的状态发生改变 | 115 | MessageTypes.MEDIA_PUBLISH_STATUS_CHANGE = "media_publish_status_change";//音视频推流的状态发生改变 |
| @@ -518,7 +518,8 @@ class AudioApe extends Ape { | @@ -518,7 +518,8 @@ class AudioApe extends Ape { | ||
| 518 | packPduModel.screenHeight = _param.screenHeight || GlobalConfig.screenHeight; | 518 | packPduModel.screenHeight = _param.screenHeight || GlobalConfig.screenHeight; |
| 519 | packPduModel.deviceType = _param.deviceType || GlobalConfig.deviceType; | 519 | packPduModel.deviceType = _param.deviceType || GlobalConfig.deviceType; |
| 520 | packPduModel.optionJsonData = GlobalConfig.optionJsonData; | 520 | packPduModel.optionJsonData = GlobalConfig.optionJsonData; |
| 521 | - loger.log("packPdu->", packPduModel); | 521 | + packPduModel.sendTimestamp =EngineUtils.creatNowTime()- GlobalConfig.serverAndLoacTimeDistanc*1000;//当前时间减去服务器时间差 |
| 522 | + loger.log("packPdu------>", packPduModel); | ||
| 522 | return packPduModel; | 523 | return packPduModel; |
| 523 | } | 524 | } |
| 524 | 525 | ||
| @@ -529,7 +530,7 @@ class AudioApe extends Ape { | @@ -529,7 +530,7 @@ class AudioApe extends Ape { | ||
| 529 | } | 530 | } |
| 530 | try { | 531 | try { |
| 531 | let packChannelInfo = pdu['RCAudioChannelInfoPdu'].decode(itemData); | 532 | let packChannelInfo = pdu['RCAudioChannelInfoPdu'].decode(itemData); |
| 532 | - loger.log("unPackPdu->", packChannelInfo); | 533 | + loger.log("unPackPdu------>", packChannelInfo); |
| 533 | return packChannelInfo; | 534 | return packChannelInfo; |
| 534 | } catch (err) { | 535 | } catch (err) { |
| 535 | loger.log("unPackPdu error->itemIdx=" + itemIdx + " err:" + err.message); | 536 | loger.log("unPackPdu error->itemIdx=" + itemIdx + " err:" + err.message); |
| @@ -886,6 +886,7 @@ class VideoApe extends Ape { | @@ -886,6 +886,7 @@ class VideoApe extends Ape { | ||
| 886 | packPduModel.screenHeight = _param.screenHeight || GlobalConfig.screenHeight; | 886 | packPduModel.screenHeight = _param.screenHeight || GlobalConfig.screenHeight; |
| 887 | packPduModel.deviceType = _param.deviceType || GlobalConfig.deviceType; | 887 | packPduModel.deviceType = _param.deviceType || GlobalConfig.deviceType; |
| 888 | packPduModel.optionJsonData = GlobalConfig.optionJsonData; | 888 | packPduModel.optionJsonData = GlobalConfig.optionJsonData; |
| 889 | + packPduModel.sendTimestamp =EngineUtils.creatNowTime()- GlobalConfig.serverAndLoacTimeDistanc*1000;//当前时间减去服务器时间差 | ||
| 889 | loger.log('packPdu--------------->', packPduModel); | 890 | loger.log('packPdu--------------->', packPduModel); |
| 890 | return packPduModel; | 891 | return packPduModel; |
| 891 | } | 892 | } |
| @@ -10,7 +10,7 @@ import GlobalConfig from 'GlobalConfig'; | @@ -10,7 +10,7 @@ import GlobalConfig from 'GlobalConfig'; | ||
| 10 | import ApeConsts from './ApeConsts'; | 10 | import ApeConsts from './ApeConsts'; |
| 11 | import EngineUtils from 'EngineUtils'; | 11 | import EngineUtils from 'EngineUtils'; |
| 12 | import MessageTypes from 'MessageTypes'; | 12 | import MessageTypes from 'MessageTypes'; |
| 13 | -var AgoraRTC = require('../AgoraRTCSDK-1.14.0'); | 13 | +var AgoraRTC = require('../AgoraRTCSDK-2.0.0'); |
| 14 | let loger = Loger.getLoger('WebRtcApe'); | 14 | let loger = Loger.getLoger('WebRtcApe'); |
| 15 | const SIZE_480 = 480; | 15 | const SIZE_480 = 480; |
| 16 | const SIZE_360 = 360; | 16 | const SIZE_360 = 360; |
| @@ -63,7 +63,7 @@ class WebRtcApe extends Emiter { | @@ -63,7 +63,7 @@ class WebRtcApe extends Emiter { | ||
| 63 | this.isOpenVideo = true;//是否开启摄像头,默认为开启,如果获取不到麦克风的时候会设置为false | 63 | this.isOpenVideo = true;//是否开启摄像头,默认为开启,如果获取不到麦克风的时候会设置为false |
| 64 | 64 | ||
| 65 | this.firstPublishSuccess = false;//记录加入频道成功之后是否推流成功过,离开频道之后需要设置为false | 65 | this.firstPublishSuccess = false;//记录加入频道成功之后是否推流成功过,离开频道之后需要设置为false |
| 66 | - | 66 | + this.isWebSocketDisconnect=false;//记录中途是否已经断开 |
| 67 | this.isPublish = false;//当前是否正在推流 | 67 | this.isPublish = false;//当前是否正在推流 |
| 68 | this.videoScale = 1;//视图的缩放比例,默认为1; | 68 | this.videoScale = 1;//视图的缩放比例,默认为1; |
| 69 | 69 | ||
| @@ -149,15 +149,30 @@ class WebRtcApe extends Emiter { | @@ -149,15 +149,30 @@ class WebRtcApe extends Emiter { | ||
| 149 | this.channelKey = ""; | 149 | this.channelKey = ""; |
| 150 | this.client.on('error', (err) => { | 150 | this.client.on('error', (err) => { |
| 151 | loger.log("WebRtc异常:", err); | 151 | loger.log("WebRtc异常:", err); |
| 152 | - if (err.reason === 'DYNAMIC_KEY_TIMEOUT') { | 152 | + switch (err.reason){ |
| 153 | + case "DYNAMIC_KEY_TIMEOUT": | ||
| 153 | this.client.renewChannelKey(this.channelKey, ()=> { | 154 | this.client.renewChannelKey(this.channelKey, ()=> { |
| 154 | loger.log("Renew channel key successfully"); | 155 | loger.log("Renew channel key successfully"); |
| 155 | }, (err)=> { | 156 | }, (err)=> { |
| 156 | loger.log("Renew channel key failed: ", err); | 157 | loger.log("Renew channel key failed: ", err); |
| 157 | }); | 158 | }); |
| 159 | + break; | ||
| 160 | + case "SOCKET_DISCONNECTED": | ||
| 161 | + //连接断开 | ||
| 162 | + this.isWebSocketDisconnect=true; | ||
| 163 | + this._emit(MessageTypes.WEB_RTC_LEAVE_CHANNEL); | ||
| 164 | + break; | ||
| 165 | + case "SOCKET_ERROR": | ||
| 166 | + //连接断开 | ||
| 167 | + this.isWebSocketDisconnect=true; | ||
| 168 | + this._emit(MessageTypes.WEB_RTC_LEAVE_CHANNEL); | ||
| 169 | + break; | ||
| 170 | + default : | ||
| 171 | + break; | ||
| 158 | } | 172 | } |
| 159 | }); | 173 | }); |
| 160 | this.client.on('stream-published', (evt)=> { | 174 | this.client.on('stream-published', (evt)=> { |
| 175 | + this.reJoinChannelSuccess(); | ||
| 161 | loger.log("webRtc->推流成功->", new Date().getTime()); | 176 | loger.log("webRtc->推流成功->", new Date().getTime()); |
| 162 | this.isPublish = true; | 177 | this.isPublish = true; |
| 163 | this.firstPublishSuccess = true; | 178 | this.firstPublishSuccess = true; |
| @@ -305,10 +320,21 @@ class WebRtcApe extends Emiter { | @@ -305,10 +320,21 @@ class WebRtcApe extends Emiter { | ||
| 305 | this.remoteVideoList[user.nodeId] = stream; | 320 | this.remoteVideoList[user.nodeId] = stream; |
| 306 | } | 321 | } |
| 307 | } | 322 | } |
| 308 | - | ||
| 309 | this.clearInvalidVideoView(); | 323 | this.clearInvalidVideoView(); |
| 324 | + this.reJoinChannelSuccess(); | ||
| 310 | } | 325 | } |
| 311 | 326 | ||
| 327 | + /* | ||
| 328 | + * | ||
| 329 | + * 断线后重连成功 | ||
| 330 | + * */ | ||
| 331 | + reJoinChannelSuccess(){ | ||
| 332 | + if(this.isWebSocketDisconnect){ | ||
| 333 | + loger.log("断线重连成功"); | ||
| 334 | + this._emit(MessageTypes.WEB_RTC_REJOIN_SUCCESS); | ||
| 335 | + } | ||
| 336 | + this.isWebSocketDisconnect=false; | ||
| 337 | + } | ||
| 312 | //清除无效的视图 | 338 | //清除无效的视图 |
| 313 | clearInvalidVideoView() { | 339 | clearInvalidVideoView() { |
| 314 | let normalList = document.getElementsByClassName(this.normalWebRtcVideoClass); | 340 | let normalList = document.getElementsByClassName(this.normalWebRtcVideoClass); |
| @@ -445,6 +471,7 @@ class WebRtcApe extends Emiter { | @@ -445,6 +471,7 @@ class WebRtcApe extends Emiter { | ||
| 445 | this.client.join(this.channelKey, "" + this.channelId, this.uid, (uid)=> { | 471 | this.client.join(this.channelKey, "" + this.channelId, this.uid, (uid)=> { |
| 446 | this.uid = uid; | 472 | this.uid = uid; |
| 447 | loger.log("加入视频通话频道->成功->channelId:" + this.channelId, "uid:" + this.uid); | 473 | loger.log("加入视频通话频道->成功->channelId:" + this.channelId, "uid:" + this.uid); |
| 474 | + this.isWebSocketDisconnect=false; | ||
| 448 | this._emit(MessageTypes.WEB_RTC_JOIN_SUCCESS); | 475 | this._emit(MessageTypes.WEB_RTC_JOIN_SUCCESS); |
| 449 | this.openLoaclStream(); | 476 | this.openLoaclStream(); |
| 450 | 477 | ||
| @@ -473,7 +500,6 @@ class WebRtcApe extends Emiter { | @@ -473,7 +500,6 @@ class WebRtcApe extends Emiter { | ||
| 473 | this.rePublishDelay = setTimeout(()=> { | 500 | this.rePublishDelay = setTimeout(()=> { |
| 474 | this.publish(); | 501 | this.publish(); |
| 475 | }, 1200); | 502 | }, 1200); |
| 476 | - //this.publish(); | ||
| 477 | } else { | 503 | } else { |
| 478 | this.openLoaclStream(); | 504 | this.openLoaclStream(); |
| 479 | } | 505 | } |
| @@ -494,6 +520,15 @@ class WebRtcApe extends Emiter { | @@ -494,6 +520,15 @@ class WebRtcApe extends Emiter { | ||
| 494 | screen: false | 520 | screen: false |
| 495 | }); | 521 | }); |
| 496 | 522 | ||
| 523 | + this.localStream.on("accessAllowed", function(){ | ||
| 524 | + loger.warn("摄像头麦克风->已经获取权限"); | ||
| 525 | + }) | ||
| 526 | + | ||
| 527 | + // The user has denied access to the camera and mic. | ||
| 528 | + this.localStream.on("accessDenied", function(){ | ||
| 529 | + loger.warn("摄像头和麦克风->权限获取失败"); | ||
| 530 | + }) | ||
| 531 | + | ||
| 497 | if (this.isOpenVideo) { | 532 | if (this.isOpenVideo) { |
| 498 | loger.log("摄像头已经获取->设置本地视频分辨率:" + this.videoResolution); | 533 | loger.log("摄像头已经获取->设置本地视频分辨率:" + this.videoResolution); |
| 499 | //设置视频分辨率 | 534 | //设置视频分辨率 |
| @@ -507,7 +542,7 @@ class WebRtcApe extends Emiter { | @@ -507,7 +542,7 @@ class WebRtcApe extends Emiter { | ||
| 507 | } | 542 | } |
| 508 | 543 | ||
| 509 | leaveChannel() { | 544 | leaveChannel() { |
| 510 | - loger.log("调用离开视频通话频道->isPublish" + this.isPublish); | 545 | + loger.log("调用离开视频通话频道->isPublish:" + this.isPublish); |
| 511 | this._emit(MessageTypes.WEB_RTC_LEAVE_CHANNEL); | 546 | this._emit(MessageTypes.WEB_RTC_LEAVE_CHANNEL); |
| 512 | if (!this.client) { | 547 | if (!this.client) { |
| 513 | return; | 548 | return; |
| @@ -519,6 +554,7 @@ class WebRtcApe extends Emiter { | @@ -519,6 +554,7 @@ class WebRtcApe extends Emiter { | ||
| 519 | }, (err)=> { | 554 | }, (err)=> { |
| 520 | loger.log("离开视频通话频道->失败"); | 555 | loger.log("离开视频通话频道->失败"); |
| 521 | }); | 556 | }); |
| 557 | + this.clearAllRemoteView(); | ||
| 522 | } | 558 | } |
| 523 | 559 | ||
| 524 | closeRemoteVideoView(_data) { | 560 | closeRemoteVideoView(_data) { |
| @@ -575,7 +611,8 @@ class WebRtcApe extends Emiter { | @@ -575,7 +611,8 @@ class WebRtcApe extends Emiter { | ||
| 575 | return; | 611 | return; |
| 576 | } | 612 | } |
| 577 | if (!this.localStream) { | 613 | if (!this.localStream) { |
| 578 | - loger.warn("推流失败->本地流获取失败!"); | 614 | + loger.warn("推流失败->本地流获取失败!->尝试重新获取本地流"); |
| 615 | + this.openLoaclStream(); | ||
| 579 | return; | 616 | return; |
| 580 | } | 617 | } |
| 581 | //老师-助教-主讲人-->设置旁路大于30秒没有推流,推流服务会停止,需要重设旁录和重加频道; | 618 | //老师-助教-主讲人-->设置旁路大于30秒没有推流,推流服务会停止,需要重设旁录和重加频道; |
| @@ -635,6 +672,7 @@ class WebRtcApe extends Emiter { | @@ -635,6 +672,7 @@ class WebRtcApe extends Emiter { | ||
| 635 | this.localStream.play(viewName); | 672 | this.localStream.play(viewName); |
| 636 | this.client.publish(this.localStream, (err)=> { | 673 | this.client.publish(this.localStream, (err)=> { |
| 637 | loger.log("webRtc->推流失败: " + err); | 674 | loger.log("webRtc->推流失败: " + err); |
| 675 | + this._emit(MessageTypes.WEB_RTC_PUBLISH_FAILED, {type:"error",msg:err.msg||err}); | ||
| 638 | this.isPublish = false; | 676 | this.isPublish = false; |
| 639 | this.unpublish(); | 677 | this.unpublish(); |
| 640 | }); | 678 | }); |
| @@ -642,7 +680,7 @@ class WebRtcApe extends Emiter { | @@ -642,7 +680,7 @@ class WebRtcApe extends Emiter { | ||
| 642 | loger.warn("webRtc->推流->本地流开启失败", err); | 680 | loger.warn("webRtc->推流->本地流开启失败", err); |
| 643 | this.isPublish = false; | 681 | this.isPublish = false; |
| 644 | this.clearLocalView(); | 682 | this.clearLocalView(); |
| 645 | - this._emit(MessageTypes.WEB_RTC_PUBLISH_FAILED, err); | 683 | + this._emit(MessageTypes.WEB_RTC_PUBLISH_FAILED, {type:"error",msg:err.msg||err}); |
| 646 | if (err) { | 684 | if (err) { |
| 647 | switch (err.msg) { | 685 | switch (err.msg) { |
| 648 | case "DEVICES_NOT_FOUND": | 686 | case "DEVICES_NOT_FOUND": |
| @@ -719,6 +757,14 @@ class WebRtcApe extends Emiter { | @@ -719,6 +757,14 @@ class WebRtcApe extends Emiter { | ||
| 719 | $("." + this.localWebRtcVideoClass).remove(); | 757 | $("." + this.localWebRtcVideoClass).remove(); |
| 720 | } | 758 | } |
| 721 | 759 | ||
| 760 | + //清除所有远程视图 | ||
| 761 | + clearAllRemoteView() { | ||
| 762 | + loger.log("清除所有远程视图"); | ||
| 763 | + $("." + this.localWebRtcVideoClass).remove(); | ||
| 764 | + $("." + this.hostWebRtcVideoClass).remove(); | ||
| 765 | + $("." + this.normalWebRtcVideoClass).remove(); | ||
| 766 | + } | ||
| 767 | + | ||
| 722 | /* | 768 | /* |
| 723 | * 更新所有视频的尺寸大小 | 769 | * 更新所有视频的尺寸大小 |
| 724 | * */ | 770 | * */ |
| @@ -912,11 +958,18 @@ class WebRtcApe extends Emiter { | @@ -912,11 +958,18 @@ class WebRtcApe extends Emiter { | ||
| 912 | if (idArr && idArr.length > 1) { | 958 | if (idArr && idArr.length > 1) { |
| 913 | uid = parseInt(idArr[1]); | 959 | uid = parseInt(idArr[1]); |
| 914 | } | 960 | } |
| 961 | + let user = GlobalConfig.getUserInfoFromeNodeId(parseInt(uid)); | ||
| 962 | + let userName=""; | ||
| 963 | + let roleRole=""; | ||
| 964 | + if (user) { | ||
| 965 | + roleRole = GlobalConfig.getUserRoleToString(user.role); | ||
| 966 | + userName = user.name; | ||
| 967 | + } | ||
| 915 | if (className.indexOf("cameraOn") > 0) { | 968 | if (className.indexOf("cameraOn") > 0) { |
| 916 | - loger.log("点击禁用视频->" + uid); | 969 | + loger.log("点击禁用视频按钮->用户:["+roleRole+"] " +userName+" uid:"+uid); |
| 917 | this.sendChangeUserMediaEnabled({nodeId: uid, video: false, audio: true}); | 970 | this.sendChangeUserMediaEnabled({nodeId: uid, video: false, audio: true}); |
| 918 | } else { | 971 | } else { |
| 919 | - loger.log("点击解除视频禁用->" + uid); | 972 | + loger.log("点击解除视频禁用按钮->用户:["+roleRole+"] " +userName+" uid:"+uid); |
| 920 | this.sendChangeUserMediaEnabled({nodeId: uid, video: true, audio: true}); | 973 | this.sendChangeUserMediaEnabled({nodeId: uid, video: true, audio: true}); |
| 921 | } | 974 | } |
| 922 | } | 975 | } |
| @@ -931,11 +984,19 @@ class WebRtcApe extends Emiter { | @@ -931,11 +984,19 @@ class WebRtcApe extends Emiter { | ||
| 931 | if (idArr && idArr.length > 1) { | 984 | if (idArr && idArr.length > 1) { |
| 932 | uid = parseInt(idArr[1]); | 985 | uid = parseInt(idArr[1]); |
| 933 | } | 986 | } |
| 987 | + let user = GlobalConfig.getUserInfoFromeNodeId(parseInt(uid)); | ||
| 988 | + let userName=""; | ||
| 989 | + let roleRole=""; | ||
| 990 | + if (user) { | ||
| 991 | + roleRole = GlobalConfig.getUserRoleToString(user.role); | ||
| 992 | + userName = user.name; | ||
| 993 | + } | ||
| 994 | + | ||
| 934 | if (className.indexOf("microphoneOn") > 0) { | 995 | if (className.indexOf("microphoneOn") > 0) { |
| 935 | - loger.log("点击禁音->" + uid); | 996 | + loger.log("点击禁音按钮->用户:["+roleRole+"] " +userName+" uid:"+uid); |
| 936 | this.sendChangeUserMediaEnabled({nodeId: uid, video: true, audio: false}); | 997 | this.sendChangeUserMediaEnabled({nodeId: uid, video: true, audio: false}); |
| 937 | } else { | 998 | } else { |
| 938 | - loger.log("点击解除禁音"); | 999 | + loger.log("点击解除禁音按钮->用户:["+roleRole+"] " +userName+" uid:"+uid); |
| 939 | this.sendChangeUserMediaEnabled({nodeId: uid, video: true, audio: true}); | 1000 | this.sendChangeUserMediaEnabled({nodeId: uid, video: true, audio: true}); |
| 940 | } | 1001 | } |
| 941 | } | 1002 | } |
| @@ -955,7 +1016,6 @@ class WebRtcApe extends Emiter { | @@ -955,7 +1016,6 @@ class WebRtcApe extends Emiter { | ||
| 955 | if (!_data) { | 1016 | if (!_data) { |
| 956 | return; | 1017 | return; |
| 957 | } | 1018 | } |
| 958 | - | ||
| 959 | if (_data.nodeId != GlobalConfig.nodeId) { | 1019 | if (_data.nodeId != GlobalConfig.nodeId) { |
| 960 | //不是自己的只设置状态显示即可 | 1020 | //不是自己的只设置状态显示即可 |
| 961 | //音频 | 1021 | //音频 |
| @@ -965,7 +1025,7 @@ class WebRtcApe extends Emiter { | @@ -965,7 +1025,7 @@ class WebRtcApe extends Emiter { | ||
| 965 | } else { | 1025 | } else { |
| 966 | //控制自己的音频 | 1026 | //控制自己的音频 |
| 967 | if (this.isEnableVideo == _data.video && this.isEnableAudio == _data.audio) { | 1027 | if (this.isEnableVideo == _data.video && this.isEnableAudio == _data.audio) { |
| 968 | - loger.log("收到控制音视频禁用消息->自己当前状态一直不需要设置:", _data); | 1028 | + loger.log("收到控制音视频禁用消息->自己当前状态一不需要设置:", _data); |
| 969 | return; | 1029 | return; |
| 970 | } | 1030 | } |
| 971 | //记录自己当前的音视频禁用状态 | 1031 | //记录自己当前的音视频禁用状态 |
| @@ -984,7 +1044,7 @@ class WebRtcApe extends Emiter { | @@ -984,7 +1044,7 @@ class WebRtcApe extends Emiter { | ||
| 984 | this.enableVideo(_data.nodeId); | 1044 | this.enableVideo(_data.nodeId); |
| 985 | } | 1045 | } |
| 986 | //更新同步用户的媒体禁用状态 | 1046 | //更新同步用户的媒体禁用状态 |
| 987 | - loger.log("更新同步用户的媒体禁用状态", _data); | 1047 | + //loger.log("更新同步用户的媒体禁用状态", _data); |
| 988 | if (_data) { | 1048 | if (_data) { |
| 989 | this._emit(WebRtcApe.UPDATE_USER_MEDIA_MUTED_STATUS, _data); | 1049 | this._emit(WebRtcApe.UPDATE_USER_MEDIA_MUTED_STATUS, _data); |
| 990 | } | 1050 | } |
| @@ -1024,12 +1084,13 @@ class WebRtcApe extends Emiter { | @@ -1024,12 +1084,13 @@ class WebRtcApe extends Emiter { | ||
| 1024 | * | 1084 | * |
| 1025 | * */ | 1085 | * */ |
| 1026 | setUidAudioEnabledStatus(uid, isEnable) { | 1086 | setUidAudioEnabledStatus(uid, isEnable) { |
| 1027 | - loger.log("设置音频禁用按钮的状态", uid, isEnable); | ||
| 1028 | if (isEnable == true) { | 1087 | if (isEnable == true) { |
| 1088 | + loger.log("设置音频禁用按钮的状态", uid, "开启"); | ||
| 1029 | $("#" + this.audioMutedIdName + uid).removeClass("microphoneOff"); | 1089 | $("#" + this.audioMutedIdName + uid).removeClass("microphoneOff"); |
| 1030 | $("#" + this.audioMutedIdName + uid).addClass("audioAndVideMuted microphoneOn"); | 1090 | $("#" + this.audioMutedIdName + uid).addClass("audioAndVideMuted microphoneOn"); |
| 1031 | $("#" + this.audioMutedIdName + uid).attr("title", this.closeMicrophoneTitle); | 1091 | $("#" + this.audioMutedIdName + uid).attr("title", this.closeMicrophoneTitle); |
| 1032 | } else { | 1092 | } else { |
| 1093 | + loger.log("设置音频禁用按钮的状态", uid, "禁用"); | ||
| 1033 | $("#" + this.audioMutedIdName + uid).removeClass("microphoneOn"); | 1094 | $("#" + this.audioMutedIdName + uid).removeClass("microphoneOn"); |
| 1034 | $("#" + this.audioMutedIdName + uid).addClass("audioAndVideMuted microphoneOff"); | 1095 | $("#" + this.audioMutedIdName + uid).addClass("audioAndVideMuted microphoneOff"); |
| 1035 | $("#" + this.audioMutedIdName + uid).attr("title", this.openMicrophoneTitle); | 1096 | $("#" + this.audioMutedIdName + uid).attr("title", this.openMicrophoneTitle); |
| @@ -1069,16 +1130,17 @@ class WebRtcApe extends Emiter { | @@ -1069,16 +1130,17 @@ class WebRtcApe extends Emiter { | ||
| 1069 | * | 1130 | * |
| 1070 | * */ | 1131 | * */ |
| 1071 | setUidVideoEnabledStatus(uid, isEnable) { | 1132 | setUidVideoEnabledStatus(uid, isEnable) { |
| 1072 | - loger.log("设置视频禁用按钮的状态", uid, isEnable); | ||
| 1073 | let user = GlobalConfig.getUserInfoFromeNodeId(parseInt(uid)); | 1133 | let user = GlobalConfig.getUserInfoFromeNodeId(parseInt(uid)); |
| 1074 | if(user&&user.cameras&&user.cameras.length<1){ | 1134 | if(user&&user.cameras&&user.cameras.length<1){ |
| 1075 | //用户没有摄像头 显示音频封面 | 1135 | //用户没有摄像头 显示音频封面 |
| 1076 | $("#audioPlayIcoBox" + uid).show(); | 1136 | $("#audioPlayIcoBox" + uid).show(); |
| 1077 | $("#" + this.videoMutedIdName + uid).hide(); | 1137 | $("#" + this.videoMutedIdName + uid).hide(); |
| 1138 | + loger.log("设置视频禁用按钮的状态->没有摄像头不需要设置", uid, isEnable) | ||
| 1078 | return; | 1139 | return; |
| 1079 | } | 1140 | } |
| 1080 | if (isEnable == true) { | 1141 | if (isEnable == true) { |
| 1081 | //开启 | 1142 | //开启 |
| 1143 | + loger.log("设置视频禁用按钮的状态", uid, "开启"); | ||
| 1082 | $("#audioPlayIcoBox" + uid).hide(); | 1144 | $("#audioPlayIcoBox" + uid).hide(); |
| 1083 | $("#" + this.videoMutedIdName + uid).removeClass("cameraOff"); | 1145 | $("#" + this.videoMutedIdName + uid).removeClass("cameraOff"); |
| 1084 | $("#" + this.videoMutedIdName + uid).addClass("audioAndVideMuted cameraOn"); | 1146 | $("#" + this.videoMutedIdName + uid).addClass("audioAndVideMuted cameraOn"); |
| @@ -1086,6 +1148,7 @@ class WebRtcApe extends Emiter { | @@ -1086,6 +1148,7 @@ class WebRtcApe extends Emiter { | ||
| 1086 | 1148 | ||
| 1087 | } else { | 1149 | } else { |
| 1088 | //禁用 | 1150 | //禁用 |
| 1151 | + loger.log("设置视频禁用按钮的状态", uid, "禁用"); | ||
| 1089 | $("#audioPlayIcoBox" + uid).show(); | 1152 | $("#audioPlayIcoBox" + uid).show(); |
| 1090 | $("#" + this.videoMutedIdName + uid).removeClass("cameraOn"); | 1153 | $("#" + this.videoMutedIdName + uid).removeClass("cameraOn"); |
| 1091 | $("#" + this.videoMutedIdName + uid).addClass("audioAndVideMuted cameraOff"); | 1154 | $("#" + this.videoMutedIdName + uid).addClass("audioAndVideMuted cameraOff"); |
| @@ -838,6 +838,10 @@ message RCAudioChannelInfoPdu { | @@ -838,6 +838,10 @@ message RCAudioChannelInfoPdu { | ||
| 838 | optional uint32 screenHeight = 14;//屏幕分辨率高 | 838 | optional uint32 screenHeight = 14;//屏幕分辨率高 |
| 839 | optional uint32 deviceType = 15;//设备类型 | 839 | optional uint32 deviceType = 15;//设备类型 |
| 840 | optional string optionJsonData =16;//其他参数的json对象 | 840 | optional string optionJsonData =16;//其他参数的json对象 |
| 841 | + optional string m3u8Url =17;//m3u8拉流地址 | ||
| 842 | + optional string rtmpUrl =18;//rtmp拉流地址 | ||
| 843 | + optional string replay =19;//回放的拉流地址 | ||
| 844 | + optional uint64 sendTimestamp =20;//发送消息的时间戳 | ||
| 841 | } | 845 | } |
| 842 | 846 | ||
| 843 | message RCVideoChannelInfoPdu { | 847 | message RCVideoChannelInfoPdu { |
| @@ -860,6 +864,7 @@ message RCVideoChannelInfoPdu { | @@ -860,6 +864,7 @@ message RCVideoChannelInfoPdu { | ||
| 860 | optional string m3u8Url =17;//m3u8拉流地址 | 864 | optional string m3u8Url =17;//m3u8拉流地址 |
| 861 | optional string rtmpUrl =18;//rtmp拉流地址 | 865 | optional string rtmpUrl =18;//rtmp拉流地址 |
| 862 | optional string replay =19;//回放的拉流地址 | 866 | optional string replay =19;//回放的拉流地址 |
| 867 | + optional uint64 sendTimestamp =20;//发送消息的时间戳 | ||
| 863 | } | 868 | } |
| 864 | 869 | ||
| 865 | message RCVideoChannelInfoRecordPdu { | 870 | message RCVideoChannelInfoRecordPdu { |
-
请 注册 或 登录 后发表评论