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
AlexWang
2017-07-23 16:03:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7c7eb6160bd93eea2cfa6c5b829e3d18a01de9d4
7c7eb616
1 parent
2501e753
延迟参数支持array
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
33 行增加
和
32 行删除
dist/McuClient.js
src/EngineEntrance.js
src/mcu.js
dist/McuClient.js
查看文件 @
7c7eb61
此 diff 太大无法显示。
src/EngineEntrance.js
查看文件 @
7c7eb61
...
...
@@ -63,7 +63,7 @@ export default class MessageEntrance extends Emiter {
//获取设备和系统信息
SystemConfig
.
getSystemInfo
();
this
.
classRecordStatusUpdateTimer
=
0
;
//课堂录制状态发生改变后同步当前所有模块数据的计时器
this
.
classRecordStatusUpdateTimer
=
0
;
//课堂录制状态发生改变后同步当前所有模块数据的计时器
//初始化状态
this
.
isGetUserIpCallback
=
false
;
//是否获取IP信息返回
this
.
isGetFastestMcuCallback
=
false
;
//是否MCU选点结束
...
...
@@ -285,7 +285,7 @@ export default class MessageEntrance extends Emiter {
_setMessageDelay
(
_data
)
{
loger
.
warn
(
"延迟消息-->"
,
_data
);
if
(
_data
)
{
GlobalConfig
.
messageDelay
=
Boolean
(
_data
.
messageDelay
)
;
GlobalConfig
.
messageDelay
=
_data
.
messageDelay
||
false
;
}
}
...
...
@@ -347,11 +347,11 @@ export default class MessageEntrance extends Emiter {
//开启录制成功
_onClassRecordSuccess
(
_param
)
{
clearTimeout
(
this
.
classRecordStatusUpdateTimer
);
let
_this
=
this
;
this
.
classRecordStatusUpdateTimer
=
setTimeout
(
function
(){
let
_this
=
this
;
this
.
classRecordStatusUpdateTimer
=
setTimeout
(
function
()
{
clearTimeout
(
this
.
classRecordStatusUpdateTimer
);
_this
.
updaterRecordAllApeStatus
(
_param
);
},
2000
);
},
2000
);
}
...
...
@@ -856,20 +856,20 @@ export default class MessageEntrance extends Emiter {
//课堂状态发生改变,需要停止当前的所有推流
_stopAllMediaPublishHandler
(
_data
)
{
loger
.
log
(
'课堂状态发生改变,需要停止当前的所有推流'
);
this
.
_emit
(
MessageTypes
.
MEDIA_STOP_PUBLISH
);
/* let allChannels=MediaModule.allMediaChannelsList;
let channl=null;
for(let i in allChannels){
channl=allChannels[i];
if(channl&&channl.status==ApeConsts.CHANNEL_STATUS_OPENING&&channl.fromNodeId==GlobalConfig.nodeId){
this._emit(MessageTypes.MEDIA_STOP_PUBLISH);
return;
}
}*/
}
//手动切换MS -> {ip;"xxx.xx.xx","port":"xxxx"}
_switchMediaServer
(
_param
){
loger
.
log
(
'课堂状态发生改变,需要停止当前的所有推流'
);
this
.
_emit
(
MessageTypes
.
MEDIA_STOP_PUBLISH
);
/* let allChannels=MediaModule.allMediaChannelsList;
let channl=null;
for(let i in allChannels){
channl=allChannels[i];
if(channl&&channl.status==ApeConsts.CHANNEL_STATUS_OPENING&&channl.fromNodeId==GlobalConfig.nodeId){
this._emit(MessageTypes.MEDIA_STOP_PUBLISH);
return;
}
}*/
}
//手动切换MS -> {ip;"xxx.xx.xx","port":"xxxx"}
_switchMediaServer
(
_param
)
{
if
(
GlobalConfig
.
isRecordPlayBack
)
{
//录制回放不做操作
loger
.
warn
(
'录制回放->不能手动切换MS'
);
...
...
@@ -879,9 +879,9 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
MS_PUBLISH_IP
=
_param
.
ip
||
""
;
GlobalConfig
.
MS_PUBLISH_PORT
=
_param
.
port
||
""
;
}
loger
.
warn
(
'手动切换MS->'
,
GlobalConfig
.
MS_PUBLISH_IP
+
":"
+
GlobalConfig
.
MS_PUBLISH_PORT
);
loger
.
warn
(
'手动切换MS->'
,
GlobalConfig
.
MS_PUBLISH_IP
+
":"
+
GlobalConfig
.
MS_PUBLISH_PORT
);
//更换完用户当前的MS地址,需要更新用户数据
if
(
_confer_ape
)
{
if
(
_confer_ape
)
{
_confer_ape
.
updateUserInfo
();
}
}
...
...
@@ -920,7 +920,7 @@ export default class MessageEntrance extends Emiter {
}*/
//选点完成需要更新用户数据
if
(
_confer_ape
)
{
if
(
_confer_ape
)
{
_confer_ape
.
updateUserInfo
();
}
loger
.
log
(
'MS->最新地址->'
,
GlobalConfig
.
MS_PUBLISH_IP
,
GlobalConfig
.
MS_PUBLISH_PORT
);
...
...
@@ -1278,7 +1278,7 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
setClassStatusInfo
(
JSON
.
parse
(
_data
.
currentInfo
));
}
catch
(
err
)
{
loger
.
warn
(
"从Sass获取的课堂数据JSON转换失败->"
);
console
.
log
(
"currentInfo"
,
_data
.
currentInfo
);
console
.
log
(
"currentInfo"
,
_data
.
currentInfo
);
GlobalConfig
.
setClassStatusInfo
(
_data
.
currentInfo
);
}
loger
.
log
(
GlobalConfig
.
classStatusInfo
);
...
...
@@ -1635,12 +1635,12 @@ export default class MessageEntrance extends Emiter {
//文档加入频道成功,同步到MCU服务器上的数据
docJoinChannelSuccess
()
{
loger
.
log
(
"docJoinChannelSuccess->isHost="
,
GlobalConfig
.
isHost
,
"当前总人数:"
,
GlobalConfig
.
rosterNumber
,
"sassDoclength="
,
GlobalConfig
.
docListPrepare
.
length
);
loger
.
log
(
"docJoinChannelSuccess->isHost="
,
GlobalConfig
.
isHost
,
"当前总人数:"
,
GlobalConfig
.
rosterNumber
,
"sassDoclength="
,
GlobalConfig
.
docListPrepare
.
length
);
//loger.log("docJoinChannelSuccess docListPrepare=");
//如果是主持人,那么需要判断一下文档模块同步的数据和从sass获取的文档数据是否相同,如果mcu服务器不存在的,需要上传
if
(
GlobalConfig
.
docListPrepare
&&
GlobalConfig
.
docListPrepare
.
length
>
0
)
{
if
(
GlobalConfig
.
docListPrepare
&&
GlobalConfig
.
docListPrepare
.
length
>
0
)
{
//如果当前身份是老师或者当前课堂内只有一个人,有权限同步文档到MCU
if
(
GlobalConfig
.
isHost
||
GlobalConfig
.
rosterNumber
<=
1
)
{
if
(
GlobalConfig
.
isHost
||
GlobalConfig
.
rosterNumber
<=
1
)
{
for
(
let
i
=
0
;
i
<
GlobalConfig
.
docListPrepare
.
length
;
i
++
)
{
let
value
=
GlobalConfig
.
docListPrepare
[
i
];
if
(
value
)
{
...
...
src/mcu.js
查看文件 @
7c7eb61
...
...
@@ -72,7 +72,7 @@ class MCU extends Emiter {
joinRequestPdu
.
type
=
2
;
joinRequestPdu
.
initiator
=
this
.
classInfo
.
nodeId
;
joinRequestPdu
.
nodeType
=
PduConsts
.
NT_TERMINAL
;
//normal
joinRequestPdu
.
classDescription
=
descriptorPdu
;
// classDescription
joinRequestPdu
.
classDescription
=
descriptorPdu
;
// classDescription
let
pduMsg
=
pdu
.
create_join_class_request_pdu
(
joinRequestPdu
.
type
,
...
...
@@ -86,7 +86,7 @@ class MCU extends Emiter {
PduConsts
.
SEG_ONCE
);
pduMsg
.
set
(
"site"
,
this
.
classInfo
.
siteId
);
//课堂号对应的名称
pduMsg
.
set
(
"site"
,
this
.
classInfo
.
siteId
);
//课堂号对应的名称
pduMsg
.
set
(
"userId"
,
this
.
classInfo
.
userId
);
pduMsg
.
set
(
"userName"
,
Base64
.
fromByteArray
(
ArrayBufferUtil
.
strToUint8Array
(
this
.
classInfo
.
userName
)));
pduMsg
.
set
(
"userRole"
,
this
.
classInfo
.
userRole
);
...
...
@@ -142,7 +142,9 @@ class MCU extends Emiter {
GlobalConfig
.
messageDelay
);
//延迟处理消息(3个条件--->ape允许延迟&&客户端设置需要延迟&&Sass设置的延迟时间大于0)
if
(
GlobalConfig
.
messageDelay
&&
GlobalConfig
.
messageDelay
.
indexOf
(
sessionLabel
)
!==
-
1
&&
GlobalConfig
.
mcuDelay
>
0
)
{
if
(
GlobalConfig
.
messageDelay
&&
GlobalConfig
.
messageDelay
.
indexOf
(
sessionLabel
)
!==
-
1
&&
GlobalConfig
.
mcuDelay
>
0
)
{
loger
.
warn
(
'延迟处理消息->'
,
GlobalConfig
.
mcuDelay
);
setTimeout
(()
=>
{
//this._pduRegAdapterHandler(regBuffer, seekTime);
...
...
@@ -210,7 +212,7 @@ class MCU extends Emiter {
this
.
classInfo
=
_classInfo
;
// 创建刷新nodeId
this
.
classInfo
.
nodeId
=
EngineUtils
.
creatSoleNumberFromTimestamp
();
GlobalConfig
.
nodeId
=
this
.
classInfo
.
nodeId
;
//这是标识自己身份的id
GlobalConfig
.
nodeId
=
this
.
classInfo
.
nodeId
;
//这是标识自己身份的id
let
nodeInfoRecordPdu
=
new
pdu
[
'RCNodeInfoRecordPdu'
];
nodeInfoRecordPdu
.
name
=
this
.
classInfo
.
userName
;
...
...
@@ -223,7 +225,7 @@ class MCU extends Emiter {
nodeInfoRecordPdu
.
openMicrophones
=
0
;
nodeInfoRecordPdu
.
microphones
=
GlobalConfig
.
microphones
;
nodeInfoRecordPdu
.
cameras
=
GlobalConfig
.
cameras
;
nodeInfoRecordPdu
.
videoQuality
=
GlobalConfig
.
videoQuality
;
//设置分辨率的
nodeInfoRecordPdu
.
videoQuality
=
GlobalConfig
.
videoQuality
;
//设置分辨率的
nodeInfoRecordPdu
.
userIp
=
GlobalConfig
.
userIp
;
nodeInfoRecordPdu
.
deviceType
=
GlobalConfig
.
deviceType
;
...
...
@@ -232,7 +234,6 @@ class MCU extends Emiter {
nodeInfoRecordPdu
.
explorerVersion
=
GlobalConfig
.
explorerVersion
;
nodeInfoRecordPdu
.
os
=
GlobalConfig
.
os
;
let
conferenceRecord
=
{};
//RCConferenceRecord_T
conferenceRecord
.
_conference_id
=
this
.
classInfo
.
classId
;
conferenceRecord
.
_top_node_id
=
this
.
classInfo
.
topNodeID
;
...
...
请
注册
或
登录
后发表评论