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-04-13 09:22:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d5cbf2e711337fb9a7871c4659a335808c36351d
d5cbf2e7
1 parent
7048a3ba
课堂关闭 CLASS_EXIT增加类型,区分是自己关闭还是被踢出
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
10 行增加
和
18 行删除
src/EngineEntrance.js
src/McuClientEngine.js
src/apes/ConferApe.js
src/EngineEntrance.js
查看文件 @
d5cbf2e
...
...
@@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil';
import
UTF8
from
'utf-8'
;
let
loger
=
Loger
.
getLoger
(
'MessageEntrance'
);
let
_sdkInfo
=
{
"version"
:
"v.1.9.
0
.20170411"
,
"author"
:
"www.3mang.com"
};
let
_sdkInfo
=
{
"version"
:
"v.1.9.
1
.20170411"
,
"author"
:
"www.3mang.com"
};
//APE
let
_sass
;
...
...
@@ -70,7 +70,6 @@ export default class MessageEntrance extends Emiter {
_serverCheck
=
ServerCheck
;
_serverCheck
.
on
(
_serverCheck
.
SEVER_CHECK_BEST_IP_SUCCESS
,
this
.
_serverCheckBestIpSuccessHandler
.
bind
(
this
));
//ip选点,获取最佳ip完成
// 底层MCU消息层
_mcu
=
Mcu
;
_mcu
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
...
...
@@ -194,12 +193,7 @@ export default class MessageEntrance extends Emiter {
let
option
=
_option
||
""
;
let
errorMessage
=
{
"code"
:
_data
,
"reson"
:
MessageTypes
.
ErrorReson
[
_data
]
+
" "
+
option
};
loger
.
error
(
"MCU_ERROR"
,
errorMessage
);
this
.
_emit
(
MessageTypes
.
ERROR_EVENT
,
errorMessage
);
/* if (_mcuErrorCallBackFun) {
_mcuErrorCallBackFun(errorMessage);
}*/
}
//获取当前的状态
...
...
@@ -813,7 +807,7 @@ export default class MessageEntrance extends Emiter {
_publishVideo
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_video_ape
)
{
return
_video_ape
.
publishVideo
(
_param
);
...
...
@@ -823,7 +817,7 @@ export default class MessageEntrance extends Emiter {
_stopPublishVideo
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_video_ape
)
{
return
_video_ape
.
stopPublishVideo
(
_param
);
...
...
@@ -841,7 +835,7 @@ export default class MessageEntrance extends Emiter {
sendAudioCommandMsg
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_audio_ape
)
{
return
_audio_ape
.
sendAudioBroadcastMsg
(
_param
);
...
...
@@ -869,7 +863,7 @@ export default class MessageEntrance extends Emiter {
_publishAudio
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_audio_ape
)
{
return
_audio_ape
.
publishAudio
(
_param
);
...
...
@@ -879,7 +873,7 @@ export default class MessageEntrance extends Emiter {
_stopPublishAudio
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
}
;
}
if
(
_audio_ape
)
{
return
_audio_ape
.
stopPublishAudio
(
_param
);
...
...
src/McuClientEngine.js
查看文件 @
d5cbf2e
//对外暴露的对象
import
EngineEntrance
from
'EngineEntrance'
;
import
MessageTypes
from
'MessageTypes'
;
//
import MessageTypes from 'MessageTypes';
const
MCU_CLIENT
=
new
EngineEntrance
();
//入口文件
...
...
@@ -11,4 +9,4 @@ export function createMcuClient() {
}
//监听是事件名和异常定义
export
{
MessageTypes
};
//
export {MessageTypes};
...
...
src/apes/ConferApe.js
查看文件 @
d5cbf2e
...
...
@@ -596,7 +596,7 @@ class ConferApe extends Ape {
//踢出用户
kickOutRoster
()
{
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_CLASS_KICK_OUT
);
this
.
_emit
(
MessageTypes
.
CLASS_EXIT
);
this
.
_emit
(
MessageTypes
.
CLASS_EXIT
,{
'type'
:
1
}
);
}
//视频模块发生更新,人员状态需要更新
...
...
@@ -614,7 +614,7 @@ class ConferApe extends Ape {
if
(
GlobalConfig
.
nodeId
==
nodeId
)
{
loger
.
log
(
"自己离开课堂"
);
// 自己退出
this
.
_emit
(
MessageTypes
.
CLASS_EXIT
);
this
.
_emit
(
MessageTypes
.
CLASS_EXIT
,{
'type'
:
0
}
);
}
else
{
let
user
=
this
.
rosters
[
nodeId
];
if
(
user
){
...
...
请
注册
或
登录
后发表评论