李勇

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

此 diff 太大无法显示。
... ... @@ -33,7 +33,7 @@ import QuestionApe from 'apes/QuestionApe';
import UTF8 from 'utf-8';
let loger = Loger.getLoger('McuClient');
let _sdkInfo = { "version": "v1.37.1.20170622", "author": "www.3mang.com" };
let _sdkInfo = { "version": "v1.37.2.20170622", "author": "www.3mang.com" };
//APE
let _sass;
... ...
... ... @@ -171,17 +171,6 @@ class QuestionApe extends Ape {
loger.log("更新答题数据");
if(GlobalConfig.isHost){
////老师,只统计数据,不答题
////先判断时间是否超时
//let timeDistance=EngineUtils.creatTimestamp()-model.timestamp;
//loger.log("答题卡显示倒计时->timeDistance:"+timeDistance);
//timeDistance=model.timeLimit-timeDistance;
//if(timeDistance<=0){
// //答题卡时间到,需要停止
// loger.log("答题卡时间到->需要停止");
// this.stopQuestion(model);
//}else {
// this.getQuestionResult(model);
//}
this.getQuestionResult(model);
}else if(GlobalConfig.isNormal) {
//学生->如果自己已经提交过答案就不需要再显示
... ...
... ... @@ -235,9 +235,12 @@ class VideoApe extends Ape {
if(_param&&_param.type=='live'){
publishType='live';
}
//获取屏幕共享推流的地址
let shareResult=this.mediaModule.getMediaPublishPathForScreenShare(this.shareApe.channelId,publishType);
this.shareApe.publish(shareResult);
//老师能开启屏幕共享
if(GlobalConfig.isHost) {
//获取屏幕共享推流的地址
let shareResult = this.mediaModule.getMediaPublishPathForScreenShare(this.shareApe.channelId, publishType);
this.shareApe.publish(shareResult);
}
}
//停止桌面共享推流
... ... @@ -247,11 +250,15 @@ class VideoApe extends Ape {
loger.warn(GlobalConfig.getCurrentStatus());
return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};
}
let channelInfo=this.shareApe.getDefaultChannelInfo();
channelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED;
this.sendTableUpdateHandler(channelInfo);
//只有老师能停止屏幕共享
if(GlobalConfig.isHost){
let channelInfo=this.shareApe.getDefaultChannelInfo();
channelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED;
this.sendTableUpdateHandler(channelInfo);
this.shareApe.stopPublish();
}
this.shareApe.stopPublish();
}
//=============================屏幕共享 end=================================================
... ...