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
56eaae2e816a5e3ab967423a4464e0c2b9532d9b
56eaae2e
1 parent
7cd3b4ed
增加控制举手状态的接口;
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
45 行增加
和
6 行删除
dist/McuClient.js
src/EngineEntrance.js
src/apes/ApeConsts.js
src/apes/ConferApe.js
dist/McuClient.js
查看文件 @
56eaae2
此 diff 太大无法显示。
src/EngineEntrance.js
查看文件 @
56eaae2
...
...
@@ -27,7 +27,7 @@ import Server from "config/Server";
import
UTF8
from
'utf-8'
;
let
loger
=
Loger
.
getLoger
(
'McuClient'
);
let
_sdkInfo
=
{
"version"
:
"v1.1
7
.0.201705010"
,
"author"
:
"www.3mang.com"
};
let
_sdkInfo
=
{
"version"
:
"v1.1
8
.0.201705010"
,
"author"
:
"www.3mang.com"
};
//APE
let
_sass
;
...
...
@@ -134,7 +134,9 @@ 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
.
changeHandUpStatus
=
this
.
_changeHandUpStatus
.
bind
(
this
);
//自己切换举手状态
this
.
controlHandUpStatus
=
this
.
_controlHandUpStatus
.
bind
(
this
);
//控制别人的举手状态
//录制回放
this
.
initRecordPlayback
=
this
.
_initRecordPlayback
.
bind
(
this
);
...
...
@@ -969,6 +971,15 @@ export default class MessageEntrance extends Emiter {
_confer_ape
.
pauseClass
(
_param
);
}
}
_controlHandUpStatus
(
_param
){
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
controlHandUpStatus
(
_param
);
}
}
_changeHandUpStatus
(
_param
){
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
...
...
src/apes/ApeConsts.js
查看文件 @
56eaae2
...
...
@@ -23,6 +23,7 @@ ApeConsts.CLASS_PAUSING = "class.update";//更新当前的状态信息
//课堂控制
ApeConsts
.
CLASS_ACTION_CLOSE_ALL
=
1
;
//所有人关闭课堂
ApeConsts
.
CLASS_ACTION_HANDUP_STATUS_CHANGE
=
2
;
//更改用户的举手状态
//课堂类型
ApeConsts
.
CLASS_TYPE_INTERACT
=
1
;
// 互动课堂,通过MS转发音视频,不能进行H5观看
...
...
src/apes/ConferApe.js
查看文件 @
56eaae2
...
...
@@ -169,7 +169,7 @@ class ConferApe extends Ape {
}
// to, message
loger
.
log
(
'发送课堂消息.'
,
_messageInfo
);
loger
.
log
(
'发送课堂
控制
消息.'
,
_messageInfo
);
/* message RCConferenceSendDataRequestPdu {
optional uint32 initiator = 1;
...
...
@@ -191,11 +191,11 @@ class ConferApe extends Ape {
// if (!(conferSendPdu.isPublic || 0 === conferSendPdu.peer)) {
if
(
!
conferSendPdu
.
isPublic
&&
0
!=
conferSendPdu
.
peer
)
{
//发送给制定的人
loger
.
log
(
'发送私聊课堂消息.'
);
//
loger.log('发送私聊课堂消息.');
this
.
send
(
conferSendPdu
);
}
else
{
//发送给所有人
loger
.
log
(
'发送公聊课堂消息.'
);
//
loger.log('发送公聊课堂消息.');
this
.
sendChatUniform
(
conferSendPdu
);
}
}
...
...
@@ -386,6 +386,21 @@ class ConferApe extends Ape {
this
.
sendConferMsg
({
"to"
:
0
,
"message"
:
"所有人退出课堂"
,
"actionType"
:
ApeConsts
.
CLASS_ACTION_CLOSE_ALL
});
}
//控制举手状态
controlHandUpStatus
(
_param
){
//控制用户的举手状态
if
(
!
_param
||!
_param
.
nodeId
){
loger
.
log
(
'控制举手状态->失败->参数错误'
,
_param
);
return
;
}
let
msgObj
=
{};
msgObj
.
nodeId
=
_param
.
nodeId
;
msgObj
.
isHandUp
=
false
;
if
(
_param
&&
_param
.
isHandUp
==
true
){
msgObj
.
isHandUp
=
true
;
}
this
.
sendConferMsg
({
"to"
:
_param
.
nodeId
,
"message"
:
JSON
.
stringify
(
msgObj
),
"actionType"
:
ApeConsts
.
CLASS_ACTION_HANDUP_STATUS_CHANGE
});
}
//切换举手状态
changeHandUpStatus
(
_param
){
loger
.
log
(
'切换举手状态->'
,
_param
);
...
...
@@ -573,13 +588,25 @@ class ConferApe extends Ape {
chatMsg
.
toNodeID
=
chatReceivePdu
.
peer
;
chatMsg
.
message
=
this
.
_rCArrayBufferUtil
.
uint8ArrayToStr
(
chatReceivePdu
.
userData
,
2
);
chatMsg
.
actionType
=
chatReceivePdu
.
actionType
;
loger
.
log
(
"conferMsgComingHandler"
,
chatMsg
);
loger
.
log
(
"conferMsgComingHandler"
,
chatMsg
);
//{"fromNodeID":418883112,"toNodeID":0,"message":"所有人退出课堂","actionType":1}
switch
(
chatMsg
.
actionType
)
{
case
ApeConsts
.
CLASS_ACTION_CLOSE_ALL
:
loger
.
log
(
chatMsg
.
message
);
//收到课堂关闭,所有人都退出,执行自己关闭的流程
this
.
_emit
(
MessageTypes
.
CLASS_RUN_EXIT
,{
'type'
:
1
});
break
;
case
ApeConsts
.
CLASS_ACTION_HANDUP_STATUS_CHANGE
:
console
.
log
(
'chatMsg'
,
chatMsg
);
let
msgObj
=
null
;
try
{
msgObj
=
JSON
.
parse
(
chatMsg
.
message
);
if
(
msgObj
&&
msgObj
.
nodeId
==
GlobalConfig
.
nodeId
){
this
.
changeHandUpStatus
(
msgObj
);
}
}
catch
(
err
){
loger
.
warn
(
'chatMsg->JSON数据解析失败'
);
}
break
;
default
:
break
;
}
...
...
请
注册
或
登录
后发表评论