正在显示
6 个修改的文件
包含
41 行增加
和
13 行删除
此 diff 太大无法显示。
| @@ -28,7 +28,7 @@ import MediaModule from 'apes/MediaModule'; | @@ -28,7 +28,7 @@ import MediaModule from 'apes/MediaModule'; | ||
| 28 | import UTF8 from 'utf-8'; | 28 | import UTF8 from 'utf-8'; |
| 29 | 29 | ||
| 30 | let loger = Loger.getLoger('McuClient'); | 30 | let loger = Loger.getLoger('McuClient'); |
| 31 | -let _sdkInfo = {"version": "v1.27.14.201705027", "author": "www.3mang.com"}; | 31 | +let _sdkInfo = {"version": "v1.27.16.201705027", "author": "www.3mang.com"}; |
| 32 | 32 | ||
| 33 | //APE | 33 | //APE |
| 34 | let _sass; | 34 | let _sass; |
| @@ -328,8 +328,11 @@ export default class MessageEntrance extends Emiter { | @@ -328,8 +328,11 @@ export default class MessageEntrance extends Emiter { | ||
| 328 | let data = {"nodeId": _param.nodeId}; | 328 | let data = {"nodeId": _param.nodeId}; |
| 329 | if (_video_ape) { | 329 | if (_video_ape) { |
| 330 | _video_ape.stopPublishVideo(data); | 330 | _video_ape.stopPublishVideo(data); |
| 331 | + | ||
| 332 | + if(GlobalConfig.nodeId==data.nodeId){ | ||
| 331 | _video_ape.stopPublishScreenShare(data); | 333 | _video_ape.stopPublishScreenShare(data); |
| 332 | } | 334 | } |
| 335 | + } | ||
| 333 | if (_audio_ape) { | 336 | if (_audio_ape) { |
| 334 | _audio_ape.stopPublishAudio(data); | 337 | _audio_ape.stopPublishAudio(data); |
| 335 | } | 338 | } |
| @@ -799,6 +802,10 @@ export default class MessageEntrance extends Emiter { | @@ -799,6 +802,10 @@ export default class MessageEntrance extends Emiter { | ||
| 799 | GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_2); | 802 | GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_2); |
| 800 | GlobalConfig.classJoinSuccess=true; | 803 | GlobalConfig.classJoinSuccess=true; |
| 801 | 804 | ||
| 805 | + GlobalConfig.screenWidth=window.screen.availWidth; | ||
| 806 | + GlobalConfig.screenHeight=window.screen.availHeight; | ||
| 807 | + | ||
| 808 | + | ||
| 802 | //返回给客户端初始化成功的数据 | 809 | //返回给客户端初始化成功的数据 |
| 803 | let joinClassSuccessCallBackData = {}; | 810 | let joinClassSuccessCallBackData = {}; |
| 804 | 811 |
| @@ -288,6 +288,9 @@ GlobalConfig.statusCode_2={"code":2,message:"已经加入课堂"}; | @@ -288,6 +288,9 @@ GlobalConfig.statusCode_2={"code":2,message:"已经加入课堂"}; | ||
| 288 | GlobalConfig.statusCode_3={"code":3,message:"已经离开课堂"}; | 288 | GlobalConfig.statusCode_3={"code":3,message:"已经离开课堂"}; |
| 289 | GlobalConfig.statusCode_4={"code":4,message:"未知状态"}; | 289 | GlobalConfig.statusCode_4={"code":4,message:"未知状态"}; |
| 290 | 290 | ||
| 291 | +GlobalConfig.screenWidth=1024; | ||
| 292 | +GlobalConfig.screenHeight=768; | ||
| 293 | + | ||
| 291 | GlobalConfig.md5=""; | 294 | GlobalConfig.md5=""; |
| 292 | GlobalConfig.msType=1;//目前固定用这个 | 295 | GlobalConfig.msType=1;//目前固定用这个 |
| 293 | GlobalConfig.messageDelay=false;//是否启用消息延迟 | 296 | GlobalConfig.messageDelay=false;//是否启用消息延迟 |
| @@ -366,6 +366,9 @@ class AudioApe extends Ape { | @@ -366,6 +366,9 @@ class AudioApe extends Ape { | ||
| 366 | receiveChannelInfo.fromNodeId=unpackChannelInfo.fromNodeId; | 366 | receiveChannelInfo.fromNodeId=unpackChannelInfo.fromNodeId; |
| 367 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; | 367 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; |
| 368 | receiveChannelInfo.userRole=unpackChannelInfo.userRole||ApeConsts.normal; | 368 | receiveChannelInfo.userRole=unpackChannelInfo.userRole||ApeConsts.normal; |
| 369 | + receiveChannelInfo.mediaType=unpackChannelInfo.mediaType||ApeConsts.MEDIA_TYPE_DEFAULT; | ||
| 370 | + receiveChannelInfo.screenWidth=unpackChannelInfo.screenWidth||GlobalConfig.screenWidth; | ||
| 371 | + receiveChannelInfo.screenHeight=unpackChannelInfo.screenHeight||GlobalConfig.screenHeight; | ||
| 369 | //消息不是自己同步的,需要处理 | 372 | //消息不是自己同步的,需要处理 |
| 370 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ | 373 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ |
| 371 | //正在推流 | 374 | //正在推流 |
| @@ -444,6 +447,8 @@ class AudioApe extends Ape { | @@ -444,6 +447,8 @@ class AudioApe extends Ape { | ||
| 444 | packPduModel.userName=GlobalConfig.userName||""; | 447 | packPduModel.userName=GlobalConfig.userName||""; |
| 445 | packPduModel.toNodeId = 0; | 448 | packPduModel.toNodeId = 0; |
| 446 | packPduModel.userRole=GlobalConfig.userRole||ApeConsts.normal; | 449 | packPduModel.userRole=GlobalConfig.userRole||ApeConsts.normal; |
| 450 | + packPduModel.screenWidth=_param.screenWidth||GlobalConfig.screenWidth; | ||
| 451 | + packPduModel.screenHeight=_param.screenHeight||GlobalConfig.screenHeight; | ||
| 447 | loger.log("packPdu->",packPduModel); | 452 | loger.log("packPdu->",packPduModel); |
| 448 | return packPduModel; | 453 | return packPduModel; |
| 449 | } | 454 | } |
| @@ -186,15 +186,7 @@ class VideoApe extends Ape { | @@ -186,15 +186,7 @@ class VideoApe extends Ape { | ||
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | //==========================屏幕共享========================================================================= | 188 | //==========================屏幕共享========================================================================= |
| 189 | - //监听屏幕共享发布成功 | ||
| 190 | - onPublishScreenShareSuccess(){ | ||
| 191 | - loger.log('屏幕共享推流成功之后才能更新同步消息->'); | ||
| 192 | - //屏幕共享推流成功之后才能更新同步消息 | ||
| 193 | - let channelInfo=this.shareApe.getPublishChannelInfo(); | ||
| 194 | - this.sendTableUpdateHandler(channelInfo); | ||
| 195 | - this._emit( MessageTypes.PUBLISH_SCREEN_SHARE_SUCCESS,{"code": ApeConsts.RETURN_SUCCESS, "data":"桌面共享推流!","mediaId":channelInfo.channelId}); | ||
| 196 | - return {"code": ApeConsts.RETURN_SUCCESS, "data":"桌面共享推流!","mediaId":channelInfo.channelId}; | ||
| 197 | - } | 189 | + |
| 198 | //屏幕共享连接打开 | 190 | //屏幕共享连接打开 |
| 199 | onPublishScreenShareFaile(){ | 191 | onPublishScreenShareFaile(){ |
| 200 | loger.log('屏幕共享推流失败->'); | 192 | loger.log('屏幕共享推流失败->'); |
| @@ -223,7 +215,15 @@ class VideoApe extends Ape { | @@ -223,7 +215,15 @@ class VideoApe extends Ape { | ||
| 223 | loger.log('屏幕共享视频信息发生改变->'); | 215 | loger.log('屏幕共享视频信息发生改变->'); |
| 224 | this._emit(MessageTypes.PUBLISH_SCREEN_VIDEO_INFO_CHANGE,data); | 216 | this._emit(MessageTypes.PUBLISH_SCREEN_VIDEO_INFO_CHANGE,data); |
| 225 | } | 217 | } |
| 226 | - | 218 | + //监听屏幕共享发布成功 |
| 219 | + onPublishScreenShareSuccess(){ | ||
| 220 | + loger.log('屏幕共享推流成功之后才能更新同步消息->'); | ||
| 221 | + //屏幕共享推流成功之后才能更新同步消息 | ||
| 222 | + let channelInfo=this.shareApe.getPublishChannelInfo(); | ||
| 223 | + this.sendTableUpdateHandler(channelInfo); | ||
| 224 | + this._emit( MessageTypes.PUBLISH_SCREEN_SHARE_SUCCESS,{"code": ApeConsts.RETURN_SUCCESS, "data":"桌面共享推流!","mediaId":channelInfo.channelId}); | ||
| 225 | + return {"code": ApeConsts.RETURN_SUCCESS, "data":"桌面共享推流!","mediaId":channelInfo.channelId}; | ||
| 226 | + } | ||
| 227 | //桌面共享推流 | 227 | //桌面共享推流 |
| 228 | publishScreenShare(_param) { | 228 | publishScreenShare(_param) { |
| 229 | if(!this.mcu.connected){ | 229 | if(!this.mcu.connected){ |
| @@ -247,7 +247,6 @@ class VideoApe extends Ape { | @@ -247,7 +247,6 @@ class VideoApe extends Ape { | ||
| 247 | // loger.warn(GlobalConfig.getCurrentStatus()); | 247 | // loger.warn(GlobalConfig.getCurrentStatus()); |
| 248 | // return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | 248 | // return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; |
| 249 | //} | 249 | //} |
| 250 | - | ||
| 251 | let channelInfo=this.shareApe.getDefaultChannelInfo(); | 250 | let channelInfo=this.shareApe.getDefaultChannelInfo(); |
| 252 | channelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; | 251 | channelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; |
| 253 | this.sendTableUpdateHandler(channelInfo); | 252 | this.sendTableUpdateHandler(channelInfo); |
| @@ -443,7 +442,7 @@ class VideoApe extends Ape { | @@ -443,7 +442,7 @@ class VideoApe extends Ape { | ||
| 443 | unpackChannelInfo.streamId=""; | 442 | unpackChannelInfo.streamId=""; |
| 444 | } | 443 | } |
| 445 | //屏幕共享的流不保存 | 444 | //屏幕共享的流不保存 |
| 446 | - if(unpackChannelInfo.mediaType!=ApeConsts.MEDIA_TYPE_SHARE){ | 445 | + if(unpackChannelInfo.mediaType!=ApeConsts.MEDIA_TYPE_SHARE&&unpackChannelInfo.channelId>0){ |
| 447 | this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo; | 446 | this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo; |
| 448 | } | 447 | } |
| 449 | 448 | ||
| @@ -454,6 +453,8 @@ class VideoApe extends Ape { | @@ -454,6 +453,8 @@ class VideoApe extends Ape { | ||
| 454 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; | 453 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; |
| 455 | receiveChannelInfo.userRole=unpackChannelInfo.userRole||ApeConsts.normal; | 454 | receiveChannelInfo.userRole=unpackChannelInfo.userRole||ApeConsts.normal; |
| 456 | receiveChannelInfo.mediaType=unpackChannelInfo.mediaType||ApeConsts.MEDIA_TYPE_DEFAULT; | 455 | receiveChannelInfo.mediaType=unpackChannelInfo.mediaType||ApeConsts.MEDIA_TYPE_DEFAULT; |
| 456 | + receiveChannelInfo.screenWidth=unpackChannelInfo.screenWidth||GlobalConfig.screenWidth; | ||
| 457 | + receiveChannelInfo.screenHeight=unpackChannelInfo.screenHeight||GlobalConfig.screenHeight; | ||
| 457 | //消息不是自己同步的,需要处理 | 458 | //消息不是自己同步的,需要处理 |
| 458 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ | 459 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ |
| 459 | //正在推流 | 460 | //正在推流 |
| @@ -494,8 +495,13 @@ class VideoApe extends Ape { | @@ -494,8 +495,13 @@ class VideoApe extends Ape { | ||
| 494 | this._emit(MessageTypes.VIDEO_STOP, receiveChannelInfo); | 495 | this._emit(MessageTypes.VIDEO_STOP, receiveChannelInfo); |
| 495 | }else{ | 496 | }else{ |
| 496 | //停止播放屏幕共享 | 497 | //停止播放屏幕共享 |
| 498 | + if(unpackChannelInfo.channelId!=0){ | ||
| 497 | loger.log("SCREEN_SHARE_STOP", receiveChannelInfo); | 499 | loger.log("SCREEN_SHARE_STOP", receiveChannelInfo); |
| 498 | this._emit(MessageTypes.SCREEN_SHARE_STOP, receiveChannelInfo); | 500 | this._emit(MessageTypes.SCREEN_SHARE_STOP, receiveChannelInfo); |
| 501 | + }else { | ||
| 502 | + | ||
| 503 | + loger.log("停止播放视频->channelId=0->不合法的id", receiveChannelInfo); | ||
| 504 | + } | ||
| 499 | } | 505 | } |
| 500 | 506 | ||
| 501 | } | 507 | } |
| @@ -557,6 +563,8 @@ class VideoApe extends Ape { | @@ -557,6 +563,8 @@ class VideoApe extends Ape { | ||
| 557 | packPduModel.userName=GlobalConfig.userName||""; | 563 | packPduModel.userName=GlobalConfig.userName||""; |
| 558 | packPduModel.toNodeId = 0; | 564 | packPduModel.toNodeId = 0; |
| 559 | packPduModel.userRole=GlobalConfig.userRole||ApeConsts.normal; | 565 | packPduModel.userRole=GlobalConfig.userRole||ApeConsts.normal; |
| 566 | + packPduModel.screenWidth=_param.screenWidth||GlobalConfig.screenWidth; | ||
| 567 | + packPduModel.screenHeight=_param.screenHeight||GlobalConfig.screenHeight; | ||
| 560 | loger.log(packPduModel); | 568 | loger.log(packPduModel); |
| 561 | return packPduModel; | 569 | return packPduModel; |
| 562 | } | 570 | } |
| @@ -790,6 +790,8 @@ message RCAudioChannelInfoPdu { | @@ -790,6 +790,8 @@ message RCAudioChannelInfoPdu { | ||
| 790 | optional string stream_id = 10;//流名称 | 790 | optional string stream_id = 10;//流名称 |
| 791 | optional string user_name = 11;//用户的名字 | 791 | optional string user_name = 11;//用户的名字 |
| 792 | optional string user_role = 12;//用户的身份 | 792 | optional string user_role = 12;//用户的身份 |
| 793 | + optional uint32 screenWidth = 13;//屏幕分辨率宽 | ||
| 794 | + optional uint32 screenHeight = 14;//屏幕分辨率高 | ||
| 793 | } | 795 | } |
| 794 | 796 | ||
| 795 | message RCVideoChannelInfoPdu { | 797 | message RCVideoChannelInfoPdu { |
| @@ -805,6 +807,9 @@ message RCVideoChannelInfoPdu { | @@ -805,6 +807,9 @@ message RCVideoChannelInfoPdu { | ||
| 805 | optional string stream_id = 10;//流名称 | 807 | optional string stream_id = 10;//流名称 |
| 806 | optional string user_name = 11;//用户的名字 | 808 | optional string user_name = 11;//用户的名字 |
| 807 | optional string user_role = 12;//用户的身份 | 809 | optional string user_role = 12;//用户的身份 |
| 810 | + optional uint32 screenWidth = 13;//屏幕分辨率宽 | ||
| 811 | + optional uint32 screenHeight = 14;//屏幕分辨率高 | ||
| 812 | + | ||
| 808 | } | 813 | } |
| 809 | 814 | ||
| 810 | message RCVideoChannelInfoRecordPdu { | 815 | message RCVideoChannelInfoRecordPdu { |
-
请 注册 或 登录 后发表评论