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
李勇
2017-05-04 18:34:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0d5ccb9f1e37db30634a2615df8fb52de3d056d6
0d5ccb9f
1 parent
238e99c1
1.课堂模块,人员加入的时候增加更多个人信息字段;2.新增人员举手和取消举手的接口;
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
101 行增加
和
14 行删除
dist/McuClient.js
src/EngineEntrance.js
src/GlobalConfig.js
src/apes/ConferApe.js
dist/McuClient.js
查看文件 @
0d5ccb9
此 diff 太大无法显示。
src/EngineEntrance.js
查看文件 @
0d5ccb9
...
...
@@ -27,7 +27,7 @@ import Server from "config/Server";
import
UTF8
from
'utf-8'
;
let
loger
=
Loger
.
getLoger
(
'McuClient'
);
let
_sdkInfo
=
{
"version"
:
"v1.1
0.6.20170503
"
,
"author"
:
"www.3mang.com"
};
let
_sdkInfo
=
{
"version"
:
"v1.1
1.3.20170504
"
,
"author"
:
"www.3mang.com"
};
//APE
let
_sass
;
...
...
@@ -132,6 +132,7 @@ export default class MessageEntrance extends Emiter {
this
.
sendStartClass
=
this
.
_sendStartClass
.
bind
(
this
);
this
.
sendPauseClass
=
this
.
_sendPauseClass
.
bind
(
this
);
this
.
sendCloseClass
=
this
.
_sendCloseClass
.
bind
(
this
);
this
.
changeHandUpStatus
=
this
.
_changeHandUpStatus
.
bind
(
this
);
//录制回放
this
.
initRecordPlayback
=
this
.
_initRecordPlayback
.
bind
(
this
);
...
...
@@ -931,12 +932,20 @@ export default class MessageEntrance extends Emiter {
_confer_ape
.
pauseClass
(
_param
);
}
}
_changeHandUpStatus
(
_param
){
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
changeHandUpStatus
(
_param
);
}
}
//停止上课
_sendCloseClass
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_confer_ape
)
{
_confer_ape
.
closeClass
(
_param
);
...
...
@@ -947,7 +956,7 @@ export default class MessageEntrance extends Emiter {
_leaveClass
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
//停止推流
...
...
@@ -985,11 +994,11 @@ export default class MessageEntrance extends Emiter {
_sendChatMsg
(
_messageInfo
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_messageInfo
===
null
||
EngineUtils
.
isEmptyObject
(
_messageInfo
))
{
loger
.
log
(
'发送聊天消息失败->参数错误'
,
_messageInfo
);
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_chat_ape
)
{
_chat_ape
.
sendChatMsg
(
_messageInfo
);
...
...
@@ -1007,7 +1016,7 @@ export default class MessageEntrance extends Emiter {
_sendVideoBroadcastMsg
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_video_ape
)
{
return
_video_ape
.
sendVideoBroadcastMsg
(
_param
);
...
...
src/GlobalConfig.js
查看文件 @
0d5ccb9
...
...
@@ -316,6 +316,12 @@ GlobalConfig.deviceType=0; //设备类型 0:电脑 1:安卓 2:ios
GlobalConfig
.
userIp
=
""
;
//用户当前IP
GlobalConfig
.
userId
=
0
;
GlobalConfig
.
userName
=
""
;
GlobalConfig
.
handUpTime
=
0
;
GlobalConfig
.
level
=
0
;
GlobalConfig
.
openCamera
=
0
;
GlobalConfig
.
openMicrophones
=
0
;
GlobalConfig
.
nodeId
=
0
;
//随机生成 mcu中的唯一ID
GlobalConfig
.
passwordRequired
=
false
;
...
...
src/apes/ConferApe.js
查看文件 @
0d5ccb9
...
...
@@ -49,9 +49,70 @@ class ConferApe extends Ape {
//加入课堂
_joinSessionHandler
(
_data
)
{
let
nodeInfoRecordPdu
=
this
.
mcu
.
mcuClassInfo
.
self
;
loger
.
log
(
"_joinSessionHandler nodeInfoRecordPdu="
);
loger
.
log
(
nodeInfoRecordPdu
);
//let nodeInfoRecordPdu = this.mcu.mcuClassInfo.self;
let
nodeInfoRecordPdu
=
this
.
getNodeInfo
();
let
userDataPdu
=
new
pdu
[
'RCNodeInfoUserDataPdu'
];
userDataPdu
.
qq
=
''
;
userDataPdu
.
skype
=
''
;
nodeInfoRecordPdu
.
userData
=
userDataPdu
.
toArrayBuffer
();
nodeInfoRecordPdu
.
deviceType
=
GlobalConfig
.
deviceType
;
//设备类型
loger
.
log
(
'开始加入->'
,
nodeInfoRecordPdu
);
let
item
=
new
pdu
[
'RCRegistryRosterItemPdu'
];
item
.
nodeId
=
nodeInfoRecordPdu
.
nodeId
;
item
.
nodeData
=
nodeInfoRecordPdu
.
toArrayBuffer
();
let
rosterUpdateItem
=
new
pdu
[
'RCRegistryRosterUpdateItemPdu'
];
rosterUpdateItem
.
type
=
pdu
.
RCPDU_REG_ROSTER_UPDATE_PDU
;
rosterUpdateItem
.
items
.
push
(
item
);
let
updateObjPdu
=
new
pdu
[
'RCRegistryUpdateObjPdu'
];
updateObjPdu
.
objId
=
ApeConsts
.
CONFERENCE_OBJ_ROSTER_ID
;
updateObjPdu
.
subType
=
rosterUpdateItem
.
type
;
updateObjPdu
.
userData
=
rosterUpdateItem
.
toArrayBuffer
();
//同步
let
adapterItemPdu
=
new
pdu
[
'RCAdapterItemPdu'
];
adapterItemPdu
.
type
=
pdu
.
RCPDU_REG_UPDATE_OBJ
;
adapterItemPdu
.
itemData
=
updateObjPdu
.
toArrayBuffer
();
let
adapterPdu
=
new
pdu
[
'RCAdapterPdu'
];
adapterPdu
.
type
=
pdu
.
RCPDU_REG_ADAPTER
;
adapterPdu
.
item
.
push
(
adapterItemPdu
);
this
.
sendUniform
(
adapterPdu
,
true
);
}
//获取角色信息
getNodeInfo
(){
let
nodeInfoRecordPdu
=
new
pdu
[
'RCNodeInfoRecordPdu'
];
nodeInfoRecordPdu
.
nodeId
=
GlobalConfig
.
nodeId
;
nodeInfoRecordPdu
.
name
=
GlobalConfig
.
userName
;
nodeInfoRecordPdu
.
role
=
ApeConsts
.
userTypesToId
[
GlobalConfig
.
userRole
]
||
1
;
//NR_NORMAL用户的身份,根据用户登录时的身份设置;
nodeInfoRecordPdu
.
level
=
GlobalConfig
.
level
;
//nodeInfoRecordPdu.audioRecords= GlobalConfig.audioRecords;
//nodeInfoRecordPdu.videoRecords= GlobalConfig.videoRecords;
//nodeInfoRecordPdu.status= GlobalConfig.status;
nodeInfoRecordPdu
.
userData
=
GlobalConfig
.
userData
;
nodeInfoRecordPdu
.
userId
=
GlobalConfig
.
userId
;
nodeInfoRecordPdu
.
handUpTime
=
GlobalConfig
.
handUpTime
;
//nodeInfoRecordPdu.deviceType= GlobalConfig.deviceType;
//nodeInfoRecordPdu.mobileDirection= GlobalConfig.mobileDirection;
nodeInfoRecordPdu
.
microphones
=
GlobalConfig
.
microphones
;
nodeInfoRecordPdu
.
cameras
=
GlobalConfig
.
cameras
;
nodeInfoRecordPdu
.
openCamera
=
GlobalConfig
.
openCamera
;
nodeInfoRecordPdu
.
openMicrophones
=
GlobalConfig
.
openMicrophones
;
nodeInfoRecordPdu
.
videoQuality
=
GlobalConfig
.
videoQuality
;
nodeInfoRecordPdu
.
userIp
=
GlobalConfig
.
userIp
;
return
nodeInfoRecordPdu
;
}
//更新角色数据
updateUserInfo
(){
let
nodeInfoRecordPdu
=
this
.
getNodeInfo
();
loger
.
log
(
'更新用户信息->'
,
nodeInfoRecordPdu
);
let
userDataPdu
=
new
pdu
[
'RCNodeInfoUserDataPdu'
];
userDataPdu
.
qq
=
''
;
userDataPdu
.
skype
=
''
;
...
...
@@ -311,12 +372,23 @@ class ConferApe extends Ape {
this
.
sendConferMsg
({
"to"
:
0
,
"message"
:
"所有人退出课堂"
,
"actionType"
:
ApeConsts
.
CLASS_ACTION_CLOSE_ALL
});
}
//切换举手状态
changeHandUpStatus
(
_param
){
loger
.
log
(
'切换举手状态->'
,
_param
);
if
(
_param
&&
_param
.
isHandUp
==
true
){
//举手
GlobalConfig
.
handUpTime
=
EngineUtils
.
creatTimestamp
();
}
else
{
GlobalConfig
.
handUpTime
=
0
;
//默认0是没有举手的状态(大于0就是举手)
}
this
.
updateUserInfo
();
}
//更新课堂信息
sendUpdaterClassStatusInfo
(
_param
)
{
loger
.
log
(
'
sendUpdaterClassStatusInfo
'
);
loger
.
log
(
'
更新课堂信息->
'
);
if
(
_param
==
null
||
EngineUtils
.
isEmptyObject
(
_param
))
{
loger
.
log
(
'
sendUpdaterClassStatusInfo,
参数错误'
);
loger
.
log
(
'
更新课堂信息->
参数错误'
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
;
}
...
...
@@ -326,7 +398,7 @@ class ConferApe extends Ape {
loger
.
log
(
modelPdu
);
if
(
modelPdu
==
null
)
{
loger
.
log
(
'
sendUpdaterClassStatusInfo,
参数错误'
);
loger
.
log
(
'
更新课堂信息->
参数错误'
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_APE_INTERFACE_PARAM_WRONG
);
return
;
}
...
...
@@ -360,7 +432,7 @@ class ConferApe extends Ape {
adapterPdu
.
type
=
pdu
.
RCPDU_REG_ADAPTER
;
adapterPdu
.
item
.
push
(
adapterItemPdu
);
loger
.
log
(
"
课堂发送更新数据============
"
);
loger
.
log
(
"
更新课堂信息->发送更新数据
"
);
this
.
sendUniform
(
adapterPdu
,
true
);
}
...
...
请
注册
或
登录
后发表评论