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-02-22 15:26:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
82a058757963cd899b3f21eb9783b6c1c6770f61
82a05875
1 parent
5fcb084a
1.增加音频AudioApe模块,增加音频模块的pdu
2.修改视频模块和音频模块对外接口的名称
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
90 行增加
和
7 行删除
src/EngineEntrance.js
src/MessageTypes.js
src/apes/VideoApe.js
src/pdus/pro.js
src/EngineEntrance.js
查看文件 @
82a0587
...
...
@@ -11,6 +11,7 @@ import Loger from 'Loger';
import
ConferApe
from
'apes/ConferApe'
;
import
ChatApe
from
'apes/ChatApe'
;
import
VideoApe
from
'apes/VideoApe'
;
import
AudioApe
from
'apes/AudioApe'
;
import
DocApe
from
'apes/DocApe'
;
import
WhiteBoardApe
from
'apes/WhiteBoardApe'
;
import
EngineUtils
from
"EngineUtils"
;
...
...
@@ -29,6 +30,7 @@ let _mcu ;
let
_confer_ape
;
let
_chat_ape
;
let
_video_ape
;
let
_audio_ape
;
let
_doc_ape
;
let
_whiteboard_ape
;
...
...
@@ -87,6 +89,10 @@ export default class MessageEntrance extends Emiter {
_video_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_video_ape
.
on
(
MessageTypes
.
VIDEO_UPDATE
,
this
.
videoUpdate
.
bind
(
this
));
_audio_ape
=
new
AudioApe
();
_audio_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
_audio_ape
.
on
(
MessageTypes
.
AUDIO_UPDATE
,
this
.
videoUpdate
.
bind
(
this
));
_whiteboard_ape
=
new
WhiteBoardApe
();
_whiteboard_ape
.
on
(
'*'
,
(
type
,
data
)
=>
this
.
_emit
(
type
,
data
));
//_whiteboard_ape.on(MessageTypes.WHITEBOARD_ANNOTATION_UPDATE, this.annoUpdateHandler.bind(this));
...
...
@@ -115,12 +121,19 @@ export default class MessageEntrance extends Emiter {
this
.
sendChatMsg
=
this
.
_sendChatMsg
;
//videoApe
this
.
getPlayVideoPath
=
this
.
_getPlayVideoPath
;
this
.
getPublishVideoPath
=
this
.
_getPublishVideoPath
;
this
.
getVideoPlayPath
=
this
.
_getPlayVideoPath
;
this
.
getVideoPublishPath
=
this
.
_getPublishVideoPath
;
this
.
publishVideo
=
this
.
_publishVideo
;
this
.
stopPublishVideo
=
this
.
_stopPublishVideo
;
this
.
sendVideoCommandMsg
=
this
.
sendVideoCommandMsg
;
this
.
sendVideoBroadcastMsg
=
this
.
sendVideoCommandMsg
;
//audioApe
this
.
getAudioPlayPath
=
this
.
_getPlayAudioPath
;
this
.
getAudioPublishPath
=
this
.
_getPublishAudioPath
;
this
.
publishAudio
=
this
.
_publishAudio
;
this
.
stopPublishAudio
=
this
.
_stopPublishAudio
;
this
.
sendAudioBroadcastMsg
=
this
.
sendAudioCommandMsg
;
//whiteBoradApe
this
.
sendInsertAnnotaion
=
this
.
_sendInsertAnnotaion
;
...
...
@@ -184,6 +197,9 @@ export default class MessageEntrance extends Emiter {
if
(
_video_ape
){
_video_ape
.
stopPublishVideo
(
_data
);
}
if
(
_audio_ape
){
_video_ape
.
stopPublishAudio
(
_data
);
}
}
}
...
...
@@ -197,6 +213,9 @@ export default class MessageEntrance extends Emiter {
if
(
_video_ape
){
_video_ape
.
stopPublishVideo
({
"nodeId"
:
_param
.
fromNodeId
});
}
if
(
_audio_ape
){
_audio_ape
.
stopPublishAudio
({
"nodeId"
:
_param
.
fromNodeId
});
}
}
...
...
@@ -653,6 +672,9 @@ export default class MessageEntrance extends Emiter {
if
(
_video_ape
){
_video_ape
.
stopPublishVideo
();
}
if
(
_audio_ape
){
_audio_ape
.
stopPublishAudio
();
}
//离开会议
if
(
_confer_ape
){
_confer_ape
.
leaveClass
();
...
...
@@ -714,6 +736,45 @@ export default class MessageEntrance extends Emiter {
}
}
//AudioApe
audioUpdate
(
_data
){
//视频同步的消息发送改变,需要通知ferApe模块中的用户更新状态
if
(
_confer_ape
){
_confer_ape
.
updaterRosterStatus
(
_data
);
}
}
sendAudioCommandMsg
(
_param
){
if
(
_audio_ape
){
return
_audio_ape
.
sendAudioBroadcastMsg
(
_param
);
}
}
_getPlayAudioPath
(
_param
){
if
(
_audio_ape
){
return
_audio_ape
.
getAudioPlayPath
(
_param
);
}
}
_getPublishAudioPath
(
_param
){
if
(
_audio_ape
){
return
_audio_ape
.
getAudioPublishPath
(
_param
);
}
}
_publishAudio
(
_param
){
if
(
_audio_ape
){
return
_audio_ape
.
publishAudio
(
_param
);
}
}
_stopPublishAudio
(
_param
){
if
(
_audio_ape
){
return
_audio_ape
.
stopPublishAudio
(
_param
);
}
}
//WhiteBoardApe
// 添加标注,发送信息
_sendInsertAnnotaion
(
_param
){
...
...
src/MessageTypes.js
查看文件 @
82a0587
...
...
@@ -31,6 +31,11 @@ MessageTypes.CHAT_RECEIVE = 'chat.receive';
MessageTypes
.
VIDEO_UPDATE
=
'video.update'
;
MessageTypes
.
VIDEO_COMMAND
=
'video.command'
;
//音频模块事件定义
MessageTypes
.
AUDIO_UPDATE
=
'audio.update'
;
MessageTypes
.
AUDIO_COMMAND
=
'audio.command'
;
//文档模块事件定义
MessageTypes
.
DOC_DELETE
=
'document.delete'
;
//删除文档
MessageTypes
.
DOC_UPDATE
=
'document.update'
;
//更新文档(添加、变更)
...
...
src/apes/VideoApe.js
查看文件 @
82a0587
...
...
@@ -21,9 +21,9 @@ import MessageTypes from 'MessageTypes';
import
GlobalConfig
from
'GlobalConfig'
;
import
EngineUtils
from
'EngineUtils'
;
let
loger
=
Loger
.
getLoger
(
'Video
Chat
'
);
let
loger
=
Loger
.
getLoger
(
'Video
Ape
'
);
class
Video
Chat
extends
Ape
{
class
Video
Ape
extends
Ape
{
constructor
()
{
super
(
ApeConsts
.
VIDEO_SESSION_ID
,
...
...
@@ -451,5 +451,5 @@ class VideoChat extends Ape {
}
}
export
default
Video
Chat
;
export
default
Video
Ape
;
...
...
src/pdus/pro.js
查看文件 @
82a0587
...
...
@@ -740,10 +740,16 @@ message RCGiftSendDataRequestPdu {
optional
bytes
user_data
=
5
;
}
message
RCAudioSendDataRequestPdu
{
message
RCAudioSendDataRequestPdu
1
{
optional
uint32
initiator
=
1
;
required
bytes
user_data
=
2
;
}
message
RCAudioSendDataRequestPdu
{
required
uint32
from_node_id
=
1
;
//发起人
optional
uint32
to_node_id
=
2
;
//接收人,如果是0就是所有人都接收
optional
uint32
actionType
=
3
;
//消息指令类型;
optional
bytes
data
=
4
;
//其他数据,这个根据actionType来确定数据的结构
}
message
RCVideoSendDataRequestPdu
{
required
uint32
from_node_id
=
1
;
//发起人
...
...
@@ -759,6 +765,17 @@ message RCAudioChannelInfoRecordPdu {
required
uint32
bitrate
=
4
;
required
uint32
codec
=
5
;
}
message
RCAudioChannelInfoPdu
{
optional
uint32
status
=
1
;
//开启的状态
optional
uint32
channel_id
=
2
;
//唯一的频道id
optional
uint32
timestamp
=
3
;
//更新的时间戳
optional
uint32
from_node_id
=
4
;
//发起者的id
optional
uint32
to_node_id
=
5
;
//接收者的id,(如果是0,所有人都接收)
optional
uint32
media_type
=
6
;
//媒体类型:视频(包含音频)或音频
optional
uint32
class_id
=
7
;
//课堂号
optional
string
site_id
=
8
;
//站点号
optional
string
user_id
=
9
;
//用户的userId
}
message
RCVideoChannelInfoPdu
{
optional
uint32
status
=
1
;
//开启的状态
...
...
请
注册
或
登录
后发表评论