GlobalConfig.js 3.8 KB
/*
* 全局数据管理
* */
import Loger from 'Loger';
let loger = Loger.getLoger('GlobalConfig');

class GlobalConfig {
    constructor () {

    }
    _currentStatus=null;
    static setDebugData (_deBugData){
        this.isDebug=true;
        this.deBugData=_deBugData;
    }
    static getCurrentStatus(){
        if(this._currentStatus==null){
            this._currentStatus=this.statusCode_0;
        }
        return this._currentStatus;
    }
    static setCurrentStatus(_data){
        this._currentStatus=_data;
    }

    static getConfInfo (){
        if(this.isDebug){

            //这几个属性是sass验证完成之后返回的,启动MCU的时候需要
            this .deBugData.MCUServerIP=this.MCUServerIP;
            this .deBugData.MCUServerPort=this.MCUServerPort;
            this .deBugData.maxVideoChannels=this.maxVideoChannels;
            this .deBugData.maxAudioChannels=this.maxAudioChannels;
            this .deBugData.maxMediaChannels=this.maxMediaChannels;

            return this .deBugData;
        }else {
            return{
                "siteId": this.siteId,
                "confId": this.confId,
                "h5Module": this.h5Module,
                "nodeId": this.nodeId,
                "topNodeID":this.topNodeID,
                "userRole": this.userRole,
                "role": this.role,
                "isHost": this.isHost,
                "classRole": this.classRole,
                "userId": this.userId,
                "userName": this.userName,
                "password": this.password,
                "userType": this.userType,
                "passwordRequired": this.passwordRequired,
                "md5": this.md5,
                "msType": this.msType,
                "portal": this.portal,
                "mcuDelay":this.mcuDelay,
                "MCUServerIP": this.MCUServerIP,
                "MCUServerPort":this.MCUServerPort,
                "maxVideoChannels": this.maxVideoChannels,
                "maxAudioChannels": this.maxAudioChannels,
                "maxMediaChannels": this.maxMediaChannels
            }
        }
    }
}

GlobalConfig.statusCode_0={"code":0,message:"SDK 未初始化"};
GlobalConfig.statusCode_1={"code":1,message:"未加入会议"};
GlobalConfig.statusCode_2={"code":2,message:"已经加入会议"};
GlobalConfig.statusCode_3={"code":3,message:"已经离开会议"};
GlobalConfig.statusCode_4={"code":4,message:"未知状态"};

GlobalConfig.siteId="gust";
GlobalConfig.confId=0;//课堂号=classId=meetingNumber  之后统一修改为classId
GlobalConfig.nodeId=0;//随机生成
GlobalConfig.topNodeID=101;//现在固定值,还不知道是做什么用
GlobalConfig.userRole="normal";
GlobalConfig.role=1;
GlobalConfig.isHost=false;
GlobalConfig.classRole=0;
GlobalConfig.classType=0;//课堂类型,直播或 1V1互动
GlobalConfig.userId=0;
GlobalConfig.userName="";
GlobalConfig.password="";
GlobalConfig.userType=8;
GlobalConfig.h5Module=0;
GlobalConfig.passwordRequired=false;
GlobalConfig.md5="";
GlobalConfig.msType=1;
GlobalConfig.mcuDelay=3000;
GlobalConfig.portal="112.126.80.182:80";
GlobalConfig.ip="112.126.80.182";
GlobalConfig.port="80";
GlobalConfig.MCUServerIP="114.215.195.70";
GlobalConfig.doc="";
GlobalConfig.MCUServerPort=9003;
GlobalConfig.maxVideoChannels=1;
GlobalConfig.maxAudioChannels=1;
GlobalConfig.maxMediaChannels=2;
GlobalConfig.isDebug=false;
GlobalConfig.deBugData={};

GlobalConfig.meetingParam={};
GlobalConfig.classDetail={};


// client type
//点对点会议版本
 GlobalConfig.CT_P2PMEETING    = 0;
/**
 * 直播教育版本和大型直播版本
 */
GlobalConfig.CT_LIVEEDUCATION  = 1;
/**
 * 录制播放器
 */
GlobalConfig.CT_RECORDPLAYER   = 2;
/**
 * 实时流版本
 */
GlobalConfig. CT_LIVESTREAMING  = 3;
GlobalConfig.clientType =0;

export  default GlobalConfig;