李勇

1.增加推流时是否可以继续推流的判断;2.修改推流和拉流过程中人员名称的显示

... ... @@ -62,7 +62,7 @@ export default class MessageEntrance extends Emiter {
constructor() {
super();
//sdk 信息
GlobalConfig.sdkVersion = "v2.5.12.20170915";
GlobalConfig.sdkVersion = "v2.6.2.20170915";
loger.warn("sdkVersion:" + GlobalConfig.sdkVersion);
//设置
... ... @@ -2799,6 +2799,14 @@ export default class MessageEntrance extends Emiter {
* 发布流
* */
_publishMedia(_params){
//判断是否能推流,当前课堂推流人数是有限制的
let premission=GlobalConfig.getPublishPermission();
loger.log("判断是否能推流->",premission);
if(!premission&&GlobalConfig.userRole!=ApeConsts.invisible){
loger.warn("不能再打开更多设备");
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_WEBRTC_PUBLISH_FULL);
return ;
}
//ios和安卓的只需要更新数据即可
if(GlobalConfig.deviceType==1||GlobalConfig.deviceType==2){
loger.log("调用webRtc推流");
... ...
... ... @@ -172,6 +172,24 @@ class GlobalConfig {
static getUserInfoFromeNodeId(_nodeId){
return this.rosters[_nodeId];
}
//获取推流权限,需要检查当前是否可以继续推流
static getPublishPermission(){
if(!this.rosters){
return true;
}
let openCounter=0;
for (let i in this.rosters){
let item=this.rosters[i];
if(item&&(item.openCamera>0||item.openMicrophones>0)){
openCounter++;
//统计当前已经开启摄像头和麦克风的人数,如果当前开启的人数大于等于最大允许的数量就不允许其他人再打开
if(openCounter>=GlobalConfig.maxMediaChannels){
return false;
}
}
}
return true;
}
// 判断自己是否主持人角色
static get isHost() {
if (this.userRole == ApeConsts.host) {
... ...
... ... @@ -171,6 +171,9 @@ MessageTypes.ERR_INTERFACE_PARAMS_ERROR = 702; //调用的接口,传递的参
MessageTypes.ERR_MUSICSHARE_DELETE_FAILED = 720; //删除媒体共享文件失败
MessageTypes.ERR_MUSICSHARE_DELETE_FAILED_PARAM = 721; //删除媒体共享文件,参数错误
MessageTypes.ERR_WEBRTC_PUBLISH_FULL = 800; //webRtc推流人数已经满,不能再打开更多的设备推流
MessageTypes.ERR_INIT_RECORD_PLAY_BACK_FAILED = 910; //初始化录制回放失败
MessageTypes.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED = 911; //获取录制回放数据失败
... ... @@ -223,6 +226,8 @@ MessageTypes.ErrorReson[MessageTypes.ERR_SDK_FAILED] = "sdk还没初始化";
MessageTypes.ErrorReson[MessageTypes.ERR_INTERFACE_NONE] = "调用的接口不存在";
MessageTypes.ErrorReson[MessageTypes.ERR_INTERFACE_PARAMS_ERROR] = "调用的接口,传递的参数不正确";
MessageTypes.ErrorReson[MessageTypes.ERR_WEBRTC_PUBLISH_FULL] = "已经达到最大推流数量,不能再打开更多设备";
MessageTypes.ErrorReson[MessageTypes.ERR_INIT_RECORD_PLAY_BACK_FAILED] = "初始化录制回放失败";
MessageTypes.ErrorReson[MessageTypes.ERR_GET_RECORD_PLAY_BACK_DATA_FAILED] = "获取录制回放数据失败";
... ...
... ... @@ -326,8 +326,7 @@ class WebRtcApe extends Emiter {
this.localStream.close();
//$(this.localViewId).html("");
$('#localVideoBox_' + this.uid).remove();
$("videoOwnerName_"+this.uid).remove();
$("#videoOwnerName_"+this.uid).remove();
this.isPublish=false;
GlobalConfig.openCamera =0;
GlobalConfig.openMicrophones =0;
... ...