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
5c98844322aa0aa36682374b016f0d29a3d6835f
5c988443
1 parent
306bb164
1.更换新的消息广播协议(会议、视频、音频、聊天)
2、文档模块把获取文档完整地址的接口分成 获取图片和获取PDF 两个接口
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
71 行增加
和
31 行删除
src/EngineEntrance.js
src/GlobalConfig.js
src/Sass.js
src/apes/AudioApe.js
src/apes/ChatApe.js
src/apes/ConferApe.js
src/apes/DocApe.js
src/apes/VideoApe.js
src/pdus/PduType.js
src/EngineEntrance.js
查看文件 @
5c98844
...
...
@@ -152,7 +152,8 @@ export default class MessageEntrance extends Emiter {
this
.
sendDocumentDelete
=
this
.
_sassDeleteDocument
;
//删除文档,先通过Sass删除,sass删除成功之后再同步mcu
//this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档
this
.
sendDocumentCommand
=
this
.
_sendDocumentCommand
;
//操作文档(翻页、缩放、滚动...)
this
.
getDocFullPath
=
this
.
_getDocFullPath
;
//获取文档的完整路径
this
.
getDocImageFullPath
=
this
.
_getDocImageFullPath
;
//获取文档图片的完整路径
this
.
getDocPDFFullPath
=
this
.
_getDocPDFFullPath
;
//获取文档的完整路径
}
...
...
@@ -869,12 +870,20 @@ export default class MessageEntrance extends Emiter {
//DocApe
//获取文档完整路径
_getDocFullPath
(
_param
){
_getDoc
Image
FullPath
(
_param
){
if
(
_doc_ape
){
return
_doc_ape
.
getDocFullPath
(
_param
);
return
_doc_ape
.
getDoc
Image
FullPath
(
_param
);
}
else
{
loger
.
error
(
"文档模块还没有创建,无法获取"
);
return
""
;
return
[];
}
}
_getDocPDFFullPath
(
_param
){
if
(
_doc_ape
){
return
_doc_ape
.
getDocPDFFullPath
(
_param
);
}
else
{
loger
.
error
(
"文档模块还没有创建,无法获取"
);
return
[];
}
}
//上传文档
...
...
src/GlobalConfig.js
查看文件 @
5c98844
...
...
@@ -13,11 +13,6 @@ class GlobalConfig {
}
_currentStatus
=
null
;
static
setDebugData
(
_deBugData
){
this
.
isDebug
=
true
;
this
.
deBugData
=
_deBugData
;
}
static
getCurrentStatus
(){
if
(
this
.
_currentStatus
==
null
){
this
.
_currentStatus
=
this
.
statusCode_0
;
...
...
@@ -273,9 +268,6 @@ GlobalConfig.RecordServerPort ="";
GlobalConfig
.
maxVideoChannels
=
0
;
GlobalConfig
.
maxAudioChannels
=
0
;
GlobalConfig
.
isDebug
=
false
;
GlobalConfig
.
deBugData
=
{};
GlobalConfig
.
hasCamera
=
false
;
//摄像头是否可用
GlobalConfig
.
hasMicrophone
=
false
;
//麦克风是否可用
...
...
src/Sass.js
查看文件 @
5c98844
...
...
@@ -416,11 +416,11 @@ class Sass extends Emiter {
}
})
.
then
(
ret
=>
{
if
(
ret
.
c
ode
===
0
)
{
if
(
ret
.
errorC
ode
===
0
)
{
loger
.
log
(
'保存开始录制信息 完成'
);
this
.
_emit
(
Sass
.
CLASS_SAVE_RECORD_INFO_SUCCESS
,
_param
);
}
else
{
loger
.
warn
(
'保存开始录制信息 失败.'
);
loger
.
warn
(
'保存开始录制信息 失败.'
,
ret
);
}
})
.
catch
(
err
=>
{
...
...
src/apes/AudioApe.js
查看文件 @
5c98844
...
...
@@ -29,7 +29,7 @@ class AudioApe extends Ape {
this
.
registerObj
(
pdu
.
RCPDU_REG_REGISTER_TABLE
,
ApeConsts
.
AUDIO_OBJ_TABLE_ID
,
ApeConsts
.
AUDIO_OBJ_TABLE_NAME
,
ApeConsts
.
AUDIO_OBJ_TABLE_TAG
,
0
,
new
ArrayBuffer
);
// 广播消息,用户之间的消息传递
this
.
on
(
pdu
.
RCPDU_
AUDIO_SEND
_DATA_REQUEST
,
this
.
receiveAudiooCommandHandler
.
bind
(
this
));
this
.
on
(
pdu
.
RCPDU_
SEND_AUDIO
_DATA_REQUEST
,
this
.
receiveAudiooCommandHandler
.
bind
(
this
));
}
//ape加入成功
onJoinChannelHandlerSuccess
(){
...
...
@@ -162,7 +162,7 @@ class AudioApe extends Ape {
let
audioSendPdu
=
new
pdu
[
'RCAudioSendDataRequestPdu'
];
audioSendPdu
.
type
=
pdu
.
RCPDU_
AUDIO_SEND
_DATA_REQUEST
;
audioSendPdu
.
type
=
pdu
.
RCPDU_
SEND_AUDIO
_DATA_REQUEST
;
audioSendPdu
.
isPublic
=
true
;
audioSendPdu
.
fromNodeId
=
GlobalConfig
.
nodeId
;
//发起人
...
...
src/apes/ChatApe.js
查看文件 @
5c98844
...
...
@@ -35,7 +35,8 @@ class ChatApe extends Ape {
ApeConsts
.
CHAT_OBJ_TABLE_NAME
,
ApeConsts
.
CHAT_OBJ_TABLE_TAG
,
0
,
new
ArrayBuffer
);
// ape listeners
this
.
on
(
pdu
.
RCPDU_CHAT_SEND_DATA_REQUEST
,
this
.
chatMsgIncomingHandler
.
bind
(
this
));
//this.on(pdu.RCPDU_CHAT_SEND_DATA_REQUEST, this.chatMsgIncomingHandler.bind(this));
this
.
on
(
pdu
.
RCPDU_SEND_CHAT_DATA_REQUEST
,
this
.
chatMsgIncomingHandler
.
bind
(
this
));
}
sendChatMsg
(
_messageInfo
)
{
...
...
@@ -52,7 +53,8 @@ class ChatApe extends Ape {
loger
.
log
(
'发送聊天消息.'
,
_messageInfo
.
to
,
_messageInfo
.
message
);
let
chatSendPdu
=
new
pdu
[
'RCChatSendDataRequestPdu'
];
chatSendPdu
.
type
=
pdu
.
RCPDU_CHAT_SEND_DATA_REQUEST
;
//chatSendPdu.type = pdu.RCPDU_CHAT_SEND_DATA_REQUEST;
chatSendPdu
.
type
=
pdu
.
RCPDU_SEND_CHAT_DATA_REQUEST
;
chatSendPdu
.
initiator
=
this
.
_classInfo
.
nodeId
;
//发起人
chatSendPdu
.
peer
=
parseInt
(
_messageInfo
.
to
);
//发送给谁,公聊的时候是0,私聊的时候是指定的用户id
...
...
src/apes/ConferApe.js
查看文件 @
5c98844
...
...
@@ -54,7 +54,7 @@ class ConferApe extends Ape {
this
.
on
(
pdu
.
RCPDU_SESSION_JOIN_RESPONSE
,
this
.
_joinSessionHandler
.
bind
(
this
));
this
.
on
(
pdu
.
RCPDU_
CONFERENCE_SEND
_DATA_REQUEST
,
this
.
conferMsgComingHandler
.
bind
(
this
));
//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理
this
.
on
(
pdu
.
RCPDU_
SEND_CONFERENCE
_DATA_REQUEST
,
this
.
conferMsgComingHandler
.
bind
(
this
));
//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理
this
.
on
(
pdu
.
RCPDU_CONFERENCE_RECORD_REQUEST
,
this
.
onSendConferRecordRequestHandler
.
bind
(
this
));
//发送录制和停止录制消息
}
...
...
@@ -116,7 +116,7 @@ class ConferApe extends Ape {
*/
let
conferSendPdu
=
new
pdu
[
'RCConferenceSendDataRequestPdu'
];
conferSendPdu
.
type
=
pdu
.
RCPDU_
CONFERENCE_SEND
_DATA_REQUEST
;
conferSendPdu
.
type
=
pdu
.
RCPDU_
SEND_CONFERENCE
_DATA_REQUEST
;
conferSendPdu
.
initiator
=
this
.
_classInfo
.
nodeId
;
//发起人
conferSendPdu
.
peer
=
parseInt
(
_messageInfo
.
to
);
//发送给谁,公聊的时候是0,私聊的时候是指定的用户id
...
...
src/apes/DocApe.js
查看文件 @
5c98844
...
...
@@ -137,40 +137,70 @@ class DocApe extends Ape {
loger
.
log
(
"发送更新文档.itemIdx="
+
tableItemPdu
.
itemIdx
);
this
.
sendUniform
(
adapterPdu
,
true
);
}
//获取文档的完整地址
getDocFullPath
(
_param
){
//获取文档的图片完整地址
getDocImageFullPath
(
_param
){
if
(
_param
==
null
||
_param
.
relativeUrl
==
null
){
loger
.
warn
(
'获取文档完整地址,传递的参数不对.'
,
_param
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_CLASS_JOIN_PARAM
);
return
""
;
return
[]
;
}
let
port
=
(
GlobalConfig
.
DOCServerPort
==
""
||
GlobalConfig
.
DOCServerPort
==
null
)
?
""
:
":"
+
GlobalConfig
.
DOCServerPort
;
let
fullPath
=
GlobalConfig
.
DOCServerIP
+
port
+
_param
.
relativeUrl
;
var
index
;
if
(
fullPath
&&
fullPath
.
indexOf
(
"http://"
)
<
0
){
fullPath
=
"http://"
+
fullPath
;
}
var
fileType
=
"jpg"
;
switch
(
_param
.
type
){
case
"jpg"
:
fileType
=
"jpg"
;
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".jpg"
;
break
;
case
"png"
:
fileType
=
"png"
;
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".png"
;
break
;
case
"pdf"
:
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".pdf"
;
break
;
default
:
//不做处理,直接返回拼接的地址
break
;
}
if
(
_param
.
pageNum
&&
parseInt
(
_param
.
pageNum
)
>
1
){
//如果是多页的,需要返回序列
var
lastIndex
=
fullPath
.
lastIndexOf
(
"/"
);
if
(
lastIndex
>
0
){
let
newPath
=
fullPath
.
substr
(
0
,
lastIndex
);
let
pathArr
=
[];
for
(
let
i
=
1
;
i
<
_param
.
pageNum
;
i
++
){
pathArr
.
push
(
newPath
+
"/"
+
i
+
"."
+
fileType
);
}
return
pathArr
;
}
else
{
return
[
fullPath
];
}
}
else
{
return
[
fullPath
];
}
}
//获取文档的pdf完整地址
getDocPDFFullPath
(
_param
){
if
(
_param
==
null
||
_param
.
relativeUrl
==
null
){
loger
.
warn
(
'获取文档完整地址,传递的参数不对.'
,
_param
);
this
.
_emit
(
MessageTypes
.
MCU_ERROR
,
MessageTypes
.
ERR_CLASS_JOIN_PARAM
);
return
[];
}
let
port
=
(
GlobalConfig
.
DOCServerPort
==
""
||
GlobalConfig
.
DOCServerPort
==
null
)
?
""
:
":"
+
GlobalConfig
.
DOCServerPort
;
let
fullPath
=
GlobalConfig
.
DOCServerIP
+
port
+
_param
.
relativeUrl
;
if
(
fullPath
&&
fullPath
.
indexOf
(
"http://"
)
<
0
){
fullPath
=
"http://"
+
fullPath
;
}
loger
.
warn
(
'getDocFullPath ->'
,
fullPath
)
;
fullPath
=
this
.
replacePathType
(
fullPath
)
+
".pdf"
;
return
[
fullPath
];
}
// 去除文件的后缀格式名称
// 去除文件的后缀格式名称
replacePathType
(
_path
){
let
path
=
_path
;
path
=
path
.
replace
(
/.jpg/g
,
""
);
...
...
src/apes/VideoApe.js
查看文件 @
5c98844
...
...
@@ -30,7 +30,7 @@ class VideoApe extends Ape {
this
.
registerObj
(
pdu
.
RCPDU_REG_REGISTER_TABLE
,
ApeConsts
.
VIDEO_OBJ_TABLE_ID
,
ApeConsts
.
VIDEO_OBJ_TABLE_NAME
,
ApeConsts
.
VIDEO_OBJ_TABLE_TAG
,
0
,
new
ArrayBuffer
);
// videoApe 监听视频控制消息,用户之间的消息传递
this
.
on
(
pdu
.
RCPDU_
VIDEO_SEND
_DATA_REQUEST
,
this
.
receiveVideoCommandHandler
.
bind
(
this
));
this
.
on
(
pdu
.
RCPDU_
SEND_VIDEO
_DATA_REQUEST
,
this
.
receiveVideoCommandHandler
.
bind
(
this
));
}
//ape加入成功
onJoinChannelHandlerSuccess
(){
...
...
@@ -172,7 +172,7 @@ class VideoApe extends Ape {
}*/
let
videoSendPdu
=
new
pdu
[
'RCVideoSendDataRequestPdu'
];
videoSendPdu
.
type
=
pdu
.
RCPDU_
VIDEO_SEND
_DATA_REQUEST
;
videoSendPdu
.
type
=
pdu
.
RCPDU_
SEND_VIDEO
_DATA_REQUEST
;
videoSendPdu
.
isPublic
=
true
;
videoSendPdu
.
fromNodeId
=
GlobalConfig
.
nodeId
;
//发起人
...
...
src/pdus/PduType.js
查看文件 @
5c98844
...
...
@@ -99,3 +99,10 @@ RCPduPackage.RCPDU_INDEX_SERVER_USERS = 301;
RCPduPackage
.
RCPDU_INDEX_CONFERENCE_USER_JOINED
=
302
;
RCPduPackage
.
RCPDU_INDEX_CONFERENCE_USER_EXITED
=
303
;
RCPduPackage
.
RCPDU_INDEX_CONFERENCE_USERS
=
304
;
RCPduPackage
.
RCPDU_SEND_CONFERENCE_DATA_REQUEST
=
500
;
RCPduPackage
.
RCPDU_SEND_VIDEO_DATA_REQUEST
=
501
;
RCPduPackage
.
RCPDU_SEND_AUDIO_DATA_REQUEST
=
502
;
RCPduPackage
.
RCPDU_SEND_GIFT_DATA_REQUEST
=
503
;
RCPduPackage
.
RCPDU_SEND_CHAT_DATA_REQUEST
=
504
;
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论