李勇

修复媒体共享模块权限,只有老师有开启和停止的权限,修复学生退出课堂时停止了屏幕共享的bug

此 diff 太大无法显示。
@@ -33,7 +33,7 @@ import QuestionApe from 'apes/QuestionApe'; @@ -33,7 +33,7 @@ import QuestionApe from 'apes/QuestionApe';
33 import UTF8 from 'utf-8'; 33 import UTF8 from 'utf-8';
34 34
35 let loger = Loger.getLoger('McuClient'); 35 let loger = Loger.getLoger('McuClient');
36 -let _sdkInfo = { "version": "v1.37.1.20170622", "author": "www.3mang.com" }; 36 +let _sdkInfo = { "version": "v1.37.2.20170622", "author": "www.3mang.com" };
37 37
38 //APE 38 //APE
39 let _sass; 39 let _sass;
@@ -171,17 +171,6 @@ class QuestionApe extends Ape { @@ -171,17 +171,6 @@ class QuestionApe extends Ape {
171 loger.log("更新答题数据"); 171 loger.log("更新答题数据");
172 if(GlobalConfig.isHost){ 172 if(GlobalConfig.isHost){
173 ////老师,只统计数据,不答题 173 ////老师,只统计数据,不答题
174 - ////先判断时间是否超时  
175 - //let timeDistance=EngineUtils.creatTimestamp()-model.timestamp;  
176 - //loger.log("答题卡显示倒计时->timeDistance:"+timeDistance);  
177 - //timeDistance=model.timeLimit-timeDistance;  
178 - //if(timeDistance<=0){  
179 - // //答题卡时间到,需要停止  
180 - // loger.log("答题卡时间到->需要停止");  
181 - // this.stopQuestion(model);  
182 - //}else {  
183 - // this.getQuestionResult(model);  
184 - //}  
185 this.getQuestionResult(model); 174 this.getQuestionResult(model);
186 }else if(GlobalConfig.isNormal) { 175 }else if(GlobalConfig.isNormal) {
187 //学生->如果自己已经提交过答案就不需要再显示 176 //学生->如果自己已经提交过答案就不需要再显示
@@ -235,10 +235,13 @@ class VideoApe extends Ape { @@ -235,10 +235,13 @@ class VideoApe extends Ape {
235 if(_param&&_param.type=='live'){ 235 if(_param&&_param.type=='live'){
236 publishType='live'; 236 publishType='live';
237 } 237 }
  238 + //老师能开启屏幕共享
  239 + if(GlobalConfig.isHost) {
238 //获取屏幕共享推流的地址 240 //获取屏幕共享推流的地址
239 - let shareResult=this.mediaModule.getMediaPublishPathForScreenShare(this.shareApe.channelId,publishType); 241 + let shareResult = this.mediaModule.getMediaPublishPathForScreenShare(this.shareApe.channelId, publishType);
240 this.shareApe.publish(shareResult); 242 this.shareApe.publish(shareResult);
241 } 243 }
  244 + }
242 245
243 //停止桌面共享推流 246 //停止桌面共享推流
244 stopPublishScreenShare(_param) { 247 stopPublishScreenShare(_param) {
@@ -247,6 +250,8 @@ class VideoApe extends Ape { @@ -247,6 +250,8 @@ class VideoApe extends Ape {
247 loger.warn(GlobalConfig.getCurrentStatus()); 250 loger.warn(GlobalConfig.getCurrentStatus());
248 return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; 251 return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};
249 } 252 }
  253 + //只有老师能停止屏幕共享
  254 + if(GlobalConfig.isHost){
250 let channelInfo=this.shareApe.getDefaultChannelInfo(); 255 let channelInfo=this.shareApe.getDefaultChannelInfo();
251 channelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; 256 channelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED;
252 this.sendTableUpdateHandler(channelInfo); 257 this.sendTableUpdateHandler(channelInfo);
@@ -254,6 +259,8 @@ class VideoApe extends Ape { @@ -254,6 +259,8 @@ class VideoApe extends Ape {
254 this.shareApe.stopPublish(); 259 this.shareApe.stopPublish();
255 } 260 }
256 261
  262 + }
  263 +
257 //=============================屏幕共享 end================================================= 264 //=============================屏幕共享 end=================================================
258 265
259 //释放nodeId占用的指定的channelId频道 266 //释放nodeId占用的指定的channelId频道