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-06-20 12:17:53 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b7b9ee58e2cab49ed74f0f5d5992940e97007033
b7b9ee58
1 parent
98a63105
对外接口silenceClass controlSilenceStatus
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
253 行增加
和
244 行删除
src/EngineEntrance.js
src/EngineEntrance.js
查看文件 @
b7b9ee5
...
...
@@ -32,7 +32,7 @@ import QuestionApe from 'apes/QuestionApe';
import
UTF8
from
'utf-8'
;
let
loger
=
Loger
.
getLoger
(
'McuClient'
);
let
_sdkInfo
=
{
"version"
:
"v1.36.1.20170619"
,
"author"
:
"www.3mang.com"
};
let
_sdkInfo
=
{
"version"
:
"v1.36.1.20170619"
,
"author"
:
"www.3mang.com"
};
//APE
let
_sass
;
...
...
@@ -57,9 +57,9 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
this
.
sdkInfo
);
//初始化状态
this
.
isGetUserIpCallback
=
false
;
//是否获取IP信息返回
this
.
isGetFastestMcuCallback
=
false
;
//是否MCU选点结束
this
.
isGetFastestMsCallback
=
false
;
//是否MS选点结束
this
.
isGetUserIpCallback
=
false
;
//是否获取IP信息返回
this
.
isGetFastestMcuCallback
=
false
;
//是否MCU选点结束
this
.
isGetFastestMsCallback
=
false
;
//是否MS选点结束
GlobalConfig
.
setCurrentStatus
(
GlobalConfig
.
statusCode_0
);
...
...
@@ -69,18 +69,15 @@ export default class MessageEntrance extends Emiter {
// Sass平台层
_sass
=
Sass
;
_sass
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_sass
.
on
(
_sass
.
SUCCESS
,
this
.
_sassJoinSuccessHandler
.
bind
(
this
));
//通过SASS平台验证(密码和MD5)
_sass
.
on
(
_sass
.
CLASS_INIT_SUCCESS
,
this
.
_sassInitSuccessHandler
.
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
.
CLASS_SAVE_RECORD_INFO_SUCCESS
,
this
.
_sassSaveClassRecordInfoSuccessHandler
.
bind
(
this
));
//保存课堂录制信息
_sass
.
on
(
_sass
.
DELETE_DOCUMENT_SUCCESS
,
this
.
_sassDeleteDocumentSuccess
.
bind
(
this
));
//sass删除文档成功
_sass
.
on
(
_sass
.
DELETE_MEDIASHARE_SUCCESS
,
this
.
_sassDeleteMediaShareSuccess
.
bind
(
this
));
//sass删除媒体文件成功
_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
.
CLASS_SAVE_RECORD_INFO_SUCCESS
,
this
.
_sassSaveClassRecordInfoSuccessHandler
.
bind
(
this
));
//保存课堂录制信息
_sass
.
on
(
_sass
.
DELETE_DOCUMENT_SUCCESS
,
this
.
_sassDeleteDocumentSuccess
.
bind
(
this
));
//sass删除文档成功
_sass
.
on
(
_sass
.
DELETE_MEDIASHARE_SUCCESS
,
this
.
_sassDeleteMediaShareSuccess
.
bind
(
this
));
//sass删除媒体文件成功
//选点模块
_ipManager
=
new
IpManager
();
...
...
@@ -88,43 +85,41 @@ export default class MessageEntrance extends Emiter {
// 底层MCU消息层
_mcu
=
Mcu
;
_mcu
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_mcu
.
on
(
MessageTypes
.
CLASS_JOIN_MCU_SUCCESS
,
this
.
_mcuJoinMCUClassSuccessHandler
.
bind
(
this
));
//加入MCU课堂完成
_mcu
.
on
(
MessageTypes
.
SWITCH_MCU_IP
,
this
.
_switchMcuIpHandler
.
bind
(
this
));
//切换MCU,重新选点
_mcu
.
on
(
MessageTypes
.
CLASS_JOIN_MCU_SUCCESS
,
this
.
_mcuJoinMCUClassSuccessHandler
.
bind
(
this
));
//加入MCU课堂完成
_mcu
.
on
(
MessageTypes
.
SWITCH_MCU_IP
,
this
.
_switchMcuIpHandler
.
bind
(
this
));
//切换MCU,重新选点
//录制回放
_recordPlayback
=
RecordPlayBackParse
;
_recordPlayback
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_recordPlayback
.
on
(
RecordPlayBackParse
.
CLASS_JOIN_RECORD_PLAYBACK_SUCCESS
,
this
.
_joinRecordPlaybackSuccessHandler
.
bind
(
this
));
//加入录制回放完成
_recordPlayback
.
on
(
RecordPlayBackParse
.
RECORD_PLAYBACK_CLEAR_DATA
,
this
.
_recordPlaybackClearDataHandler
.
bind
(
this
));
//录制回放状态更新
_recordPlayback
.
on
(
RecordPlayBackParse
.
CLASS_JOIN_RECORD_PLAYBACK_SUCCESS
,
this
.
_joinRecordPlaybackSuccessHandler
.
bind
(
this
));
//加入录制回放完成
_recordPlayback
.
on
(
RecordPlayBackParse
.
RECORD_PLAYBACK_CLEAR_DATA
,
this
.
_recordPlaybackClearDataHandler
.
bind
(
this
));
//录制回放状态更新
// 注册所有应用Ape
_confer_ape
=
new
ConferApe
();
_confer_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_confer_ape
.
on
(
MessageTypes
.
CLASS_RUN_EXIT
,
this
.
_runClassExit
.
bind
(
this
));
//监听自己的关闭事件
_confer_ape
.
on
(
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
,
this
.
_onClassStatusInfoChange
.
bind
(
this
));
//当前课堂状态信息发生改变
_confer_ape
.
on
(
MessageTypes
.
CLASS_DELETE_ROSTER
,
this
.
_onClassDeleteRoster
.
bind
(
this
));
//当前课堂人员离开
_confer_ape
.
on
(
MessageTypes
.
CLASS_NONENTITY_ROSTER
,
this
.
_onClassNonentityRoster
.
bind
(
this
));
//当前课堂中视频或音频占用channel的nodeId ,在人员列表中不存在
_confer_ape
.
on
(
MessageTypes
.
CLASS_RECORD_START
,
this
.
_onClassRecordStart
.
bind
(
this
));
//课堂开始录制
_confer_ape
.
on
(
MessageTypes
.
CLASS_RECORD_SUCCESS
,
this
.
_onClassRecordSuccess
.
bind
(
this
));
//课堂开启录制成功
_confer_ape
.
on
(
MessageTypes
.
SWITCH_MS_IP
,
this
.
_switchMsIpHandler
.
bind
(
this
));
//MS动态选点
_confer_ape
.
on
(
MessageTypes
.
STOP_ALL_MEDIA_PUBLISH
,
this
.
_stopAllMediaPublishHandler
.
bind
(
this
));
//课堂状态发生改变,需要停止当前的所有推流
_confer_ape
.
on
(
MessageTypes
.
CLASS_RUN_EXIT
,
this
.
_runClassExit
.
bind
(
this
));
//监听自己的关闭事件
_confer_ape
.
on
(
MessageTypes
.
CLASS_STATUS_INFO_CHANGE
,
this
.
_onClassStatusInfoChange
.
bind
(
this
));
//当前课堂状态信息发生改变
_confer_ape
.
on
(
MessageTypes
.
CLASS_DELETE_ROSTER
,
this
.
_onClassDeleteRoster
.
bind
(
this
));
//当前课堂人员离开
_confer_ape
.
on
(
MessageTypes
.
CLASS_NONENTITY_ROSTER
,
this
.
_onClassNonentityRoster
.
bind
(
this
));
//当前课堂中视频或音频占用channel的nodeId ,在人员列表中不存在
_confer_ape
.
on
(
MessageTypes
.
CLASS_RECORD_START
,
this
.
_onClassRecordStart
.
bind
(
this
));
//课堂开始录制
_confer_ape
.
on
(
MessageTypes
.
CLASS_RECORD_SUCCESS
,
this
.
_onClassRecordSuccess
.
bind
(
this
));
//课堂开启录制成功
_confer_ape
.
on
(
MessageTypes
.
SWITCH_MS_IP
,
this
.
_switchMsIpHandler
.
bind
(
this
));
//MS动态选点
_confer_ape
.
on
(
MessageTypes
.
STOP_ALL_MEDIA_PUBLISH
,
this
.
_stopAllMediaPublishHandler
.
bind
(
this
));
//课堂状态发生改变,需要停止当前的所有推流
_chat_ape
=
new
ChatApe
();
_chat_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_video_ape
=
new
VideoApe
();
_video_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_video_ape
.
on
(
MessageTypes
.
VIDEO_UPDATE
,
this
.
videoUpdate
.
bind
(
this
));
//这个监听事件不能删除,需要通知课堂模块,检查channel占用
_video_ape
.
on
(
MessageTypes
.
USER_DEVICE_STATUS_CHAANGE
,
this
.
userDeviecStatusChange
.
bind
(
this
));
//监听摄像头和麦克风的开启状态
_video_ape
.
on
(
MessageTypes
.
VIDEO_UPDATE
,
this
.
videoUpdate
.
bind
(
this
));
//这个监听事件不能删除,需要通知课堂模块,检查channel占用
_video_ape
.
on
(
MessageTypes
.
USER_DEVICE_STATUS_CHAANGE
,
this
.
userDeviecStatusChange
.
bind
(
this
));
//监听摄像头和麦克风的开启状态
_audio_ape
=
new
AudioApe
();
_audio_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_audio_ape
.
on
(
MessageTypes
.
AUDIO_UPDATE
,
this
.
audioUpdate
.
bind
(
this
));
//这个监听事件不能删除,需要通知课堂模块,检查channel占用
_audio_ape
.
on
(
MessageTypes
.
USER_DEVICE_STATUS_CHAANGE
,
this
.
userDeviecStatusChange
.
bind
(
this
));
//监听摄像头和麦克风的开启状态
_audio_ape
.
on
(
MessageTypes
.
AUDIO_UPDATE
,
this
.
audioUpdate
.
bind
(
this
));
//这个监听事件不能删除,需要通知课堂模块,检查channel占用
_audio_ape
.
on
(
MessageTypes
.
USER_DEVICE_STATUS_CHAANGE
,
this
.
userDeviecStatusChange
.
bind
(
this
));
//监听摄像头和麦克风的开启状态
_mediaShareApe
=
new
MediaSharedApe
();
_mediaShareApe
=
new
MediaSharedApe
();
_mediaShareApe
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_mediaShareApe
.
on
(
MediaSharedApe
.
MEDIASHARED_JOIN_CHANNEL_SUCCESS
,
this
.
mediaShareApeJoinChannelSuccess
.
bind
(
this
));
...
...
@@ -137,7 +132,7 @@ export default class MessageEntrance extends Emiter {
_doc_ape
.
on
(
MessageTypes
.
DOC_DELETE
,
this
.
docDeleteHandler
.
bind
(
this
));
_doc_ape
.
on
(
DocApe
.
DOC_JOIN_CHANNEL_SUCCESS
,
this
.
docJoinChannelSuccess
.
bind
(
this
));
_questionApe
=
new
QuestionApe
();
_questionApe
=
new
QuestionApe
();
_questionApe
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
//公开外部调用的方法
...
...
@@ -149,12 +144,14 @@ export default class MessageEntrance extends Emiter {
//this.getClassDetail = this._getClassDetail;//停用
this
.
getClassStatusInfo
=
this
.
_getClassStatusInfo
.
bind
(
this
);
this
.
sendStartClass
=
this
.
_sendStartClass
.
bind
(
this
);
this
.
silenceClass
=
this
.
_silenceClass
.
bind
(
this
);
this
.
sendPauseClass
=
this
.
_sendPauseClass
.
bind
(
this
);
this
.
sendCloseClass
=
this
.
_sendCloseClass
.
bind
(
this
);
this
.
changeHandUpStatus
=
this
.
_changeHandUpStatus
.
bind
(
this
);
//自己切换举手状态
this
.
controlHandUpStatus
=
this
.
_controlHandUpStatus
.
bind
(
this
);
//控制别人的举手状态
this
.
changeHandUpStatus
=
this
.
_changeHandUpStatus
.
bind
(
this
);
//自己切换举手状态
this
.
controlHandUpStatus
=
this
.
_controlHandUpStatus
.
bind
(
this
);
//控制别人的举手状态
this
.
controlSilenceStatus
=
this
.
controlSilenceStatus
.
bind
(
this
);
//改变禁言状态
this
.
sceneTableChange
=
this
.
_sceneTableChange
.
bind
(
this
);
//控制别人的举手状态
this
.
sceneTableChange
=
this
.
_sceneTableChange
.
bind
(
this
);
//控制别人的举手状态
//录制回放
this
.
initRecordPlayback
=
this
.
_initRecordPlayback
.
bind
(
this
);
...
...
@@ -187,16 +184,16 @@ export default class MessageEntrance extends Emiter {
this
.
sendAudioBroadcastMsg
=
this
.
sendAudioCommandMsg
.
bind
(
this
);
//whiteBoradApe
this
.
sendInsertAnnotaion
=
this
.
_sendInsertAnnotaion
.
bind
(
this
);
//添加标注
this
.
sendDeleteAllAnnotation
=
this
.
_sendDeleteAllAnnotation
.
bind
(
this
);
//删除所有标注
this
.
sendDeleteCurPageAnnotation
=
this
.
_sendDeleteCurPageAnnotation
.
bind
(
this
);
//删除当前页的所有标注
this
.
sendGotoPrev
=
this
.
_sendGotoPrev
.
bind
(
this
);
//当前页撤销上一步
this
.
sendInsertAnnotaion
=
this
.
_sendInsertAnnotaion
.
bind
(
this
);
//添加标注
this
.
sendDeleteAllAnnotation
=
this
.
_sendDeleteAllAnnotation
.
bind
(
this
);
//删除所有标注
this
.
sendDeleteCurPageAnnotation
=
this
.
_sendDeleteCurPageAnnotation
.
bind
(
this
);
//删除当前页的所有标注
this
.
sendGotoPrev
=
this
.
_sendGotoPrev
.
bind
(
this
);
//当前页撤销上一步
//DocApe
this
.
sendDocumentUpload
=
this
.
_sendDocumentUpload
.
bind
(
this
);
//上传文档
this
.
sendDocumentUpload
=
this
.
_sendDocumentUpload
.
bind
(
this
);
//上传文档
this
.
sendDocumentSwitchDoc
=
this
.
_sendDocumentSwitchDoc
.
bind
(
this
);
//切换文档
this
.
sendDocumentSwitchPage
=
this
.
_sendDocumentSwitchPage
.
bind
(
this
);
//翻页
this
.
sendDocumentSwitchAnimation
=
this
.
_sendDocumentSwitchAnimation
.
bind
(
this
);
//切换当前页码的动画步骤
this
.
sendDocumentSwitchPage
=
this
.
_sendDocumentSwitchPage
.
bind
(
this
);
//翻页
this
.
sendDocumentSwitchAnimation
=
this
.
_sendDocumentSwitchAnimation
.
bind
(
this
);
//切换当前页码的动画步骤
this
.
sendDocumentDelete
=
this
.
_sassDeleteDocument
.
bind
(
this
);
this
.
sendDocBroadcastMsg
=
this
.
_sendDocBroadcastMsg
.
bind
(
this
);
//删除文档,先通过Sass删除,sass删除成功之后再同步mcu
...
...
@@ -205,41 +202,40 @@ export default class MessageEntrance extends Emiter {
//操作文档(翻页、缩放、滚动...)
this
.
getDocImageFullPath
=
this
.
_getDocImageFullPath
.
bind
(
this
);
//获取文档图片的完整路径
this
.
getDocPDFFullPath
=
this
.
_getDocPDFFullPath
.
bind
(
this
);
//获取文档的完整路径
this
.
getDocFullAddress
=
this
.
_getDocFullAddress
.
bind
(
this
);
//获取文档资源地址
this
.
getDocPDFFullPath
=
this
.
_getDocPDFFullPath
.
bind
(
this
);
//获取文档的完整路径
this
.
getDocFullAddress
=
this
.
_getDocFullAddress
.
bind
(
this
);
//获取文档资源地址
//媒体共享模块
this
.
mediaSharedUpload
=
this
.
_sendMediaSharedUpload
.
bind
(
this
);
//上传
this
.
mediaSharedDelete
=
this
.
_sassDeletMediaShare
.
bind
(
this
);
//删除,先通过Sass删除,删除成功之后才删除MCU的
this
.
mediaSharedUpload
=
this
.
_sendMediaSharedUpload
.
bind
(
this
);
//上传
this
.
mediaSharedDelete
=
this
.
_sassDeletMediaShare
.
bind
(
this
);
//删除,先通过Sass删除,删除成功之后才删除MCU的
this
.
mediaSharedPlay
=
this
.
_sendMediaSharedPlay
.
bind
(
this
);
//播放
this
.
mediaSharedStop
=
this
.
_sendMediaSharedStop
.
bind
(
this
);
//停止
this
.
mediaSharedUpdate
=
this
.
_sendMediaSharedUpdate
.
bind
(
this
);
//更新媒体的状态
this
.
mediaSharedStop
=
this
.
_sendMediaSharedStop
.
bind
(
this
);
//停止
this
.
mediaSharedUpdate
=
this
.
_sendMediaSharedUpdate
.
bind
(
this
);
//更新媒体的状态
//答题卡
this
.
creatQuestion
=
this
.
_creatQuestion
.
bind
(
this
);
this
.
getQuestion
=
this
.
_getQuestion
.
bind
(
this
);
this
.
getQuestionResult
=
this
.
_getQuestionResult
.
bind
(
this
);
this
.
sendAnswer
=
this
.
_sendAnswer
.
bind
(
this
);
this
.
stopQuestion
=
this
.
_stopQuestion
.
bind
(
this
);
this
.
setDeviceInfo
=
this
.
_setDeviceInfo
.
bind
(
this
);
//设置设备信息(麦克风,摄像头等等.....)
this
.
setMessageDelay
=
this
.
_setMessageDelay
.
bind
(
this
);
//设置是否延迟消息
this
.
switchServer
=
this
.
_switchMcuIpHandler
.
bind
(
this
);
//切换mcu服务器
this
.
switchMediaServer
=
this
.
_switchMsIpHandler
.
bind
(
this
);
//切换ms服务器
this
.
setDebugInfo
=
this
.
_setDebugInfo
.
bind
(
this
);
//设置debug信息
}
_setDebugInfo
(
_data
){
this
.
creatQuestion
=
this
.
_creatQuestion
.
bind
(
this
);
this
.
getQuestion
=
this
.
_getQuestion
.
bind
(
this
);
this
.
getQuestionResult
=
this
.
_getQuestionResult
.
bind
(
this
);
this
.
sendAnswer
=
this
.
_sendAnswer
.
bind
(
this
);
this
.
stopQuestion
=
this
.
_stopQuestion
.
bind
(
this
);
this
.
setDeviceInfo
=
this
.
_setDeviceInfo
.
bind
(
this
);
//设置设备信息(麦克风,摄像头等等.....)
this
.
setMessageDelay
=
this
.
_setMessageDelay
.
bind
(
this
);
//设置是否延迟消息
this
.
switchServer
=
this
.
_switchMcuIpHandler
.
bind
(
this
);
//切换mcu服务器
this
.
switchMediaServer
=
this
.
_switchMsIpHandler
.
bind
(
this
);
//切换ms服务器
this
.
setDebugInfo
=
this
.
_setDebugInfo
.
bind
(
this
);
//设置debug信息
}
_setDebugInfo
(
_data
)
{
loger
.
log
(
"设置debug信息-->"
,
_data
);
if
(
_data
)
{
if
(
_data
)
{
Loger
.
setLogDebug
(
_data
.
isDebug
);
}
}
//设置设备信息
_setDeviceInfo
(
_data
)
{
loger
.
log
(
"设置设备信息-->"
,
_data
);
if
(
_data
)
{
if
(
_data
)
{
/* GlobalConfig.videoQuality=_data.videoQuality||2;//画面质量 0-低;1-中;2-高;
GlobalConfig.cameras=_data.cameras||[];//摄像头列表
GlobalConfig.microphones=_data.microphones||[];//麦克风列表
...
...
@@ -248,21 +244,21 @@ export default class MessageEntrance extends Emiter {
GlobalConfig.curVideoQuality=_data.curVideoQuality||2;//当前选择的分辨率
GlobalConfig.micGain=_data.micGain||50;//音量(0-80)*/
GlobalConfig
.
cameras
=
_data
.
cameras
||
[];
GlobalConfig
.
microphones
=
_data
.
microphones
||
[];
GlobalConfig
.
videoQuality
=
parseInt
(
_data
.
videoQuality
);
GlobalConfig
.
curVideoQuality
=
parseInt
(
_data
.
curVideoQuality
);
GlobalConfig
.
micGain
=
_data
.
micGain
||
50
;
GlobalConfig
.
speakerVolume
=
_data
.
speakerVolume
||
50
;
GlobalConfig
.
micCode
=
_data
.
micCode
||
0
;
GlobalConfig
.
curCamera
=
_data
.
curCamera
||
''
;
GlobalConfig
.
curMicrophone
=
_data
.
curMicrophone
||
''
;
GlobalConfig
.
cameras
=
_data
.
cameras
||
[];
GlobalConfig
.
microphones
=
_data
.
microphones
||
[];
GlobalConfig
.
videoQuality
=
parseInt
(
_data
.
videoQuality
);
GlobalConfig
.
curVideoQuality
=
parseInt
(
_data
.
curVideoQuality
);
GlobalConfig
.
micGain
=
_data
.
micGain
||
50
;
GlobalConfig
.
speakerVolume
=
_data
.
speakerVolume
||
50
;
GlobalConfig
.
micCode
=
_data
.
micCode
||
0
;
GlobalConfig
.
curCamera
=
_data
.
curCamera
||
''
;
GlobalConfig
.
curMicrophone
=
_data
.
curMicrophone
||
''
;
if
(
!
GlobalConfig
.
curCamera
&&
GlobalConfig
.
cameras
.
length
>
0
){
GlobalConfig
.
curCamera
=
GlobalConfig
.
cameras
[
0
];
if
(
!
GlobalConfig
.
curCamera
&&
GlobalConfig
.
cameras
.
length
>
0
)
{
GlobalConfig
.
curCamera
=
GlobalConfig
.
cameras
[
0
];
}
if
(
!
GlobalConfig
.
curMicrophone
&&
GlobalConfig
.
microphones
.
length
>
0
){
GlobalConfig
.
curMicrophone
=
GlobalConfig
.
microphones
[
0
];
if
(
!
GlobalConfig
.
curMicrophone
&&
GlobalConfig
.
microphones
.
length
>
0
)
{
GlobalConfig
.
curMicrophone
=
GlobalConfig
.
microphones
[
0
];
}
this
.
_updateDeviceInfo
();
}
...
...
@@ -279,7 +275,7 @@ export default class MessageEntrance extends Emiter {
//mcu异常监听
_mcuErrorHandler
(
_data
,
_option
)
{
let
option
=
_option
||
""
;
let
errorMessage
=
{
"code"
:
_data
,
"reson"
:
MessageTypes
.
ErrorReson
[
_data
]
+
" "
+
option
};
let
errorMessage
=
{
"code"
:
_data
,
"reson"
:
MessageTypes
.
ErrorReson
[
_data
]
+
" "
+
option
};
this
.
_emit
(
MessageTypes
.
ERROR_EVENT
,
errorMessage
);
loger
.
error
(
"MCU_ERROR"
,
errorMessage
);
}
...
...
@@ -289,7 +285,7 @@ export default class MessageEntrance extends Emiter {
return
GlobalConfig
.
getCurrentStatus
();
}
//获取课堂信息
//获取课堂信息
_getClassDetail
()
{
return
GlobalConfig
.
getClassDetail
();
}
...
...
@@ -337,9 +333,9 @@ export default class MessageEntrance extends Emiter {
}
//录制状态发送改变,更新所有模块的当前数据发送到MCU
updaterRecordAllApeStatus
(
_param
)
{
updaterRecordAllApeStatus
(
_param
)
{
//老师身份和非录制回放的时候执行,录制状态发送改变,需要更新当前的数据,否则已有的消息会录制不上
if
(
GlobalConfig
.
isHost
&&!
GlobalConfig
.
isRecordPlayBack
)
{
if
(
GlobalConfig
.
isHost
&&
!
GlobalConfig
.
isRecordPlayBack
)
{
loger
.
warn
(
'录制状态发送改变->更新所有模块的当前数据发送到MCU'
);
//目前录制的模块[文档模块、白板模块、视频模块(包含屏幕共享)、音频模块、媒体共享,聊天模块]
if
(
_doc_ape
)
{
...
...
@@ -362,8 +358,7 @@ export default class MessageEntrance extends Emiter {
}
//有人员离开
_onClassDeleteRoster
(
_data
)
{
}
_onClassDeleteRoster
(
_data
)
{}
//当前课堂中视频或音频占用channel的nodeId ,在人员列表中不存在,这种情况是占用channel的人员掉线或离开的时候没有释放channel
//的占用状态导致,对于这种情况,需要释放掉
...
...
@@ -377,12 +372,12 @@ export default class MessageEntrance extends Emiter {
loger
.
warn
(
"onClassNonentityRoster.参数错误"
)
return
;
}
let
data
=
{
"nodeId"
:
_param
.
nodeId
};
let
data
=
{
"nodeId"
:
_param
.
nodeId
};
if
(
_video_ape
)
{
_video_ape
.
stopPublishVideo
(
data
);
//停止屏幕共享
if
(
GlobalConfig
.
nodeId
==
data
.
nodeId
)
{
if
(
GlobalConfig
.
nodeId
==
data
.
nodeId
)
{
_video_ape
.
stopPublishScreenShare
(
data
);
}
}
...
...
@@ -391,7 +386,6 @@ export default class MessageEntrance extends Emiter {
}
}
//Sass
//初始化
_init
(
_param
)
{
...
...
@@ -411,7 +405,7 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'初始化课堂->'
,
_param
);
//保存参数
GlobalConfig
.
isRecordPlayBack
=
false
;
//设置为非录制回放状态
GlobalConfig
.
isRecordPlayBack
=
false
;
//设置为非录制回放状态
GlobalConfig
.
classId
=
parseInt
(
_param
.
classId
);
GlobalConfig
.
portal
=
_param
.
portal
;
GlobalConfig
.
userId
=
_param
.
userId
||
"0"
;
...
...
@@ -454,7 +448,7 @@ export default class MessageEntrance extends Emiter {
return
;
}
//{"userName":"名字","password":"","autoLogin":""}
GlobalConfig
.
userName
=
_param
.
userName
||
GlobalConfig
.
userName
;
//以登陆时的名字为主,登陆之前可以修改名字
GlobalConfig
.
userName
=
_param
.
userName
||
GlobalConfig
.
userName
;
//以登陆时的名字为主,登陆之前可以修改名字
GlobalConfig
.
autoLogin
=
_param
.
autoLogin
||
""
;
GlobalConfig
.
password
=
_param
.
password
||
""
;
GlobalConfig
.
hasCamera
=
(
typeof
_param
.
hasCamera
==
"boolean"
)
?
_param
.
hasCamera
:
false
;
...
...
@@ -480,13 +474,13 @@ export default class MessageEntrance extends Emiter {
_sassInitSuccessHandler
(
_data
)
{
//{"siteId":"h5test","passwordRequired":true,"md5":"de399d5540b3da2fbc1eb0a770d4fd66","code":0,"msType":1}
//储存数据
GlobalConfig
.
md5
=
_data
.
md5
||
""
;
//这个暂时用假数据,后台接口写完就有数据了
GlobalConfig
.
md5
=
_data
.
md5
||
""
;
//这个暂时用假数据,后台接口写完就有数据了
GlobalConfig
.
msType
=
_data
.
msType
||
1
;
GlobalConfig
.
siteId
=
_data
.
siteId
||
""
;
GlobalConfig
.
classType
=
_data
.
meetingType
||
ApeConsts
.
CLASS_TYPE_1
;
//host默认需要密码,Sass服务器只判断学生是否需要密码,没有判断老师的
GlobalConfig
.
passwordRequired
=
_data
.
passwordRequired
||
false
;
//md5验证的时候需要Sass返回的值,不能更改
GlobalConfig
.
passwordRequired
=
_data
.
passwordRequired
||
false
;
//md5验证的时候需要Sass返回的值,不能更改
loger
.
log
(
'初始化课堂验证完成.'
);
...
...
@@ -524,7 +518,7 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'获取课堂课堂信息完成.'
);
//包含整个课堂最全的信息,储存数据
if
(
_data
)
{
GlobalConfig
.
mcuDelay
=
_data
.
h5Delay
||
0
;
//mcu消息延迟的时间间隔,单位(秒),结合客户端传的messageDelay的值使用
GlobalConfig
.
mcuDelay
=
_data
.
h5Delay
||
0
;
//mcu消息延迟的时间间隔,单位(秒),结合客户端传的messageDelay的值使用
GlobalConfig
.
className
=
_data
.
meetingName
||
""
;
GlobalConfig
.
classBeginTime
=
_data
.
beginTime
||
""
;
GlobalConfig
.
classEndTime
=
_data
.
endTime
||
""
;
...
...
@@ -532,31 +526,30 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
maxVideoChannels
=
_data
.
maxVideoChannels
;
GlobalConfig
.
maxAudioChannels
=
_data
.
maxAudioChannels
;
GlobalConfig
.
maxMediaChannels
=
Math
.
max
(
GlobalConfig
.
maxVideoChannels
,
GlobalConfig
.
maxAudioChannels
);
GlobalConfig
.
maxMediaChannels
=
Math
.
max
(
GlobalConfig
.
maxVideoChannels
,
GlobalConfig
.
maxAudioChannels
);
GlobalConfig
.
ssTunnelAppURL
=
_data
.
ssTunnelAppURL
||
''
;
//屏幕共享插件的地址
GlobalConfig
.
ssTunnelAppURL
=
_data
.
ssTunnelAppURL
||
''
;
//屏幕共享插件的地址
//视频质量相关设置,每次加入课堂都按最新的获取设置
GlobalConfig
.
fps
=
_data
.
fps
||
15
;
GlobalConfig
.
gop
=
_data
.
gop
||
3
;
GlobalConfig
.
videoQuality
=
parseInt
(
_data
.
videoQuality
);
GlobalConfig
.
curVideoQuality
=
GlobalConfig
.
videoQuality
;
GlobalConfig
.
curVideoQuality
=
GlobalConfig
.
videoQuality
;
//是否自动开始(身份是host的时候才用到的)
GlobalConfig
.
isAutoStartClass
=
_data
.
autoRecord
||
0
;
GlobalConfig
.
setDocListPrepare
(
_data
.
docListPrepare
);
//提前上传的文档列表
GlobalConfig
.
setRecordList
(
_data
.
recordList
);
//录制回放地址
GlobalConfig
.
setDocList
(
_data
.
docList
);
//文档地址
GlobalConfig
.
setMsList
(
_data
.
msList
);
//推流播流服务器地址(需要对列表中的地址进行分类,里面包含了推流和拉流的地址,目前主要是乐视的需要区分开)
GlobalConfig
.
setRsList
(
_data
.
rsList
);
//播放m3u8格式的地址(录制回放时使用)
GlobalConfig
.
setMcuList
(
_data
.
mcuList
);
//mcu
GlobalConfig
.
setMusicList
(
_data
.
musicList
);
//
GlobalConfig
.
setMusicListPrepare
(
_data
.
musicListPrepare
);
//提前上传的声音文件列表
GlobalConfig
.
setVideoCDNAddr
(
_data
.
videoCDNAddr
);
//cdn加速的拉流地址,直播的时候才使用
GlobalConfig
.
setRecordList
(
_data
.
recordList
);
//录制回放地址
GlobalConfig
.
setDocList
(
_data
.
docList
);
//文档地址
GlobalConfig
.
setMsList
(
_data
.
msList
);
//推流播流服务器地址(需要对列表中的地址进行分类,里面包含了推流和拉流的地址,目前主要是乐视的需要区分开)
GlobalConfig
.
setRsList
(
_data
.
rsList
);
//播放m3u8格式的地址(录制回放时使用)
GlobalConfig
.
setMcuList
(
_data
.
mcuList
);
//mcu
GlobalConfig
.
setMusicList
(
_data
.
musicList
);
//
GlobalConfig
.
setMusicListPrepare
(
_data
.
musicListPrepare
);
//提前上传的声音文件列表
GlobalConfig
.
setVideoCDNAddr
(
_data
.
videoCDNAddr
);
//cdn加速的拉流地址,直播的时候才使用
GlobalConfig
.
setMediaShareList
(
_data
.
sharedMediaList
);
//提前上传的媒体共享文件列表
//MCU地址
if
(
_data
.
mcuList
&&
_data
.
mcuList
.
length
>
0
)
{
//随机选择一个
...
...
@@ -583,61 +576,59 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'初始->MS->.'
,
GlobalConfig
.
MS_PUBLISH_IP
,
GlobalConfig
.
MS_PUBLISH_PORT
);
//播流的地址和推流地址需要分开的时候,单独设置拉流的地址 rtmp(目前乐视使用)
if
(
GlobalConfig
.
pullRtmpList
&&
GlobalConfig
.
pullRtmpList
.
length
>
0
)
{
if
(
GlobalConfig
.
pullRtmpList
&&
GlobalConfig
.
pullRtmpList
.
length
>
0
)
{
//有单独的rtmp拉流地址
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
pullRtmpList
.
length
);
GlobalConfig
.
MS_PLAY_RTMP_IP
=
GlobalConfig
.
pullRtmpList
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
GlobalConfig
.
pullRtmpList
[
index
].
port
||
""
;
}
else
{
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
pullRtmpList
.
length
);
GlobalConfig
.
MS_PLAY_RTMP_IP
=
GlobalConfig
.
pullRtmpList
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
GlobalConfig
.
pullRtmpList
[
index
].
port
||
""
;
}
else
{
//如果没有单独的rtmp拉流地址,和推流地址一样即可
GlobalConfig
.
MS_PLAY_RTMP_IP
=
GlobalConfig
.
MS_PUBLISH_IP
;
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
GlobalConfig
.
MS_PUBLISH_PORT
;
GlobalConfig
.
MS_PLAY_RTMP_IP
=
GlobalConfig
.
MS_PUBLISH_IP
;
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
GlobalConfig
.
MS_PUBLISH_PORT
;
}
loger
.
log
(
'初始->MSPull->.'
,
GlobalConfig
.
MS_PLAY_RTMP_IP
,
GlobalConfig
.
MS_PLAY_RTMP_PORT
);
//播流的地址和推流地址需要分开的时候,单独设置拉流的地址 hls(目前乐视使用)
if
(
GlobalConfig
.
hlsList
&&
GlobalConfig
.
hlsList
.
length
>
0
)
{
if
(
GlobalConfig
.
hlsList
&&
GlobalConfig
.
hlsList
.
length
>
0
)
{
//有单独的hls拉流地址
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
hlsList
.
length
);
GlobalConfig
.
MS_PLAY_HLS_IP
=
GlobalConfig
.
hlsList
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PLAY_HLS_PORT
=
GlobalConfig
.
hlsList
[
index
].
port
||
""
;
}
else
{
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
hlsList
.
length
);
GlobalConfig
.
MS_PLAY_HLS_IP
=
GlobalConfig
.
hlsList
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PLAY_HLS_PORT
=
GlobalConfig
.
hlsList
[
index
].
port
||
""
;
}
else
{
//没有单独的hls拉流地址,和录制回放地址一样即可
GlobalConfig
.
MS_PLAY_HLS_IP
=
GlobalConfig
.
RS_RECORD_PLAY_IP
;
GlobalConfig
.
MS_PLAY_HLS_PORT
=
GlobalConfig
.
RS_RECORD_PLAY_PORT
;
GlobalConfig
.
MS_PLAY_HLS_IP
=
GlobalConfig
.
RS_RECORD_PLAY_IP
;
GlobalConfig
.
MS_PLAY_HLS_PORT
=
GlobalConfig
.
RS_RECORD_PLAY_PORT
;
}
loger
.
log
(
'初始->MSHls->.'
,
GlobalConfig
.
MS_PLAY_HLS_IP
,
GlobalConfig
.
MS_PLAY_HLS_PORT
);
//直播的时候,拉流(rtmp和hls)需要从 videoCDNAddr中获取
//20170531-新规则,所有课堂类型都支持加速
// if(GlobalConfig.classType==ApeConsts.CLASS_TYPE_2&&GlobalConfig.videoCDNAddrList.length>0){
if
(
GlobalConfig
.
videoCDNAddrList
.
length
>
0
)
{
if
(
GlobalConfig
.
videoCDNAddrList
.
length
>
0
)
{
//videoCDNAddrList中rtmppush和hls是混在一起的,需要分离开;
let
listLen
=
GlobalConfig
.
videoCDNAddrList
.
length
;
for
(
let
i
=
0
;
i
<
listLen
;
i
++
){
let
ipItem
=
GlobalConfig
.
videoCDNAddrList
[
i
];
if
(
ipItem
){
if
(
ipItem
.
indexOf
(
'hls'
)
>=
0
){
let
listLen
=
GlobalConfig
.
videoCDNAddrList
.
length
;
for
(
let
i
=
0
;
i
<
listLen
;
i
++
)
{
let
ipItem
=
GlobalConfig
.
videoCDNAddrList
[
i
];
if
(
ipItem
)
{
if
(
ipItem
.
indexOf
(
'hls'
)
>=
0
)
{
//直播的时候m3u8拉流地址
GlobalConfig
.
MS_PLAY_HLS_IP
=
ipItem
;
//ip包含了端口
GlobalConfig
.
MS_PLAY_HLS_PORT
=
""
;
loger
.
log
(
'videoCDNAddr>初始->MSHls'
,
GlobalConfig
.
MS_PLAY_HLS_IP
);
}
else
if
(
ipItem
.
indexOf
(
'rtmppull'
)
>=
0
){
GlobalConfig
.
MS_PLAY_HLS_IP
=
ipItem
;
//ip包含了端口
GlobalConfig
.
MS_PLAY_HLS_PORT
=
""
;
loger
.
log
(
'videoCDNAddr>初始->MSHls'
,
GlobalConfig
.
MS_PLAY_HLS_IP
);
}
else
if
(
ipItem
.
indexOf
(
'rtmppull'
)
>=
0
)
{
//直播的时候rtmp拉流地址
GlobalConfig
.
MS_PLAY_RTMP_IP
=
ipItem
;
//ip包含了端口
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
''
;
loger
.
log
(
'videoCDNAddr->初始->MSPull'
,
GlobalConfig
.
MS_PLAY_RTMP_IP
);
GlobalConfig
.
MS_PLAY_RTMP_IP
=
ipItem
;
//ip包含了端口
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
''
;
loger
.
log
(
'videoCDNAddr->初始->MSPull'
,
GlobalConfig
.
MS_PLAY_RTMP_IP
);
}
}
}
}
else
{
}
else
{
loger
.
log
(
'不需要videoCDNAddr->'
);
}
//文档地址
if
(
_data
.
docList
&&
_data
.
docList
.
length
>
0
)
{
//doc上传地址,随机获取一个
...
...
@@ -658,7 +649,7 @@ export default class MessageEntrance extends Emiter {
}
//这里需要考虑是否加延迟处理,课堂信息刚获取完成,客户端需要根据数据创建界面UI,等创建完成后再加入课堂是最合适的(目前没有加延迟)
this
.
_emit
(
MessageTypes
.
CLASS_GET_INFO_SUCCESS
,
GlobalConfig
.
getClassInfo
());
this
.
_emit
(
MessageTypes
.
CLASS_GET_INFO_SUCCESS
,
GlobalConfig
.
getClassInfo
());
if
(
_data
.
currentInfo
)
{
//根据从Sass获取的数据信息,同步最后一次保存的课堂状态信息
...
...
@@ -673,7 +664,6 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
"还没有保存过课堂状信息"
);
}
//录制回放不需要获取ip信息和选点
if
(
GlobalConfig
.
isRecordPlayBack
)
{
if
(
_recordPlayback
)
{
...
...
@@ -691,9 +681,9 @@ export default class MessageEntrance extends Emiter {
//根据UserIp获取ip信息,选点
getUserIpInfo
()
{
let
_this
=
this
;
let
_this
=
this
;
if
(
_ipManager
)
{
_ipManager
.
loadServerJosn
(
function
(
_data
)
{
_ipManager
.
loadServerJosn
(
function
(
_data
)
{
_ipManager
.
getUserIpInfo
(
""
,
GlobalConfig
.
userIp
,
_this
.
_getUserIpCallbackHandler
.
bind
(
_this
),
2000
);
})
}
...
...
@@ -707,10 +697,10 @@ export default class MessageEntrance extends Emiter {
}
this
.
isGetUserIpCallback
=
true
;
if
(
_data
&&
_data
.
ret
==
"ok"
)
{
GlobalConfig
.
country
=
_data
.
country
;
//国家
GlobalConfig
.
city
=
_data
.
city
;
//城市
GlobalConfig
.
province
=
_data
.
province
;
//服务商
GlobalConfig
.
isp
=
_data
.
isp
;
//服务商
GlobalConfig
.
country
=
_data
.
country
;
//国家
GlobalConfig
.
city
=
_data
.
city
;
//城市
GlobalConfig
.
province
=
_data
.
province
;
//服务商
GlobalConfig
.
isp
=
_data
.
isp
;
//服务商
}
//合并MCU 、MS的列表
...
...
@@ -720,12 +710,12 @@ export default class MessageEntrance extends Emiter {
let
_this
=
this
;
//有一些站点不需要进行MS选点,需要先检查一下
if
(
GlobalConfig
.
siteId_letv
==
GlobalConfig
.
siteId
)
{
if
(
GlobalConfig
.
siteId_letv
==
GlobalConfig
.
siteId
)
{
//MS不需要选点
loger
.
log
(
"MS不需要选点->siteId->"
,
GlobalConfig
.
siteId
);
_this
.
isGetFastestMcuCallback
=
true
;
_this
.
_startConnectMCU
();
}
else
{
}
else
{
this
.
_getFastestMsServer
(
function
(
_data
)
{
loger
.
log
(
"MS选点结束->"
,
_data
);
if
(
_data
&&
_data
.
ip
)
{
...
...
@@ -780,7 +770,6 @@ export default class MessageEntrance extends Emiter {
console
.
log
(
" GlobalConfig.mcuList"
,
GlobalConfig
.
mcuList
);
console
.
log
(
" GlobalConfig.msList"
,
GlobalConfig
.
msList
);
//********合并所有MCU、MS 列表********
//****server.json中的数据和从Sass获取的msList mcuList 数据需要分开,不能同时共存****
/*GlobalConfig.mcuListAll.length = 0;
...
...
@@ -789,21 +778,21 @@ export default class MessageEntrance extends Emiter {
GlobalConfig.msListAll = GlobalConfig.msListAll.concat(GlobalConfig.msList, GlobalConfig.msListFromServer);*/
GlobalConfig
.
mcuListAll
.
length
=
0
;
if
(
GlobalConfig
.
mcuListFromServer
.
length
>
0
)
{
if
(
GlobalConfig
.
mcuListFromServer
.
length
>
0
)
{
//使用server中的MCU数据
loger
.
warn
(
"使用server中的MCU数据"
)
GlobalConfig
.
mcuListAll
=
GlobalConfig
.
mcuListFromServer
;
}
else
{
}
else
{
//使用Sass中的数据
loger
.
warn
(
"使用Sass中的MCU数据"
)
GlobalConfig
.
mcuListAll
=
GlobalConfig
.
mcuList
;
}
GlobalConfig
.
msListAll
.
length
=
0
;
if
(
GlobalConfig
.
msListFromServer
.
length
>
0
)
{
if
(
GlobalConfig
.
msListFromServer
.
length
>
0
)
{
loger
.
warn
(
"使用server中的MS数据"
)
GlobalConfig
.
msListAll
=
GlobalConfig
.
msListFromServer
;
}
else
{
}
else
{
loger
.
warn
(
"使用Sass中的MS数据"
)
GlobalConfig
.
msListAll
=
GlobalConfig
.
msList
;
}
...
...
@@ -818,7 +807,7 @@ export default class MessageEntrance extends Emiter {
_ipManager
.
getFastestMcuServer
(
GlobalConfig
.
mcuListAll
,
_callback
);
}
else
{
if
(
_callback
)
{
_callback
({
'ip'
:
""
});
_callback
({
'ip'
:
""
});
}
}
}
...
...
@@ -829,7 +818,7 @@ export default class MessageEntrance extends Emiter {
_ipManager
.
getFastestMsServer
(
GlobalConfig
.
msListAll
,
_callback
);
}
else
{
if
(
_callback
)
{
_callback
({
ip
:
""
});
_callback
({
ip
:
""
});
}
}
}
...
...
@@ -847,7 +836,7 @@ export default class MessageEntrance extends Emiter {
//只有加入课堂之后才能保存数据
if
(
GlobalConfig
.
getCurrentStatus
().
code
==
GlobalConfig
.
statusCode_2
.
code
)
{
//POST 保存数据
_sass
.
saveClassStatusInfo
({
"classStatusInfo"
:
GlobalConfig
.
classStatusInfo
});
//保存课堂状态信息
_sass
.
saveClassStatusInfo
({
"classStatusInfo"
:
GlobalConfig
.
classStatusInfo
});
//保存课堂状态信息
}
else
{
loger
.
error
(
"不能保存课堂数据"
,
GlobalConfig
.
getCurrentStatus
());
}
...
...
@@ -886,11 +875,10 @@ export default class MessageEntrance extends Emiter {
_mcuJoinMCUClassSuccessHandler
(
_data
)
{
//loger.log('MCU 课堂成功.');
GlobalConfig
.
setCurrentStatus
(
GlobalConfig
.
statusCode_2
);
GlobalConfig
.
classJoinSuccess
=
true
;
GlobalConfig
.
screenWidth
=
window
.
screen
.
width
;
GlobalConfig
.
screenHeight
=
window
.
screen
.
height
;
GlobalConfig
.
classJoinSuccess
=
true
;
GlobalConfig
.
screenWidth
=
window
.
screen
.
width
;
GlobalConfig
.
screenHeight
=
window
.
screen
.
height
;
//返回给客户端初始化成功的数据
let
joinClassSuccessCallBackData
=
{};
...
...
@@ -907,13 +895,13 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData
.
isHost
=
GlobalConfig
.
isHost
;
joinClassSuccessCallBackData
.
maxAudioChannels
=
GlobalConfig
.
maxAudioChannels
;
joinClassSuccessCallBackData
.
maxVideoChannels
=
GlobalConfig
.
maxVideoChannels
;
joinClassSuccessCallBackData
.
maxMediaChannels
=
GlobalConfig
.
maxMediaChannels
;
joinClassSuccessCallBackData
.
maxMediaChannels
=
GlobalConfig
.
maxMediaChannels
;
joinClassSuccessCallBackData
.
mcuDelay
=
GlobalConfig
.
mcuDelay
;
joinClassSuccessCallBackData
.
msType
=
GlobalConfig
.
msType
;
joinClassSuccessCallBackData
.
nodeId
=
GlobalConfig
.
nodeId
;
joinClassSuccessCallBackData
.
password
=
GlobalConfig
.
password
;
joinClassSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
// 老师的默认是true
joinClassSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
// 老师的默认是true
//GlobalConfig.passwordRequired 老师的默认是true
//GlobalConfig.portal=_data.portal;
joinClassSuccessCallBackData
.
role
=
GlobalConfig
.
role
;
...
...
@@ -931,22 +919,21 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
joinClassSuccessCallBackData
.
classType
=
GlobalConfig
.
classType
||
ApeConsts
.
CLASS_TYPE_1
;
joinClassSuccessCallBackData
.
country
=
GlobalConfig
.
country
;
//国家
joinClassSuccessCallBackData
.
city
=
GlobalConfig
.
city
;
//城市
joinClassSuccessCallBackData
.
province
=
GlobalConfig
.
province
;
//服务商
joinClassSuccessCallBackData
.
isp
=
GlobalConfig
.
isp
;
//服务商
joinClassSuccessCallBackData
.
country
=
GlobalConfig
.
country
;
//国家
joinClassSuccessCallBackData
.
city
=
GlobalConfig
.
city
;
//城市
joinClassSuccessCallBackData
.
province
=
GlobalConfig
.
province
;
//服务商
joinClassSuccessCallBackData
.
isp
=
GlobalConfig
.
isp
;
//服务商
joinClassSuccessCallBackData
.
classTimestamp
=
GlobalConfig
.
classTimestamp
;
//课堂进行的累积时间
joinClassSuccessCallBackData
.
recordTimestamp
=
GlobalConfig
.
recordTimestamp
;
//课堂录制的累积时间
joinClassSuccessCallBackData
.
recordPlaybackMaxTime
=
GlobalConfig
.
recordPlaybackMaxTime
;
//录制回放的总时间
joinClassSuccessCallBackData
.
classTimestamp
=
GlobalConfig
.
classTimestamp
;
//课堂进行的累积时间
joinClassSuccessCallBackData
.
recordTimestamp
=
GlobalConfig
.
recordTimestamp
;
//课堂录制的累积时间
joinClassSuccessCallBackData
.
recordPlaybackMaxTime
=
GlobalConfig
.
recordPlaybackMaxTime
;
//录制回放的总时间
joinClassSuccessCallBackData
.
fps
=
GlobalConfig
.
fps
;
joinClassSuccessCallBackData
.
gop
=
GlobalConfig
.
gop
;
joinClassSuccessCallBackData
.
videoQuality
=
GlobalConfig
.
videoQuality
;
joinClassSuccessCallBackData
.
ssTunnelAppURL
=
GlobalConfig
.
ssTunnelAppURL
;
joinClassSuccessCallBackData
.
currentSceneTableId
=
GlobalConfig
.
currentSceneTableId
;
//文档区域的模块显示
joinClassSuccessCallBackData
.
currentSceneTableId
=
GlobalConfig
.
currentSceneTableId
;
//文档区域的模块显示
loger
.
log
(
'加入课堂成功->'
);
loger
.
log
(
joinClassSuccessCallBackData
);
...
...
@@ -966,7 +953,7 @@ export default class MessageEntrance extends Emiter {
this
.
_getFastestMcuServer
(
function
(
_data
)
{
loger
.
log
(
"MCU选点结束->"
,
_data
);
//记录当前的IP地址,选点结束后需要判断一下是否是新的IP;
let
oldIp
=
GlobalConfig
.
MCUServerIP
;
let
oldIp
=
GlobalConfig
.
MCUServerIP
;
if
(
_data
&&
_data
.
ip
)
{
GlobalConfig
.
MCUServerIP
=
_data
.
ip
||
""
;
...
...
@@ -979,25 +966,25 @@ export default class MessageEntrance extends Emiter {
GlobalConfig
.
MCUServerPort
=
GlobalConfig
.
mcuList
[
index
].
port
||
""
;
}
}
if
(
oldIp
&&
oldIp
!=
GlobalConfig
.
MCUServerIP
)
{
if
(
oldIp
&&
oldIp
!=
GlobalConfig
.
MCUServerIP
)
{
loger
.
log
(
'MCU->最新地址->'
,
GlobalConfig
.
MCUServerIP
,
GlobalConfig
.
MCUServerPort
);
//判断是否需要主动断开当前的连接然后重连新的服务器
if
(
_param
&&
_param
.
reConnect
==
true
)
{
loger
.
log
(
'MCU->切换到最新的IP->'
,
GlobalConfig
.
MCUServerIP
,
GlobalConfig
.
MCUServerPort
);
_this
.
_startConnectMCU
();
}
else
{
}
else
{
//不需要断开当前的连接,更改ip即可
_this
.
_switchMcuIp
();
}
}
else
{
}
else
{
//如果选点结束后获得的ip和当前的IP相同,不需要切换
loger
.
log
(
'MCU不需要切换->之前的IP->'
,
oldIp
,
"新的IP->"
,
GlobalConfig
.
MCUServerIP
);
loger
.
log
(
'MCU不需要切换->之前的IP->'
,
oldIp
,
"新的IP->"
,
GlobalConfig
.
MCUServerIP
);
}
});
}
//课堂状态发生改变,需要停止当前的所有推流
_stopAllMediaPublishHandler
(
_data
)
{
_stopAllMediaPublishHandler
(
_data
)
{
loger
.
log
(
'课堂状态发生改变,需要停止当前的所有推流'
);
this
.
_emit
(
MessageTypes
.
MEDIA_STOP_PUBLISH
);
/* let allChannels=MediaModule.allMediaChannelsList;
...
...
@@ -1023,7 +1010,7 @@ export default class MessageEntrance extends Emiter {
this
.
_getFastestMsServer
(
function
(
_data
)
{
loger
.
log
(
"MS选点结束->"
,
_data
);
//记录当前的IP地址,选点结束后需要判断一下是否是新的IP;
let
oldIp
=
GlobalConfig
.
MCUServerIP
;
let
oldIp
=
GlobalConfig
.
MCUServerIP
;
if
(
_data
&&
_data
.
ip
)
{
GlobalConfig
.
MS_PUBLISH_IP
=
_data
.
ip
||
""
;
...
...
@@ -1037,23 +1024,21 @@ export default class MessageEntrance extends Emiter {
}
}
if
(
oldIp
&&
oldIp
!=
GlobalConfig
.
MS_PUBLISH_IP
){
if
(
oldIp
&&
oldIp
!=
GlobalConfig
.
MS_PUBLISH_IP
)
{
/* loger.log('MS->切换地址->', GlobalConfig.MSServerIP, GlobalConfig.MSServerPort);
//判断是否需要断开当前的连接重连新的服务器
if (_param && _param.reConnect == true) {
loger.log('MS->最新地址->', GlobalConfig.MSServerIP, GlobalConfig.MSServerPort);
}*/
loger
.
log
(
'MS->最新地址->'
,
GlobalConfig
.
MS_PUBLISH_IP
,
GlobalConfig
.
MS_PUBLISH_PORT
);
}
else
{
}
else
{
//如果选点结束后获得的ip和当前的IP相同,不需要切换
loger
.
log
(
'MS不需要切换->IP'
,
GlobalConfig
.
MS_PUBLISH_IP
);
loger
.
log
(
'MS不需要切换->IP'
,
GlobalConfig
.
MS_PUBLISH_IP
);
}
});
}
//先通过Sass删除文档数据,删除成功之后才能删除MCU的
_sassDeleteDocument
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
...
...
@@ -1095,7 +1080,7 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'删除文档成功->'
,
_param
);
this
.
_sendDocumentDelete
(
_param
);
}
_sassDeleteMediaShareSuccess
(
_param
)
{
_sassDeleteMediaShareSuccess
(
_param
)
{
loger
.
log
(
'删除媒体文件成功->'
,
_param
);
this
.
_sendMediaSharedDelete
(
_param
);
}
...
...
@@ -1113,6 +1098,19 @@ export default class MessageEntrance extends Emiter {
}
}
//ConferApe
//全局禁言
_silenceClass
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
}
if
(
_confer_ape
)
{
_confer_ape
.
silenceClass
(
_param
);
}
}
//暂停上课
_sendPauseClass
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
...
...
@@ -1124,43 +1122,56 @@ export default class MessageEntrance extends Emiter {
}
}
//更新设备信息
_updateDeviceInfo
(
_param
)
{
_updateDeviceInfo
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
'更新设备信息->失败'
,
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
loger
.
warn
(
'更新设备信息->失败'
,
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
!
GlobalConfig
.
classJoinSuccess
){
loger
.
warn
(
'更新设备信息->失败->还没有加入课堂成功'
,
GlobalConfig
.
getCurrentStatus
());
if
(
!
GlobalConfig
.
classJoinSuccess
)
{
loger
.
warn
(
'更新设备信息->失败->还没有加入课堂成功'
,
GlobalConfig
.
getCurrentStatus
());
}
if
(
_confer_ape
)
{
_confer_ape
.
updateDeviceInfo
(
_param
);
}
}
//文档-媒体共享-屏幕共享模块切换
_sceneTableChange
(
_param
)
{
_sceneTableChange
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
sceneTableChange
(
_param
);
}
}
// 禁言控制
_controlSilenceStatus
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
controlSilenceStatus
(
_param
);
}
}
//举手状态控制
_controlHandUpStatus
(
_param
)
{
_controlHandUpStatus
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
controlHandUpStatus
(
_param
);
}
}
//举手状态切换
_changeHandUpStatus
(
_param
)
{
_changeHandUpStatus
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
changeHandUpStatus
(
_param
);
...
...
@@ -1170,7 +1181,7 @@ export default class MessageEntrance extends Emiter {
_sendCloseClass
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_confer_ape
)
{
_confer_ape
.
closeClass
(
_param
);
...
...
@@ -1181,7 +1192,7 @@ export default class MessageEntrance extends Emiter {
_leaveClass
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
//停止推流
...
...
@@ -1198,14 +1209,14 @@ export default class MessageEntrance extends Emiter {
_confer_ape
.
leaveClass
();
}
let
callBack
=
{};
if
(
_param
&&
_param
.
type
){
callBack
=
_param
;
}
else
{
callBack
.
type
=
0
;
let
callBack
=
{};
if
(
_param
&&
_param
.
type
)
{
callBack
=
_param
;
}
else
{
callBack
.
type
=
0
;
}
loger
.
warn
(
'离开课堂->'
,
MessageTypes
.
CLASS_EXIT
,
callBack
);
this
.
_emit
(
MessageTypes
.
CLASS_EXIT
,
callBack
);
loger
.
warn
(
'离开课堂->'
,
MessageTypes
.
CLASS_EXIT
,
callBack
);
this
.
_emit
(
MessageTypes
.
CLASS_EXIT
,
callBack
);
//断开MCU连接
if
(
_mcu
)
{
...
...
@@ -1214,17 +1225,16 @@ export default class MessageEntrance extends Emiter {
}
}
//ChatApe
// 发送聊天消息
_sendChatMsg
(
_messageInfo
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_messageInfo
===
null
||
EngineUtils
.
isEmptyObject
(
_messageInfo
))
{
loger
.
log
(
'发送聊天消息失败->参数错误'
,
_messageInfo
);
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_chat_ape
)
{
_chat_ape
.
sendChatMsg
(
_messageInfo
);
...
...
@@ -1232,7 +1242,7 @@ export default class MessageEntrance extends Emiter {
}
//监听摄像头麦克风状态
userDeviecStatusChange
(
_data
)
{
userDeviecStatusChange
(
_data
)
{
/* nodeId:GlobalConfig.nodeId,
userRole:GlobalConfig.userRole,
userName:GlobalConfig.userName,
...
...
@@ -1246,14 +1256,14 @@ export default class MessageEntrance extends Emiter {
//屏幕共享
//开始屏幕共享
_publishScreenShare
(
_param
){
if
(
_video_ape
){
_publishScreenShare
(
_param
)
{
if
(
_video_ape
)
{
_video_ape
.
publishScreenShare
(
_param
);
}
}
//停止屏幕共享
_stopPublishScreenShare
(
_param
){
if
(
_video_ape
){
_stopPublishScreenShare
(
_param
)
{
if
(
_video_ape
)
{
_video_ape
.
stopPublishScreenShare
(
_param
);
}
}
...
...
@@ -1268,7 +1278,7 @@ export default class MessageEntrance extends Emiter {
_sendVideoBroadcastMsg
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_video_ape
)
{
return
_video_ape
.
sendVideoBroadcastMsg
(
_param
);
...
...
@@ -1296,7 +1306,7 @@ export default class MessageEntrance extends Emiter {
_publishVideo
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_video_ape
)
{
return
_video_ape
.
publishVideo
(
_param
);
...
...
@@ -1306,7 +1316,7 @@ export default class MessageEntrance extends Emiter {
_stopPublishVideo
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_video_ape
)
{
return
_video_ape
.
stopPublishVideo
(
_param
);
...
...
@@ -1324,7 +1334,7 @@ export default class MessageEntrance extends Emiter {
sendAudioCommandMsg
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_audio_ape
)
{
return
_audio_ape
.
sendAudioBroadcastMsg
(
_param
);
...
...
@@ -1352,7 +1362,7 @@ export default class MessageEntrance extends Emiter {
_publishAudio
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_audio_ape
)
{
return
_audio_ape
.
publishAudio
(
_param
);
...
...
@@ -1362,14 +1372,13 @@ export default class MessageEntrance extends Emiter {
_stopPublishAudio
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
""
};
}
if
(
_audio_ape
)
{
return
_audio_ape
.
stopPublishAudio
(
_param
);
}
}
//WhiteBoardApe
// 添加标注,发送信息
_sendInsertAnnotaion
(
_param
)
{
...
...
@@ -1411,7 +1420,6 @@ export default class MessageEntrance extends Emiter {
}
}
//DocApe
//获取文档的所有资源地址
_getDocFullAddress
(
_param
)
{
...
...
@@ -1419,7 +1427,7 @@ export default class MessageEntrance extends Emiter {
return
_doc_ape
.
getDocFullAddress
(
_param
);
}
else
{
loger
.
error
(
"文档模块还没有创建无法获取"
);
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
"文档模块还没有创建无法获取"
};
return
{
"code"
:
ApeConsts
.
RETURN_FAILED
,
"data"
:
"文档模块还没有创建无法获取"
};
}
}
...
...
@@ -1475,7 +1483,7 @@ export default class MessageEntrance extends Emiter {
}
}
//操作文档(页码上的动画步骤操作)
_sendDocumentSwitchAnimation
(
_param
)
{
_sendDocumentSwitchAnimation
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1566,7 +1574,7 @@ export default class MessageEntrance extends Emiter {
//媒体共享模块的接口
//上传
_sendMediaSharedUpload
(
_param
)
{
_sendMediaSharedUpload
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1576,7 +1584,7 @@ export default class MessageEntrance extends Emiter {
}
}
//Sass删除媒体文件数据
_sassDeletMediaShare
(
_param
)
{
_sassDeletMediaShare
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1601,7 +1609,7 @@ export default class MessageEntrance extends Emiter {
}
}
//删除
_sendMediaSharedDelete
(
_param
)
{
_sendMediaSharedDelete
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1611,7 +1619,7 @@ export default class MessageEntrance extends Emiter {
}
}
//更新媒体文件的状态信息
_sendMediaSharedUpdate
(
_param
)
{
_sendMediaSharedUpdate
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1621,7 +1629,7 @@ export default class MessageEntrance extends Emiter {
}
}
//播放
_sendMediaSharedPlay
(
_param
)
{
_sendMediaSharedPlay
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1631,7 +1639,7 @@ export default class MessageEntrance extends Emiter {
}
}
//停止
_sendMediaSharedStop
(
_param
)
{
_sendMediaSharedStop
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1656,7 +1664,7 @@ export default class MessageEntrance extends Emiter {
"creatUserName"
:
value
.
createUserName
,
"url"
:
value
.
url
,
"fileType"
:
value
.
type
,
"fileId"
:
""
+
value
.
id
,
"fileId"
:
""
+
value
.
id
,
"fileName"
:
value
.
name
,
"seek"
:
0
};
...
...
@@ -1684,10 +1692,10 @@ export default class MessageEntrance extends Emiter {
loger
.
log
(
'录制回放初始化->'
,
_param
);
//保存参数
GlobalConfig
.
isRecordPlayBack
=
true
;
//设置为录制回放状态
GlobalConfig
.
isRecordPlayBack
=
true
;
//设置为录制回放状态
GlobalConfig
.
classId
=
parseInt
(
_param
.
classId
);
GlobalConfig
.
portal
=
_param
.
portal
;
GlobalConfig
.
userRole
=
ApeConsts
.
normal
;
//*************很重要,录制回放的时候,身份模式是普通人********
GlobalConfig
.
userRole
=
ApeConsts
.
normal
;
//*************很重要,录制回放的时候,身份模式是普通人********
GlobalConfig
.
userId
=
_param
.
userId
||
"0"
;
GlobalConfig
.
userName
=
_param
.
userName
||
""
;
...
...
@@ -1734,7 +1742,7 @@ export default class MessageEntrance extends Emiter {
if
(
_whiteboard_ape
)
{
_whiteboard_ape
.
clearData
();
}
if
(
_video_ape
)
{
if
(
_video_ape
)
{
_video_ape
.
clearData
();
}
}
...
...
@@ -1756,7 +1764,7 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData
.
classId
=
GlobalConfig
.
classId
;
joinClassSuccessCallBackData
.
className
=
GlobalConfig
.
className
;
joinClassSuccessCallBackData
.
h5Module
=
GlobalConfig
.
h5Module
;
joinClassSuccessCallBackData
.
isHost
=
GlobalConfig
.
isHost
;
//
joinClassSuccessCallBackData
.
isHost
=
GlobalConfig
.
isHost
;
//
joinClassSuccessCallBackData
.
maxAudioChannels
=
GlobalConfig
.
maxAudioChannels
;
joinClassSuccessCallBackData
.
maxVideoChannels
=
GlobalConfig
.
maxVideoChannels
;
joinClassSuccessCallBackData
.
maxMediaChannels
=
GlobalConfig
.
maxMediaChannels
;
...
...
@@ -1766,7 +1774,7 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData
.
msType
=
GlobalConfig
.
msType
;
joinClassSuccessCallBackData
.
nodeId
=
GlobalConfig
.
nodeId
;
joinClassSuccessCallBackData
.
password
=
GlobalConfig
.
password
;
joinClassSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
// 老师的默认是true
joinClassSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
// 老师的默认是true
//GlobalConfig.passwordRequired 老师的默认是true
//GlobalConfig.portal=_data.portal;
joinClassSuccessCallBackData
.
role
=
GlobalConfig
.
role
;
...
...
@@ -1784,28 +1792,28 @@ export default class MessageEntrance extends Emiter {
joinClassSuccessCallBackData
.
passwordRequired
=
GlobalConfig
.
passwordRequired
;
joinClassSuccessCallBackData
.
classType
=
GlobalConfig
.
classType
||
ApeConsts
.
CLASS_TYPE_1
;
joinClassSuccessCallBackData
.
country
=
GlobalConfig
.
country
;
//国家
joinClassSuccessCallBackData
.
city
=
GlobalConfig
.
city
;
//城市
joinClassSuccessCallBackData
.
province
=
GlobalConfig
.
province
;
//服务商
joinClassSuccessCallBackData
.
isp
=
GlobalConfig
.
isp
;
//服务商
joinClassSuccessCallBackData
.
country
=
GlobalConfig
.
country
;
//国家
joinClassSuccessCallBackData
.
city
=
GlobalConfig
.
city
;
//城市
joinClassSuccessCallBackData
.
province
=
GlobalConfig
.
province
;
//服务商
joinClassSuccessCallBackData
.
isp
=
GlobalConfig
.
isp
;
//服务商
joinClassSuccessCallBackData
.
classTimestamp
=
GlobalConfig
.
classTimestamp
;
//课堂进行的累积时间
joinClassSuccessCallBackData
.
recordTimestamp
=
GlobalConfig
.
recordTimestamp
;
//录制累积的总时间
joinClassSuccessCallBackData
.
recordPlaybackMaxTime
=
GlobalConfig
.
recordPlaybackMaxTime
;
//录制回放的总时间
joinClassSuccessCallBackData
.
classTimestamp
=
GlobalConfig
.
classTimestamp
;
//课堂进行的累积时间
joinClassSuccessCallBackData
.
recordTimestamp
=
GlobalConfig
.
recordTimestamp
;
//录制累积的总时间
joinClassSuccessCallBackData
.
recordPlaybackMaxTime
=
GlobalConfig
.
recordPlaybackMaxTime
;
//录制回放的总时间
joinClassSuccessCallBackData
.
fps
=
GlobalConfig
.
fps
;
joinClassSuccessCallBackData
.
gop
=
GlobalConfig
.
gop
;
joinClassSuccessCallBackData
.
videoQuality
=
GlobalConfig
.
videoQuality
;
joinClassSuccessCallBackData
.
ssTunnelAppURL
=
GlobalConfig
.
ssTunnelAppURL
;
joinClassSuccessCallBackData
.
currentSceneTableId
=
GlobalConfig
.
currentSceneTableId
;
//文档区域的模块显示
joinClassSuccessCallBackData
.
currentSceneTableId
=
GlobalConfig
.
currentSceneTableId
;
//文档区域的模块显示
loger
.
log
(
joinClassSuccessCallBackData
);
//和加入课堂成功使用同样的消息处理
this
.
_emit
(
MessageTypes
.
CLASS_JOIN_SUCCESS
,
joinClassSuccessCallBackData
);
}
// //答题卡
_creatQuestion
(
_param
)
{
_creatQuestion
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1814,7 +1822,7 @@ export default class MessageEntrance extends Emiter {
_questionApe
.
creatQuestion
(
_param
);
}
}
_getQuestion
(
_param
)
{
_getQuestion
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1823,7 +1831,7 @@ export default class MessageEntrance extends Emiter {
_questionApe
.
getQuestion
(
_param
);
}
}
_getQuestionResult
(
_param
)
{
_getQuestionResult
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1832,7 +1840,7 @@ export default class MessageEntrance extends Emiter {
_questionApe
.
getQuestionResult
(
_param
);
}
}
_stopQuestion
(
_param
)
{
_stopQuestion
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1841,7 +1849,7 @@ export default class MessageEntrance extends Emiter {
_questionApe
.
stopQuestion
(
_param
);
}
}
_sendAnswer
(
_param
)
{
_sendAnswer
(
_param
)
{
if
(
!
_mcu
.
connected
)
{
loger
.
warn
(
GlobalConfig
.
getCurrentStatus
());
return
;
...
...
@@ -1852,3 +1860,4 @@ export default class MessageEntrance extends Emiter {
}
}
...
...
请
注册
或
登录
后发表评论