李勇

增加系统信息和平台信息

此 diff 太大无法显示。
... ... @@ -22,6 +22,8 @@ import CursorApe from 'apes/CursorApe';
import EngineUtils from "EngineUtils";
import GlobalConfig from 'GlobalConfig';
import SystemConfig from 'SystemConfig';
import ApeConsts from 'apes/ApeConsts';
import Base64 from 'base64-js';
import ArrayBufferUtil from 'libs/ArrayBufferUtil';
... ... @@ -30,11 +32,10 @@ import MediaModule from 'apes/MediaModule';
import MediaSharedApe from 'apes/MediaSharedApe';
import MusicSharedApe from 'apes/MusicSharedApe';
import QuestionApe from 'apes/QuestionApe';
import mdetect from "mdetect";
import UTF8 from 'utf-8';
let loger = Loger.getLoger('McuClient');
let _sdkInfo = { "version": "v1.43.1.20170711", "author": "www.3mang.com" };
let _sdkInfo = { "version": "v1.45.1.20170717", "author": "www.3mang.com" };
//APE
let _sass;
... ... @@ -59,13 +60,8 @@ export default class MessageEntrance extends Emiter {
//sdk 信息
this.sdkInfo = _sdkInfo;
loger.warn(this.sdkInfo);
//检查是否是移动端
GlobalConfig.isMobile = mdetect.isMobileUA();
if (GlobalConfig.isMobile) {
loger.warn("当前设备是移动设备");
} else {
loger.warn("当前设备是PC");
}
//获取设备和系统信息
SystemConfig.getSystemInfo();
this.classRecordStatusUpdateTimer=0;//课堂录制状态发生改变后同步当前所有模块数据的计时器
//初始化状态
... ... @@ -254,6 +250,7 @@ export default class MessageEntrance extends Emiter {
this.switchMediaServer = this._switchMediaServer.bind(this); //手动切换ms服务器
this.setDebugInfo = this._setDebugInfo.bind(this); //设置debug信息
}
_setDebugInfo(_data) {
loger.log("设置debug信息-->", _data);
if (_data) {
... ... @@ -264,14 +261,6 @@ export default class MessageEntrance extends Emiter {
_setDeviceInfo(_data) {
loger.log("设置设备信息-->", _data);
if (_data) {
/* GlobalConfig.videoQuality=_data.videoQuality||2;//画面质量 0-低;1-中;2-高;
GlobalConfig.cameras=_data.cameras||[];//摄像头列表
GlobalConfig.microphones=_data.microphones||[];//麦克风列表
GlobalConfig.curCamera=_data.curCamera||'';//当前选择的摄像头
GlobalConfig.curMicrophone=_data.curMicrophone||'';//当前选择的麦克风
GlobalConfig.curVideoQuality=_data.curVideoQuality||2;//当前选择的分辨率
GlobalConfig.micGain=_data.micGain||50;//音量(0-80)*/
GlobalConfig.cameras = _data.cameras || [];
GlobalConfig.microphones = _data.microphones || [];
GlobalConfig.videoQuality = parseInt(_data.videoQuality);
... ... @@ -810,6 +799,13 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData.ssTunnelAppURL = GlobalConfig.ssTunnelAppURL;
joinClassSuccessCallBackData.currentSceneTableId = GlobalConfig.currentSceneTableId; //文档区域的模块显示
joinClassSuccessCallBackData.serverAndLoacTimeDistanc = GlobalConfig.serverAndLoacTimeDistanc;
joinClassSuccessCallBackData.deviceType = GlobalConfig.deviceType;
joinClassSuccessCallBackData.language = GlobalConfig.language;
joinClassSuccessCallBackData.explorer = GlobalConfig.explorer;
joinClassSuccessCallBackData.explorerVersion = GlobalConfig.explorerVersion;
joinClassSuccessCallBackData.os = GlobalConfig.os;
loger.log('加入课堂成功->');
loger.log(joinClassSuccessCallBackData);
... ... @@ -2014,6 +2010,13 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData.ssTunnelAppURL = GlobalConfig.ssTunnelAppURL;
joinClassSuccessCallBackData.currentSceneTableId = GlobalConfig.currentSceneTableId; //文档区域的模块显示
joinClassSuccessCallBackData.serverAndLoacTimeDistanc = GlobalConfig.serverAndLoacTimeDistanc;
joinClassSuccessCallBackData.deviceType = GlobalConfig.deviceType;
joinClassSuccessCallBackData.language = GlobalConfig.language;
joinClassSuccessCallBackData.explorer = GlobalConfig.explorer;
joinClassSuccessCallBackData.explorerVersion = GlobalConfig.explorerVersion;
joinClassSuccessCallBackData.os = GlobalConfig.os;
loger.log(joinClassSuccessCallBackData);
//和加入课堂成功使用同样的消息处理
this._emit(MessageTypes.CLASS_JOIN_SUCCESS, joinClassSuccessCallBackData);
... ...
... ... @@ -368,7 +368,7 @@ GlobalConfig.maxMediaChannels = 0; //最大音视频路数,以音视频路数
GlobalConfig.hasCamera = false; //摄像头是否可用
GlobalConfig.hasMicrophone = false; //麦克风是否可用
GlobalConfig.deviceType = 0; //设备类型 0:电脑 1:安卓 2:ios
GlobalConfig.deviceType = 0; //设备类型 0:电脑 1:ios 2:安卓
GlobalConfig.userIp = ""; //用户当前IP
GlobalConfig.userId = 0;
GlobalConfig.userName = "";
... ... @@ -379,8 +379,8 @@ GlobalConfig.openMicrophones = 0;
//视频质量相关设置
GlobalConfig.fps = 15; //帧频
GlobalConfig.gop = 3; //关键帧间隔(秒)
GlobalConfig.videoQuality = 2; //画面质量 0-低;1-中;2-高;
GlobalConfig.curVideoQuality = 2; //当前分辨率
GlobalConfig.videoQuality = 1; //画面质量 0-低;1-中;2-高;
GlobalConfig.curVideoQuality = 1; //当前分辨率
GlobalConfig.cameras = []; //摄像头列表
GlobalConfig.microphones = []; //麦克风列表
... ... @@ -480,7 +480,13 @@ GlobalConfig.ssTunnelAppURL = ''; //屏幕共享插件的地址
GlobalConfig.serverTime = 0; //服务器当前时间戳
GlobalConfig.serverAndLoacTimeDistanc = 0; //本地时间和服务器时间错的差值;
GlobalConfig.isMobile = false; //是否是移动端
GlobalConfig.rosterNumber=0;//当前总人数
GlobalConfig.isMobile = false; //是否是移动端
GlobalConfig.language="";//浏览器语言
GlobalConfig.platform="pc";//平台 IOS/ANDROID/PC
GlobalConfig.explorer="未知";//浏览器
GlobalConfig.explorerVersion="未知";//浏览器版本
GlobalConfig.os="未知";//系统
export default GlobalConfig;
... ...
/*
* 全局数据管理
* */
import Loger from 'Loger';
import mdetect from "mdetect";
import GlobalConfig from 'GlobalConfig';
let loger = Loger.getLoger('SystemConfig');
class SystemConfig {
constructor() {
}
//获取系统信息
static getSystemInfo(){
//检查是否是移动端
GlobalConfig.isMobile = mdetect.isMobileUA();
if (GlobalConfig.isMobile) {
loger.warn("当前设备是移动设备");
} else {
loger.warn("当前设备是PC");
}
if(mdetect.isIOS()){
GlobalConfig.deviceType=1;//"ios";
} if(mdetect.isAndroid()){
GlobalConfig.platform=2;//"android";
}else {
GlobalConfig.platform=0;//"pc";
}
//语言
GlobalConfig.language ="unknown";
if(navigator){
let language=navigator.language || navigator.browserLanguage;
GlobalConfig.language = language.toLocaleLowerCase();
}
let browserInfo=this.getBrowserInfo();
GlobalConfig.explorer=browserInfo.explorer||"未知";
GlobalConfig.explorerVersion=browserInfo.explorerVersion||"未知";
GlobalConfig.os=this.detectOS();
loger.log("deviceType:"+GlobalConfig.deviceType);
loger.log("language:"+GlobalConfig.language);
loger.log("explorer:"+GlobalConfig.explorer);
loger.log("explorerVersion:"+GlobalConfig.explorerVersion);
loger.log("os:"+GlobalConfig.os);
}
//获取浏览器和信息
static getBrowserInfo(){
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var re =/(trident|msie|firefox|chrome|opera|version).*?([\d.]+)/;
var m = ua.match(re);
Sys.explorer = m[1].replace(/version/, "'safari");
//判断是否是IE11
if(Sys.explorer=="trident"){
Sys.explorer="IE11"
Sys.explorerVersion = "11.0";
}else if(Sys.explorer=="msie"){
//IE
Sys.explorer="IE"
Sys.explorerVersion = m[2];
}else {
//非IE
Sys.explorerVersion = m[2];
}
return Sys;
}
//系统信息
static detectOS() {
var sUserAgent = navigator.userAgent;
var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
if (isMac) return "Mac";
var isUnix = (navigator.platform == "X11") && !isWin && !isMac;
if (isUnix) return "Unix";
var isLinux = (String(navigator.platform).indexOf("Linux") > -1);
if (isLinux) return "Linux";
if (isWin) {
var isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 || sUserAgent.indexOf("Windows 2000") > -1;
if (isWin2K) return "Win2000";
var isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 || sUserAgent.indexOf("Windows XP") > -1;
if (isWinXP) return "WinXP";
var isWin2003 = sUserAgent.indexOf("Windows NT 5.2") > -1 || sUserAgent.indexOf("Windows 2003") > -1;
if (isWin2003) return "Win2003";
var isWinVista= sUserAgent.indexOf("Windows NT 6.0") > -1 || sUserAgent.indexOf("Windows Vista") > -1;
if (isWinVista) return "WinVista";
var isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1 || sUserAgent.indexOf("Windows 7") > -1;
if (isWin7) return "Win7";
}
return "other";
}
}
export default SystemConfig;
... ...
... ... @@ -143,6 +143,12 @@ class ConferApe extends Ape {
//用户当前选择的MS
nodeInfoRecordPdu.msIpPort = GlobalConfig.MS_PUBLISH_IP + ":" + GlobalConfig.MS_PUBLISH_PORT;
nodeInfoRecordPdu.deviceType = GlobalConfig.deviceType;
nodeInfoRecordPdu.language = GlobalConfig.language;
nodeInfoRecordPdu.explorer = GlobalConfig.explorer;
nodeInfoRecordPdu.explorerVersion = GlobalConfig.explorerVersion;
nodeInfoRecordPdu.os = GlobalConfig.os;
return nodeInfoRecordPdu;
}
... ...
... ... @@ -190,14 +190,14 @@ class MCU extends Emiter {
}
loger.log('leaveMCU');
GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3);
GlobalConfig.classJoinSuccess=false;
GlobalConfig.classJoinSuccess = false;
this._everSocket.end();
}
// 主动建立MCU连接
joinMCU(_classInfo) {
loger.log('开始建立EverSocket通道.');
GlobalConfig.classJoinSuccess=false;
GlobalConfig.classJoinSuccess = false;
loger.log(_classInfo);
_classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形
this.classInfo = _classInfo;
... ... @@ -211,13 +211,20 @@ class MCU extends Emiter {
nodeInfoRecordPdu.userId = this.classInfo.userId;
nodeInfoRecordPdu.role = ApeConsts.userTypesToId[this.classInfo.userRole] || 1; //NR_NORMAL用户的身份,根据用户登录时的身份设置
nodeInfoRecordPdu.level = 0;
nodeInfoRecordPdu.handUpTime=0;
nodeInfoRecordPdu.openCamera=0;
nodeInfoRecordPdu.openMicrophones=0;
nodeInfoRecordPdu.microphones=GlobalConfig.microphones;
nodeInfoRecordPdu.cameras=GlobalConfig.cameras;
nodeInfoRecordPdu.videoQuality=GlobalConfig.videoQuality;//设置分辨率的
nodeInfoRecordPdu.userIp=GlobalConfig.userIp;
nodeInfoRecordPdu.handUpTime = 0;
nodeInfoRecordPdu.openCamera = 0;
nodeInfoRecordPdu.openMicrophones = 0;
nodeInfoRecordPdu.microphones = GlobalConfig.microphones;
nodeInfoRecordPdu.cameras = GlobalConfig.cameras;
nodeInfoRecordPdu.videoQuality = GlobalConfig.videoQuality;//设置分辨率的
nodeInfoRecordPdu.userIp = GlobalConfig.userIp;
nodeInfoRecordPdu.deviceType = GlobalConfig.deviceType;
nodeInfoRecordPdu.language = GlobalConfig.language;
nodeInfoRecordPdu.explorer = GlobalConfig.explorer;
nodeInfoRecordPdu.explorerVersion = GlobalConfig.explorerVersion;
nodeInfoRecordPdu.os = GlobalConfig.os;
let conferenceRecord = {}; //RCConferenceRecord_T
conferenceRecord._conference_id = this.classInfo.classId;
... ...
... ... @@ -891,7 +891,7 @@ message RCNodeInfoRecordPdu {
optional bytes user_data = 8;
optional string user_id = 9;
optional uint32 handUpTime = 10;
optional uint32 deviceType = 11;
optional uint32 deviceType = 11;//设备类型,0:pc 1:ios 2:安卓
optional uint32 mobileDirection = 12;
repeated string microphones = 13;
repeated string cameras = 14;
... ... @@ -912,6 +912,10 @@ message RCNodeInfoRecordPdu {
repeated MsListItemPdu msList = 29;
optional string selfSilence = 30;
optional string msIpPort = 31;
optional string language = 32;//系统语言
optional string explorer = 33;//浏览器
optional string explorerVersion = 34;//浏览器版本
optional string os = 35;//系统版本
}
message RCVotingPollSettingsPdu {
... ...