Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f6061aa458f7d6d02eac4973549f56c7cbdde9f
6f6061aa
1 parent
3a74dfa9
1.调整入会流程(先Sass流程,后MCU连接流程)
2.修改从Sass获取的数据储存
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
367 行增加
和
279 行删除
src/EngineEntrance.js
src/GlobalConfig.js
src/Sass.js
src/apes/ConferApe.js
src/apes/DocApe.js
src/EngineEntrance.js
查看文件 @
6f6061a
...
...
@@ -60,17 +60,17 @@ export default class MessageEntrance extends Emiter {
// Sass平台层
_sass
=
Sass
;
_sass
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_sass
.
on
(
_sass
.
SUCCESS
,
this
.
_sassVerifySuccessHandler
.
bind
(
this
));
_sass
.
on
(
_sass
.
CLASS_INIT_SUCCESS
,
this
.
_sassInitSuccessHandler
.
bind
(
this
));
_sass
.
on
(
_sass
.
CLASS_GET_CLASS_DETAIL
,
this
.
_sassGetClassDetailSuccessHandler
.
bind
(
this
));
_sass
.
on
(
_sass
.
CLASS_GET_CLASS_PARAM
,
this
.
_sassGetClassParaSuccessHandler
.
bind
(
this
));
_sass
.
on
(
_sass
.
CLASS_SAVE_STATUS_INFO_SUCCESS
,
this
.
_sassSaveClassStatusInfoSuccessHandler
.
bind
(
this
));
_sass
.
on
(
_sass
.
DELETE_DOCUMENT_SUCCESS
,
this
.
_sassDeleteDocumentSuccess
.
bind
(
this
));
_sass
.
on
(
_sass
.
SUCCESS
,
this
.
_sassJoinSuccessHandler
.
bind
(
this
));
//通过SASS平台验证(密码和MD5)
_sass
.
on
(
_sass
.
CLASS_INIT_SUCCESS
,
this
.
_sassInitSuccessHandler
.
bind
(
this
));
//获取会议初始化信息
_sass
.
on
(
_sass
.
CLASS_GET_CLASS_DETAIL
,
this
.
_sassGetClassDetailSuccessHandler
.
bind
(
this
));
//获取会议的基本信息
_sass
.
on
(
_sass
.
CLASS_GET_CLASS_PARAM
,
this
.
_sassGetClassParamSuccessHandler
.
bind
(
this
));
//获取会议的最全信息和历史保存的数据
_sass
.
on
(
_sass
.
CLASS_SAVE_STATUS_INFO_SUCCESS
,
this
.
_sassSaveClassStatusInfoSuccessHandler
.
bind
(
this
));
//保存会议状态信息
_sass
.
on
(
_sass
.
DELETE_DOCUMENT_SUCCESS
,
this
.
_sassDeleteDocumentSuccess
.
bind
(
this
));
//sass删除文档成功
// 底层MCU消息层
_mcu
=
Mcu
;
_mcu
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_mcu
.
on
(
MessageTypes
.
CLASS_JOIN_SUCCESS
,
this
.
_joinClassSuccessHandler
.
bind
(
this
));
_mcu
.
on
(
MessageTypes
.
CLASS_JOIN_SUCCESS
,
this
.
_joinClassSuccessHandler
.
bind
(
this
));
//加入MCU会议完成
// 注册所有应用Ape
...
...
@@ -158,7 +158,7 @@ export default class MessageEntrance extends Emiter {
_doClassClose
(
_param
){
this
.
_leaveClass
();
}
//当前的会议状态信息发生改变
//当前的会议状态信息发生改变
,需要保存会议状态到Sass
_onClassStatusInfoChange
(
_param
){
this
.
_sassSaveClassStatusInfo
();
}
...
...
@@ -254,7 +254,7 @@ export default class MessageEntrance extends Emiter {
}
// 通过SASS平台验证
_sass
Verify
SuccessHandler
(
_data
)
{
_sass
Join
SuccessHandler
(
_data
)
{
//返回值
/* flag 数值型 无 True:成功
Flag:失败
...
...
@@ -267,31 +267,80 @@ export default class MessageEntrance extends Emiter {
rs 字符串 Rs列表
doc 字符串 Doc列表*/
/* {
"record": "112.126.80.182:80",
"flag": "true",
"h5Module": 1,
"maxVideoChannels": 1,
"mcu": "123.56.73.119:7000;123.56.69.230:7000;112.126.80.182:7000",
"ms": "pubms.3mang.com:1935",
"doc": "101.200.150.192:80",
"rs": "pubms.3mang.com:1935",
"type": 1,
"maxAudioChannels": 1,
"h5_mcu_list": "123.56.73.119:7001;123.56.69.230:7001;112.126.80.182:7001"
}*/
if
(
_data
.
h5_mcu_list
)
{
//MCU地址默认使用第一个
let
server
=
_data
.
h5_mcu_list
.
split
(
";"
)[
0
];
GlobalConfig
.
MCUServerIP
=
server
.
split
(
":"
)[
0
];
GlobalConfig
.
MCUServerPort
=
server
.
split
(
":"
)[
1
];
}
GlobalConfig
.
doc
=
_data
.
doc
;
GlobalConfig
.
h5_mcu_list
=
_data
.
h5_mcu_list
;
GlobalConfig
.
h5Module
=
_data
.
h5Module
;
GlobalConfig
.
maxAudioChannels
=
_data
.
maxAudioChannels
;
GlobalConfig
.
maxVideoChannels
=
_data
.
maxVideoChannels
;
GlobalConfig
.
mcu
=
_data
.
mcu
;
GlobalConfig
.
ms
=
_data
.
ms
;
GlobalConfig
.
record
=
_data
.
record
;
GlobalConfig
.
rs
=
_data
.
rs
;
GlobalConfig
.
maxVideoChannels
=
_data
.
maxVideoChannels
;
GlobalConfig
.
maxAudioChannels
=
_data
.
maxAudioChannels
;
GlobalConfig
.
maxMediaChannels
=
_data
.
maxVideoChannels
+
_data
.
maxAudioChannels
;
loger
.
log
(
'加入底层MCU会议.'
);
if
(
_mcu
){
_mcu
.
joinMCU
(
GlobalConfig
.
getClassInfo
());
if
(
_sass
){
_sass
.
getClassDetail
();
//会议基本信息
}
}
//获取会议所有参数 getClassH5
_sassGetClassDetailSuccessHandler
(
_data
){
loger
.
log
(
'获取getClassDetail完成.'
);
GlobalConfig
.
setClassDetail
=
_data
;
/* {
"cycle": 0,
"repeatmonthweekweek": 0,
"status": 1,
"repeatmonthday": 0,
"repeatmode": 0,
"beginTime": "2017-02-03 09:00:00",
"frequency": 1,
"endmode": 0,
"meetingContent": "",
"endTime": "2017-03-31 11:00:00",
"repeatweek": "",
"category": "",
"finalenddate": "",
"repeatday": 0,
"meetingName": "mcu1",
"errorCode": 0,
"monthType": 0,
"repeatmonthweekday": 0,
"endcount": 1
}*/
GlobalConfig
.
classDetail
=
_data
;
GlobalConfig
.
className
=
_data
.
meetingName
||
""
;
GlobalConfig
.
classBeginTime
=
_data
.
beginTime
||
""
;
GlobalConfig
.
classEndTime
=
_data
.
endTime
||
""
;
//获取会议所有信息和以前保存的会议状态信息
if
(
_sass
){
_sass
.
getClassParam
();
}
}
//获取会议所有参数 api/meeting/detail.do? flash中的接口文件是 getClassParam.do
_sassGetClassParaSuccessHandler
(
_data
){
_sassGetClassParamSuccessHandler
(
_data
){
//console.log(GlobalConfig.classStatusInfo)
loger
.
log
(
'获取api/meeting/detail.do完成.'
);
// console.log(_data);
//包含整个会议最全的信息,储存数据
...
...
@@ -306,7 +355,6 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
setRsList
(
_data
.
rsList
);
//
}
if
(
_data
.
currentInfo
){
//根据从Sass获取的数据信息,同步最后一次保存的会议状态信息
loger
.
log
(
"同步最后一次保存过的会议状态信息"
);
...
...
@@ -321,11 +369,15 @@ export default class MessageEntrance extends Emiter {
loger.log("2222222222222222222222222");
console.log(GlobalConfig.classStatusInfo);*/
console
.
log
(
_data
.
currentInfo
);
GlobalConfig
.
classStatusInfo
=
_data
.
currentInfo
;
//console.log(_data.currentInfo);
GlobalConfig
.
setClassStatusInfo
(
_data
.
currentInfo
);
console
.
log
(
GlobalConfig
.
classStatusInfo
)
}
else
{
loger
.
log
(
"还没有保存过会议状
态
信息"
);
loger
.
log
(
"还没有保存过会议状信息"
);
}
//所有Sass流程完成,开始MCU连接
this
.
_joinMCU
();
}
//保存会议状态信息
...
...
@@ -347,37 +399,17 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'保存会议状态信息成功.'
,
_data
);
}
//Sass校验流程结束之后,开始加入MCU
_joinMCU
(){
loger
.
log
(
'加入底层MCU会议.'
);
if
(
_mcu
){
_mcu
.
joinMCU
(
GlobalConfig
.
getClassInfo
());
}
}
// MCU 会议成功
_joinClassSuccessHandler
(
_data
)
{
loger
.
log
(
'MCU 会议成功.'
);
GlobalConfig
.
setCurrentStatus
(
GlobalConfig
.
statusCode_2
);
if
(
_sass
){
_sass
.
getClassDetail
();
//会议信息
_sass
.
getClassParam
();
//会议参数大全
}
//储存数据
GlobalConfig
.
MCUServerIP
=
_data
.
MCUServerIP
;
GlobalConfig
.
MCUServerPort
=
_data
.
MCUServerPort
;
GlobalConfig
.
classId
=
_data
.
classId
;
GlobalConfig
.
h5Module
=
_data
.
h5Module
;
GlobalConfig
.
maxAudioChannels
=
_data
.
maxAudioChannels
;
GlobalConfig
.
maxVideoChannels
=
_data
.
maxVideoChannels
;
GlobalConfig
.
maxMediaChannels
=
_data
.
maxMediaChannels
;
GlobalConfig
.
mcuClassInfo
=
_data
.
mcuClassInfo
;
GlobalConfig
.
mcuDelay
=
_data
.
mcuDelay
;
GlobalConfig
.
md5
=
_data
.
md5
;
GlobalConfig
.
msType
=
_data
.
msType
;
GlobalConfig
.
nodeId
=
_data
.
nodeId
;
GlobalConfig
.
password
=
_data
.
password
;
GlobalConfig
.
portal
=
_data
.
portal
;
GlobalConfig
.
role
=
_data
.
role
;
GlobalConfig
.
siteId
=
_data
.
siteId
;
GlobalConfig
.
topNodeID
=
_data
.
topNodeID
;
GlobalConfig
.
userId
=
_data
.
userId
;
GlobalConfig
.
userName
=
_data
.
userName
;
GlobalConfig
.
userRole
=
_data
.
userRole
;
GlobalConfig
.
userType
=
_data
.
userType
;
//返回给客户数据
if
(
_joinClassSuccessCallBackFun
){
...
...
@@ -385,7 +417,7 @@ export default class MessageEntrance extends Emiter {
let
initSuccessCallBackData
=
{};
//GlobalConfig.MCUServerIP=_data.MCUServerIP;
// GlobalConfig.MCUServerPort=_data.MCUServerPort;
// GlobalConfig.MCUServerPort=_data.MCUServerPort;
initSuccessCallBackData
.
doc
=
GlobalConfig
.
doc
;
//文档服务器地址
initSuccessCallBackData
.
classId
=
GlobalConfig
.
classId
;
...
...
@@ -420,6 +452,79 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'加入会议成功'
,
initSuccessCallBackData
);
_joinClassSuccessCallBackFun
(
initSuccessCallBackData
);
}
//loger.log('MCU 会议成功.');
//GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_2);
//if(_sass){
// _sass.getClassDetail();//会议信息
// _sass.getClassParam();//会议参数大全
//}
//
////储存数据
//GlobalConfig.MCUServerIP=_data.MCUServerIP;
//GlobalConfig.MCUServerPort=_data.MCUServerPort;
//GlobalConfig.classId=_data.classId;
//GlobalConfig.h5Module=_data.h5Module;
//GlobalConfig.maxAudioChannels=_data.maxAudioChannels;
//GlobalConfig.maxVideoChannels=_data.maxVideoChannels;
//GlobalConfig.maxMediaChannels=_data.maxMediaChannels;
//GlobalConfig.mcuClassInfo=_data.mcuClassInfo;
//GlobalConfig.mcuDelay=_data.mcuDelay;
//GlobalConfig.md5=_data.md5;
//GlobalConfig.msType=_data.msType;
//GlobalConfig.nodeId=_data.nodeId;
//GlobalConfig.password=_data.password;
//GlobalConfig.portal=_data.portal;
//GlobalConfig.role=_data.role;
//GlobalConfig.siteId=_data.siteId;
//GlobalConfig.topNodeID=_data.topNodeID;
//GlobalConfig.userId=_data.userId;
//GlobalConfig.userName=_data.userName;
//GlobalConfig.userRole=_data.userRole;
//GlobalConfig.userType=_data.userType;
//
////返回给客户数据
//if(_joinClassSuccessCallBackFun){
// //返回给客户端初始化成功的数据
// let initSuccessCallBackData={};
//
// //GlobalConfig.MCUServerIP=_data.MCUServerIP;
// // GlobalConfig.MCUServerPort=_data.MCUServerPort;
//
// initSuccessCallBackData.doc=GlobalConfig.doc;//文档服务器地址
// initSuccessCallBackData.classId=GlobalConfig.classId;
// initSuccessCallBackData.className=GlobalConfig.className;
// initSuccessCallBackData.h5Module=GlobalConfig.h5Module;
// initSuccessCallBackData.isHost=GlobalConfig.isHost;
// initSuccessCallBackData.maxAudioChannels=GlobalConfig.maxAudioChannels;
// initSuccessCallBackData.maxVideoChannels=GlobalConfig.maxVideoChannels;
// initSuccessCallBackData.maxMediaChannels=GlobalConfig.maxMediaChannels;
// initSuccessCallBackData.mcuDelay=GlobalConfig.mcuDelay;
//
// initSuccessCallBackData.msType=GlobalConfig.msType;
// initSuccessCallBackData.nodeId=GlobalConfig.nodeId;
// initSuccessCallBackData.password=GlobalConfig.password;
// initSuccessCallBackData.passwordRequired=GlobalConfig.passwordRequired;// 老师的默认是true
// //GlobalConfig.passwordRequired 老师的默认是true
// //GlobalConfig.portal=_data.portal;
// initSuccessCallBackData.role=GlobalConfig.role;
// initSuccessCallBackData.siteId=GlobalConfig.siteId;
// initSuccessCallBackData.topNodeID=GlobalConfig.topNodeID;
// initSuccessCallBackData.userId=GlobalConfig.userId;
// initSuccessCallBackData.userName=GlobalConfig.userName;
// initSuccessCallBackData.userRole=GlobalConfig.userRole;
// initSuccessCallBackData.userType=GlobalConfig.userType;
//
// initSuccessCallBackData.siteId=GlobalConfig.siteId;
// initSuccessCallBackData.classId=GlobalConfig.classId;
// initSuccessCallBackData.userRole=GlobalConfig.userRole;
// initSuccessCallBackData.userId=GlobalConfig.userId;
// initSuccessCallBackData.passwordRequired=GlobalConfig.passwordRequired;
// initSuccessCallBackData.classType=GlobalConfig.classType||ApeConsts.CLASS_TYPE_INTERACT;
// loger.log('加入会议成功',initSuccessCallBackData);
// _joinClassSuccessCallBackFun(initSuccessCallBackData);
//}
}
//Sass删除文档数据
...
...
src/GlobalConfig.js
查看文件 @
6f6061a
...
...
@@ -30,33 +30,6 @@ class GlobalConfig {
static
getClassDetail
(){
return
this
.
classDetail
;
}
static
setClassDetail
(
_data
){
this
.
classDetail
=
_data
;
this
.
className
=
_data
.
meetingName
||
""
;
this
.
classBeginTime
=
_data
.
beginTime
||
""
;
this
.
classEndTime
=
_data
.
endTime
||
""
;
/* {
"cycle": 0,
"repeatmonthweekweek": 0,
"status": 1,
"repeatmonthday": 0,
"repeatmode": 0,
"beginTime": "2017-02-03 09:00:00",
"frequency": 1,
"endmode": 0,
"meetingContent": "",
"endTime": "2017-03-31 11:00:00",
"repeatweek": "",
"category": "",
"finalenddate": "",
"repeatday": 0,
"meetingName": "mcu1",
"errorCode": 0,
"monthType": 0,
"repeatmonthweekday": 0,
"endcount": 1
}*/
}
static
getClassInfo
(){
let
classInfo
=
{};
...
...
@@ -116,7 +89,8 @@ class GlobalConfig {
return
classStatusInfo
;
}
//设置当前的课堂状态的信息
static
set
classStatusInfo
(
_data
){
static
setClassStatusInfo
(
_data
){
loger
.
log
(
"setClassStatusInfo"
);
if
(
_data
==
null
){
loger
.
warn
(
"classStatusInfo error,_data:"
,
_data
);
return
;
...
...
@@ -130,6 +104,7 @@ class GlobalConfig {
this
.
classType
=
data
.
classType
||
this
.
classType
;
//课堂类型
this
.
classStatus
=
data
.
classStatus
||
this
.
classStatus
;
//课堂的状态
this
.
classStartTime
=
data
.
classStartTime
||
this
.
classStartTime
;
//课堂点击开始时间
this
.
classStopTime
=
data
.
classStopTime
||
this
.
classStopTime
;
//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
this
.
classTimestamp
=
data
.
classTimestamp
||
this
.
classTimestamp
;
//相对于点开始课堂的时间戳
...
...
@@ -314,7 +289,7 @@ GlobalConfig.classTimestamp=0;//从课堂开始到现在的时
GlobalConfig
.
recordStatus
=
false
;
//当前录制状态
GlobalConfig
.
recordTimestamp
=
0
;
//相对于首次开始录制的进行时间
GlobalConfig
.
recordFileName
=
""
;
//录制的文件名
GlobalConfig
.
recordDownloadUrl
=
"
xxxxxxxxxxxxxxxxxxxxx
"
;
//下载地址
GlobalConfig
.
recordDownloadUrl
=
""
;
//下载地址
GlobalConfig
.
recordReplaytickValues
=
{};
// 滚动条关键点,用于快进快退
//GlobalConfig.serverTimestamp=0;//当前的系统时间戳 用get set 获取
...
...
src/Sass.js
查看文件 @
6f6061a
...
...
@@ -162,7 +162,7 @@ class Sass extends Emiter {
})
.
then
(
ret
=>
{
if
(
ret
.
flag
==
"true"
||
ret
.
flag
==
true
)
{
if
(
ret
.
h5_mcu_list
)
{
/*
if (ret.h5_mcu_list) {
let server = ret.h5_mcu_list.split(";")[0];
confInfo.MCUServerIP = server.split(":")[0];
confInfo.MCUServerPort = server.split(":")[1];
...
...
@@ -176,8 +176,8 @@ class Sass extends Emiter {
GlobalConfig.maxVideoChannels=confInfo.maxVideoChannels;
GlobalConfig.maxAudioChannels=confInfo.maxAudioChannels;
GlobalConfig
.
maxMediaChannels
=
confInfo
.
maxMediaChannels
;
loger
.
log
(
'校验完成'
,
ret
);
GlobalConfig.maxMediaChannels=confInfo.maxMediaChannels;*/
loger
.
log
(
'MD5校验完成'
,
ret
);
this
.
_emit
(
Sass
.
SUCCESS
,
ret
);
}
else
{
loger
.
log
(
'MD5校验-失败.'
);
...
...
src/apes/ConferApe.js
查看文件 @
6f6061a
...
...
@@ -15,11 +15,11 @@ let loger = Loger.getLoger('ConferApe');
let
itemIdx
=
0
;
//table插入新数据的计数id,目前用时间戳
let
timerCounter
;
const
ACTION_TYPE_0
=
0
;
const
ACTION_TYPE_1
=
1
;
const
ACTION_TYPE_2
=
2
;
const
ACTION_TYPE_3
=
3
;
const
ACTION_TYPE_4
=
4
;
//const ACTION_TYPE_0=0;
//const ACTION_TYPE_1=1;
//const ACTION_TYPE_2=2;
//const ACTION_TYPE_3=3;
//const ACTION_TYPE_4=4;
class
ConferApe
extends
Ape
{
constructor
()
{
super
(
...
...
@@ -59,6 +59,7 @@ class ConferApe extends Ape {
}
//加入会议
_joinSessionHandler
(
_data
)
{
let
nodeInfoRecordPdu
=
this
.
mcu
.
mcuClassInfo
.
self
;
...
...
@@ -134,47 +135,50 @@ class ConferApe extends Ape {
//开始上课
startClass
(
_param
){
let
timestamp
=
EngineUtils
.
creatTimestampStr
();
GlobalConfig
.
classStopTime
=
timestamp
;
if
(
GlobalConfig
.
classStatus
==
ApeConsts
.
CLASS_STATUS_WAIT
){
GlobalConfig
.
classStartTime
=
EngineUtils
.
creatTimestampStr
();
GlobalConfig
.
classStopTime
=
GlobalConfig
.
classStartTime
;
}
else
{
GlobalConfig
.
classStopTime
=
GlobalConfig
.
creatTimestampStr
;
GlobalConfig
.
classStartTime
=
timestamp
;
}
GlobalConfig
.
classStatus
=
ApeConsts
.
CLASS_STATUS_STARTED
;
_param
.
actionType
=
ACTION_TYPE_1
;
//
_param.actionType=ACTION_TYPE_1;
this
.
_emit
(
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
);
this
.
sendUpdaterClassStatusInfo
(
_param
);
}
//暂停上课
pauseClass
(
_param
){
if
(
GlobalConfig
.
classStatus
==
ApeConsts
.
CLASS_STATUS_WAIT
){
loger
.
warn
(
'还没有开始,不能点暂停'
);
return
;
}
GlobalConfig
.
classStatus
=
ApeConsts
.
CLASS_STATUS_PAUSE
;
GlobalConfig
.
classStopTime
=
EngineUtils
.
creatTimestampStr
();
_param
.
actionType
=
ACTION_TYPE_2
;
//
_param.actionType=ACTION_TYPE_2;
this
.
_emit
(
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
);
this
.
sendUpdaterClassStatusInfo
(
_param
);
}
//关闭课堂
closeClass
(
_param
){
if
(
GlobalConfig
.
classStatus
==
ApeConsts
.
CLASS_STATUS_WAIT
){
loger
.
warn
(
'还没有开始,不能点关闭'
);
return
;
}
//把所有人都踢出课堂,然后把状态值还原为1
GlobalConfig
.
classStatus
=
ApeConsts
.
CLASS_STATUS_WAIT
;
//
GlobalConfig
.
classStopTime
=
EngineUtils
.
creatTimestampStr
();
_param
.
actionType
=
ACTION_TYPE_3
;
//
_param.actionType=ACTION_TYPE_3;
this
.
_emit
(
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
);
this
.
sendUpdaterClassStatusInfo
(
_param
);
}
//更新课堂状态
updateClassStatus
(
_param
){
//GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_UPTATE;
//_param.actionType=ACTION_TYPE_4;
//this.sendUpdaterClassStatusInfo(_param);
}
//更新会议信息
sendUpdaterClassStatusInfo
(
_param
){
loger
.
log
(
'sendUpdaterClassStatusInfo----------'
);
loger
.
log
(
'sendUpdaterClassStatusInfo---
1
-------'
);
if
(
_param
==
null
||
EngineUtils
.
isEmptyObject
(
_param
)){
loger
.
log
(
'sendUpdaterClassStatusInfo,参数错误'
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
...
...
@@ -182,7 +186,8 @@ class ConferApe extends Ape {
}
itemIdx
=
ApeConsts
.
CONFERENCE_OBJ_TABLE_ID
;
// itemIdx=_param.itemIdx;
let
modelPdu
=
this
.
packPdu
(
_param
,
itemIdx
);
//console.log(modelPdu);
loger
.
log
(
'sendUpdaterClassStatusInfo----2------'
);
console
.
log
(
modelPdu
);
if
(
modelPdu
==
null
){
loger
.
log
(
'sendUpdaterClassStatusInfo,参数错误'
);
...
...
@@ -274,121 +279,33 @@ class ConferApe extends Ape {
this.sendUniform(adapterPdu,true);
}*/
///////白板数据的封包和解包/////////////////////////////////////////
packPdu
(
_param
,
_itemIdx
){
loger
.
log
(
"会议===packPdu "
);
//验证坐标点集合数组是否合法
if
(
_param
==
null
||
_itemIdx
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
/* message RCClassStatusInfoPdu {
optional uint32 node_id=1;//mcu中的唯一ID
optional uint32 user_id=2;
optional uint32 user_name=3;
optional uint32 site_id=4;//站点号
optional uint32 class_id=5;
optional uint32 class_name=6;
required uint32 class_type=7;//课堂类型
required uint32 class_status=9;//课堂的状态
optional uint32 class_startTime=10;//课堂点击开始时间
optional uint32 class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳
optional uint32 class_beginTime=13;//课堂创建的时间,这个是Sass返回的
optional uint32 class_endTime=14;//课堂结束的时间,这个是Sass返回的
optional uint32 record_status=15;//当前录制状态
optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳
optional uint32 record_fileName=17;//录制的文件名
optional uint32 record_downloadUrl=18;//下载地址
optional uint32 server_timestamp=19;//当前的系统时间戳
}*/
let
classStatusInfo
=
new
pdu
[
'RCClassStatusInfoPdu'
];
classStatusInfo
.
nodeId
=
GlobalConfig
.
nodeId
;
//mcu中的唯一ID
classStatusInfo
.
userId
=
GlobalConfig
.
userId
;
classStatusInfo
.
userName
=
GlobalConfig
.
userName
;
classStatusInfo
.
siteId
=
GlobalConfig
.
siteId
;
//站点号
classStatusInfo
.
classId
=
GlobalConfig
.
classId
;
classStatusInfo
.
className
=
GlobalConfig
.
className
;
classStatusInfo
.
classType
=
GlobalConfig
.
classType
;
//课堂类型
classStatusInfo
.
classStatus
=
GlobalConfig
.
classStatus
;
//课堂的状态
classStatusInfo
.
classStartTime
=
GlobalConfig
.
classStartTime
;
//课堂点击开始时间
classStatusInfo
.
classStopTime
=
GlobalConfig
.
classStopTime
;
//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
classStatusInfo
.
classTimestamp
=
GlobalConfig
.
classTimestamp
;
//相对于点开始课堂的时间戳
classStatusInfo
.
classBeginTime
=
GlobalConfig
.
classBeginTime
;
//课堂创建的时间,这个是Sass返回的
classStatusInfo
.
classEndTime
=
GlobalConfig
.
classEndTime
;
//课堂结束的时间,这个是Sass返回的
classStatusInfo
.
recordStatus
=
GlobalConfig
.
recordStatus
;
//当前录制状态
classStatusInfo
.
recordTimestamp
=
GlobalConfig
.
recordTimestamp
;
//相对于首次开始录制的时间戳
classStatusInfo
.
recordFileName
=
GlobalConfig
.
recordFileName
;
//录制的文件名
classStatusInfo
.
recordDownloadUrl
=
GlobalConfig
.
recordDownloadUrl
;
//下载地址
classStatusInfo
.
serverTimestamp
=
GlobalConfig
.
serverTimestamp
;
//当前的系统时间戳
classStatusInfo
.
activeDocId
=
GlobalConfig
.
activeDocId
;
//当前激活的文档id
classStatusInfo
.
activeDocCurPage
=
GlobalConfig
.
activeDocCurPage
;
//当前激活的文档的当前页
console
.
log
(
"classStatusInfo-------------"
);
console
.
log
(
classStatusInfo
);
/*
optional uint32 item_idx=1;
optional uint32 from=2;
optional uint32 owner=3;
optional uint32 action_type=4;//状态改变的类型
optional RCClassStatusInfoPdu class_status_info=5;//当前课堂状态的信息
*/
//判断type类型,根据type设置不同的参数
let
modelPdu
=
new
pdu
[
'RCClassSendDataModelPdu'
];
modelPdu
.
itemIdx
=
_itemIdx
;
modelPdu
.
from
=
GlobalConfig
.
nodeId
;
modelPdu
.
owner
=
GlobalConfig
.
nodeId
;
modelPdu
.
actionType
=
_param
.
actionType
;
modelPdu
.
classStatusInfo
=
classStatusInfo
;
console
.
log
(
modelPdu
);
return
modelPdu
;
}
unPackPdu
(
owner
,
itemIdx
,
itemData
){
loger
.
log
(
"会议===unPackPdu "
);
if
(
owner
==
null
||
itemIdx
==
null
||
itemData
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
try
{
let
modelPdu
=
pdu
[
'RCClassSendDataModelPdu'
].
decode
(
itemData
);
return
modelPdu
;
}
catch
(
err
){
loger
.
log
(
"会议收到数据 unPackPdu Pdu解析错误,itemIdx="
+
itemIdx
+
" err:"
+
err
.
message
);
}
return
null
;
/////收到消息处理/////////////////////////////////////////////////////////////////////////////////
onJoinChannelHandlerSuccess
(){
loger
.
log
(
'ConferApe onJoinChannelHandlerSuccess'
);
//if(GlobalConfig.isHost){
// if(GlobalConfig.classStatus==ApeConsts.CLASS_STATUS_WAIT){
// GlobalConfig.classStartTime=EngineUtils.creatTimestampStr();
// GlobalConfig.classStopTime=GlobalConfig.classStartTime;
// }else{
// GlobalConfig.classStopTime=GlobalConfig.creatTimestampStr;
// }
//
// GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_STARTED;
// //_param.actionType=ACTION_TYPE_1;
// this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE);
// this.sendUpdaterClassStatusInfo(_param);
//}
}
/////收到消息处理/////////////////////////////////////////////////////////////////////////////////
tableUpdateHandler
(
owner
,
itemIdx
,
itemData
)
{
try
{
let
model
=
this
.
unPackPdu
(
owner
,
itemIdx
,
itemData
);
loger
.
log
(
'tableUpdateHandler'
,
model
);
//处理会议更新的信息
}
catch
(
e
)
{
loger
.
warn
(
'ConferApe table update got exception. itemIdx'
,
itemIdx
);
}
/* try {
let tabUpdatePdu = pdu["RCTabUpdateDataRequestPdu"].decode(itemData);
const uncompressedBytes = new Zlib.Inflate(tabUpdatePdu.action.compact().view).decompress();
let tabInfo = UTF8.getStringFromBytes(uncompressedBytes);
let tabTypeMatches = tabInfo.match(/<TabType>(.+)<\/TabType>/);
loger.log("更新列表数据 tableUpdateHandler","owner:"+owner, "itemIdx:"+itemIdx,"tabInfo:",tabInfo);
if (tabTypeMatches.length > 1 && tabTypeMatches[1] == 'show.docsharing') {
if (tabInfo.match(/<visible>(.+)<\/visible>/)[1] == 'true') {
this.activeDocId = tabInfo.match(/<TabID>(.+)<\/TabID>/)[1];
this._emit(MessageTypes.DOC_SWITCH, this.activeDocId);
}
}
} catch (e) {
loger.warn('ConferApe table update got exception. itemIdx',itemIdx);
}*/
}
...
...
@@ -445,6 +362,95 @@ class ConferApe extends Ape {
emitRosterChange
()
{
this
.
_emit
(
MessageTypes
.
CLASS_SHOW_ROSTER_NUM
,
Object
.
keys
(
this
.
rosters
).
length
);
}
///////数据的封包和解包/////////////////////////////////////////
packPdu
(
_param
,
_itemIdx
){
loger
.
log
(
"会议===packPdu "
);
//验证坐标点集合数组是否合法
if
(
_param
==
null
||
_itemIdx
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
/* message RCClassStatusInfoPdu {
optional uint32 node_id=1;//mcu中的唯一ID
optional uint32 user_id=2;
optional uint32 user_name=3;
optional uint32 site_id=4;//站点号
optional uint32 class_id=5;
optional uint32 class_name=6;
required uint32 class_type=7;//课堂类型
required uint32 class_status=9;//课堂的状态
optional uint32 class_startTime=10;//课堂点击开始时间
optional uint32 class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳
optional uint32 class_beginTime=13;//课堂创建的时间,这个是Sass返回的
optional uint32 class_endTime=14;//课堂结束的时间,这个是Sass返回的
optional uint32 record_status=15;//当前录制状态
optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳
optional uint32 record_fileName=17;//录制的文件名
optional uint32 record_downloadUrl=18;//下载地址
optional uint32 server_timestamp=19;//当前的系统时间戳
}*/
let
classStatusInfo
=
new
pdu
[
'RCClassStatusInfoPdu'
];
classStatusInfo
.
nodeId
=
GlobalConfig
.
nodeId
;
//mcu中的唯一ID
classStatusInfo
.
userId
=
GlobalConfig
.
userId
;
classStatusInfo
.
userName
=
GlobalConfig
.
userName
;
classStatusInfo
.
siteId
=
GlobalConfig
.
siteId
;
//站点号
classStatusInfo
.
classId
=
GlobalConfig
.
classId
;
classStatusInfo
.
className
=
GlobalConfig
.
className
;
classStatusInfo
.
classType
=
GlobalConfig
.
classType
;
//课堂类型
classStatusInfo
.
classStatus
=
GlobalConfig
.
classStatus
;
//课堂的状态
classStatusInfo
.
classStartTime
=
GlobalConfig
.
classStartTime
;
//课堂点击开始时间
classStatusInfo
.
classStopTime
=
GlobalConfig
.
classStopTime
;
//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
classStatusInfo
.
classTimestamp
=
GlobalConfig
.
classTimestamp
;
//相对于点开始课堂的时间戳
classStatusInfo
.
classBeginTime
=
GlobalConfig
.
classBeginTime
;
//课堂创建的时间,这个是Sass返回的
classStatusInfo
.
classEndTime
=
GlobalConfig
.
classEndTime
;
//课堂结束的时间,这个是Sass返回的
classStatusInfo
.
recordStatus
=
GlobalConfig
.
recordStatus
;
//当前录制状态
classStatusInfo
.
recordTimestamp
=
GlobalConfig
.
recordTimestamp
;
//相对于首次开始录制的时间戳
classStatusInfo
.
recordFileName
=
GlobalConfig
.
recordFileName
;
//录制的文件名
classStatusInfo
.
recordDownloadUrl
=
GlobalConfig
.
recordDownloadUrl
;
//下载地址
classStatusInfo
.
serverTimestamp
=
GlobalConfig
.
serverTimestamp
;
//当前的系统时间戳
classStatusInfo
.
activeDocId
=
GlobalConfig
.
activeDocId
;
//当前激活的文档id
classStatusInfo
.
activeDocCurPage
=
GlobalConfig
.
activeDocCurPage
;
//当前激活的文档的当前页
loger
.
log
(
"classStatusInfo-------------"
,
classStatusInfo
);
/*
optional uint32 item_idx=1;
optional uint32 from=2;
optional uint32 owner=3;
optional uint32 action_type=4;//状态改变的类型
optional RCClassStatusInfoPdu class_status_info=5;//当前课堂状态的信息
*/
//判断type类型,根据type设置不同的参数
let
modelPdu
=
new
pdu
[
'RCClassSendDataModelPdu'
];
modelPdu
.
itemIdx
=
_itemIdx
;
modelPdu
.
from
=
GlobalConfig
.
nodeId
;
modelPdu
.
owner
=
GlobalConfig
.
nodeId
;
//modelPdu.actionType =_param.actionType;
modelPdu
.
classStatusInfo
=
classStatusInfo
;
return
modelPdu
;
}
unPackPdu
(
owner
,
itemIdx
,
itemData
){
loger
.
log
(
"会议===unPackPdu "
);
if
(
owner
==
null
||
itemIdx
==
null
||
itemData
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
try
{
let
modelPdu
=
pdu
[
'RCClassSendDataModelPdu'
].
decode
(
itemData
);
return
modelPdu
;
}
catch
(
err
){
loger
.
log
(
"会议收到数据 unPackPdu Pdu解析错误,itemIdx="
+
itemIdx
+
" err:"
+
err
.
message
);
}
return
null
;
}
}
export
default
ConferApe
;
...
...
src/apes/DocApe.js
查看文件 @
6f6061a
...
...
@@ -228,78 +228,6 @@ class DocApe extends Ape {
this
.
sendUniform
(
adapterPdu
,
true
);
}
///////白板数据的封包和解包/////////////////////////////////////////
packPdu
(
_param
,
_itemIdx
){
loger
.
log
(
"文档===packPdu "
);
//验证坐标点集合数组是否合法
if
(
_param
==
null
||
_itemIdx
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
/* message RCDocSendDataModelPdu {
required uint32 item_idx=1;//唯一标识
required uint32 owner=2;
optional uint32 from=3;
optional uint32 cur_page_no=4;
optional uint32 page_num =5;
optional string file_type=6;
optional string creat_user_id=7;//创建文档userid
optional string relative_url=8;//文档相对地址
optional string url =9;//文档地址
optional uint32 cur_V=10;
optional uint32 cur_H=11;
optional uint32 scale=12;
optional bool visible=13;
optional uint32 action=14;//0,无操作, 1翻页 /缩放/滚动、2.显示/隐藏
optional string doc_id=15;//文档在服务器数据库中的唯一id
optional string file_name=16;//文档的名字
optional string dynamic_TS=17;//"dynamicTransferStatic": "0"
optional string md5=18;//md5
}*/
//判断type类型,根据type设置不同的参数
let
docModelPdu
=
new
pdu
[
'RCDocSendDataModelPdu'
];
docModelPdu
.
itemIdx
=
_itemIdx
;
docModelPdu
.
owner
=
GlobalConfig
.
nodeId
;
docModelPdu
.
from
=
GlobalConfig
.
nodeId
;
docModelPdu
.
curPageNo
=
_param
.
curPageNo
||
1
;
docModelPdu
.
pageNum
=
_param
.
pageNum
||
1
;
docModelPdu
.
fileType
=
_param
.
fileType
||
""
;
docModelPdu
.
creatUserId
=
_param
.
creatUserId
||
"0"
;
docModelPdu
.
url
=
_param
.
url
||
""
;
//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu
.
relativeUrl
=
_param
.
relativeUrl
||
""
;
//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu
.
curV
=
_param
.
curV
||
0
;
docModelPdu
.
curH
=
_param
.
curH
||
0
;
docModelPdu
.
scale
=
_param
.
scale
||
100
;
//按百分比
docModelPdu
.
visible
=
_param
.
visible
||
false
;
docModelPdu
.
action
=
_param
.
action
||
ApeConsts
.
DOC_ACTION_NORMAL
;
//0,无操作, 1翻页、2.显示/隐藏, 3缩放/滚动
docModelPdu
.
docId
=
_param
.
docId
||
""
;
//文档在服务器数据库中的唯一id,必须有
docModelPdu
.
md5
=
_param
.
md5
||
""
;
//MD5
docModelPdu
.
fileName
=
_param
.
fileName
||
"doc_"
+
_itemIdx
;
//文档的名字
docModelPdu
.
dynamicTS
=
_param
.
dynamicTS
||
"0"
;
//文档上传后返回值中的字段dynamicTransferStatic
console
.
log
(
docModelPdu
);
return
docModelPdu
;
}
unPackPdu
(
owner
,
itemIdx
,
itemData
){
loger
.
log
(
"文档===unPackPdu "
);
if
(
owner
==
null
||
itemIdx
==
null
||
itemData
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
try
{
let
docModelPdu
=
pdu
[
'RCDocSendDataModelPdu'
].
decode
(
itemData
);
//console.log(whiteBoardModelPdu);
//loger.log(docModelPdu);
return
docModelPdu
;
}
catch
(
err
){
loger
.
log
(
"文档收到数据 unPackPdu Pdu解析错误,itemIdx="
+
itemIdx
+
" err:"
+
err
.
message
);
}
return
null
;
}
/////收到消息处理/////////////////////////////////////////////////////////////////////////////////
tableInsertHandler
(
owner
,
itemIdx
,
itemData
)
{
//this.tableUpdateHandler(owner, tableId, itemData);
...
...
@@ -417,6 +345,80 @@ class DocApe extends Ape {
//储存的数据中没有查找到
return
false
;
}
///////数据的封包和解包/////////////////////////////////////////
packPdu
(
_param
,
_itemIdx
){
loger
.
log
(
"文档===packPdu "
);
//验证坐标点集合数组是否合法
if
(
_param
==
null
||
_itemIdx
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
/* message RCDocSendDataModelPdu {
required uint32 item_idx=1;//唯一标识
required uint32 owner=2;
optional uint32 from=3;
optional uint32 cur_page_no=4;
optional uint32 page_num =5;
optional string file_type=6;
optional string creat_user_id=7;//创建文档userid
optional string relative_url=8;//文档相对地址
optional string url =9;//文档地址
optional uint32 cur_V=10;
optional uint32 cur_H=11;
optional uint32 scale=12;
optional bool visible=13;
optional uint32 action=14;//0,无操作, 1翻页 /缩放/滚动、2.显示/隐藏
optional string doc_id=15;//文档在服务器数据库中的唯一id
optional string file_name=16;//文档的名字
optional string dynamic_TS=17;//"dynamicTransferStatic": "0"
optional string md5=18;//md5
}*/
//判断type类型,根据type设置不同的参数
let
docModelPdu
=
new
pdu
[
'RCDocSendDataModelPdu'
];
docModelPdu
.
itemIdx
=
_itemIdx
;
docModelPdu
.
owner
=
GlobalConfig
.
nodeId
;
docModelPdu
.
from
=
GlobalConfig
.
nodeId
;
docModelPdu
.
curPageNo
=
_param
.
curPageNo
||
1
;
docModelPdu
.
pageNum
=
_param
.
pageNum
||
1
;
docModelPdu
.
fileType
=
_param
.
fileType
||
""
;
docModelPdu
.
creatUserId
=
_param
.
creatUserId
||
"0"
;
docModelPdu
.
url
=
_param
.
url
||
""
;
//"http://101.200.150.192/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu
.
relativeUrl
=
_param
.
relativeUrl
||
""
;
//"/DocSharing/data/h5test/20170206-171100025/7e9c4178cac1133e0dd9d5b583439122.jpg";
docModelPdu
.
curV
=
_param
.
curV
||
0
;
docModelPdu
.
curH
=
_param
.
curH
||
0
;
docModelPdu
.
scale
=
_param
.
scale
||
100
;
//按百分比
docModelPdu
.
visible
=
_param
.
visible
||
false
;
docModelPdu
.
action
=
_param
.
action
||
ApeConsts
.
DOC_ACTION_NORMAL
;
//0,无操作, 1翻页、2.显示/隐藏, 3缩放/滚动
docModelPdu
.
docId
=
_param
.
docId
||
""
;
//文档在服务器数据库中的唯一id,必须有
docModelPdu
.
md5
=
_param
.
md5
||
""
;
//MD5
docModelPdu
.
fileName
=
_param
.
fileName
||
"doc_"
+
_itemIdx
;
//文档的名字
docModelPdu
.
dynamicTS
=
_param
.
dynamicTS
||
"0"
;
//文档上传后返回值中的字段dynamicTransferStatic
console
.
log
(
docModelPdu
);
return
docModelPdu
;
}
unPackPdu
(
owner
,
itemIdx
,
itemData
){
loger
.
log
(
"文档===unPackPdu "
);
if
(
owner
==
null
||
itemIdx
==
null
||
itemData
==
null
){
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
null
;
}
try
{
let
docModelPdu
=
pdu
[
'RCDocSendDataModelPdu'
].
decode
(
itemData
);
//console.log(whiteBoardModelPdu);
//loger.log(docModelPdu);
return
docModelPdu
;
}
catch
(
err
){
loger
.
log
(
"文档收到数据 unPackPdu Pdu解析错误,itemIdx="
+
itemIdx
+
" err:"
+
err
.
message
);
}
return
null
;
}
}
DocApe
.
prototype
.
DOC_JOIN_CHANNEL_SUCCESS
=
DocApe
.
DOC_JOIN_CHANNEL_SUCCESS
=
'doc.join.channel.success'
;
export
default
DocApe
;
...
...
请
注册
或
登录
后发表评论