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
2b2e8d06fc42065d0bd6de5b1b2090b2d81ba16e
2b2e8d06
1 parent
ed4eb85b
1.webrtc模块增加推流成功的监听;2.提供外部上传日志信息接口
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
22 行增加
和
19 行删除
src/EngineEntrance.js
src/apes/WebRtcApe.js
src/EngineEntrance.js
查看文件 @
2b2e8d0
...
...
@@ -62,7 +62,7 @@ export default class MessageEntrance extends Emiter {
constructor
()
{
super
();
//sdk 信息
GlobalConfig
.
sdkVersion
=
"v2.4.
0.20170907
"
;
GlobalConfig
.
sdkVersion
=
"v2.4.
2.20170908
"
;
loger
.
warn
(
"sdkVersion:"
+
GlobalConfig
.
sdkVersion
);
//设置
...
...
@@ -325,21 +325,21 @@ export default class MessageEntrance extends Emiter {
//上传log日志
_addLog
(
_data
)
{
if
(
_data
)
{
LogManager
.
addLog
(
LogManager
.
LOG
,
_data
);
LogManager
.
addLog
(
LogManager
.
LOG
,
_data
.
msg
||
""
);
}
}
//上传warn日志
_addWarn
(
_data
)
{
if
(
_data
)
{
LogManager
.
addLog
(
LogManager
.
WARN
,
_data
);
LogManager
.
addLog
(
LogManager
.
WARN
,
_data
.
msg
||
""
);
}
}
//上传error日志
_addError
(
_data
)
{
if
(
_data
)
{
LogManager
.
addLog
(
LogManager
.
ERROR
,
_data
);
LogManager
.
addLog
(
LogManager
.
ERROR
,
_data
.
msg
||
""
);
}
}
...
...
src/apes/WebRtcApe.js
查看文件 @
2b2e8d0
...
...
@@ -108,7 +108,7 @@ class WebRtcApe extends Emiter {
this
.
client
.
on
(
'stream-added'
,
(
evt
)
=>
{
let
stream
=
evt
.
stream
;
loger
.
log
(
"添加一个远程视频流: "
+
stream
.
getId
());
loger
.
log
(
"添加一个远程视频流: "
+
stream
.
getId
()
,
new
Date
().
getTime
()
);
this
.
client
.
subscribe
(
stream
,
(
err
)
=>
{
loger
.
log
(
"添加一个远程视频流->failed"
,
err
);
});
...
...
@@ -117,7 +117,7 @@ class WebRtcApe extends Emiter {
this
.
client
.
on
(
'stream-subscribed'
,
(
evt
)
=>
{
let
stream
=
evt
.
stream
;
if
(
stream
){
loger
.
log
(
"获取远程视频流成功: "
+
stream
.
getId
());
loger
.
log
(
"获取远程视频流成功: "
+
stream
.
getId
()
,
new
Date
().
getTime
()
);
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.remoteVideoWidth}px;height:${this.remoteVideoHeight}px;"
><
/div>`
;
if
(
GlobalConfig
.
getUserRoleFromeNodeId
(
stream
.
getId
())
==
ApeConsts
.
invisible
){
//显示隐藏用户
...
...
@@ -235,7 +235,7 @@ class WebRtcApe extends Emiter {
}
this
.
localStream
.
init
(()
=>
{
let
viewName
=
this
.
localViewId
.
replace
(
"#"
,
""
);
loger
.
log
(
"webRtc->推流->"
,
viewName
);
loger
.
log
(
"webRtc->推流->"
,
viewName
,
new
Date
().
getTime
()
);
this
.
localStream
.
play
(
viewName
);
this
.
client
.
publish
(
this
.
localStream
,
(
err
)
=>
{
loger
.
log
(
"webRtc->推流失败: "
+
err
);
...
...
@@ -243,28 +243,31 @@ class WebRtcApe extends Emiter {
GlobalConfig
.
openMicrophones
=
0
;
this
.
isPublish
=
false
;
});
this
.
isPublish
=
true
;
GlobalConfig
.
openCamera
=
EngineUtils
.
creatTimestamp
();
GlobalConfig
.
openMicrophones
=
GlobalConfig
.
openCamera
;
this
.
_emit
(
MessageTypes
.
USER_DEVICE_STATUS_CHAANGE
,
{
nodeId
:
GlobalConfig
.
nodeId
,
userRole
:
GlobalConfig
.
userRole
,
userName
:
GlobalConfig
.
userName
,
userId
:
GlobalConfig
.
userId
,
openCamera
:
GlobalConfig
.
openCamera
,
openMicrophones
:
GlobalConfig
.
openMicrophones
this
.
client
.
on
(
'stream-published'
,
(
evt
)
=>
{
loger
.
log
(
"webRtc->推流成功->"
,
new
Date
().
getTime
());
this
.
isPublish
=
true
;
GlobalConfig
.
openCamera
=
EngineUtils
.
creatTimestamp
();
GlobalConfig
.
openMicrophones
=
GlobalConfig
.
openCamera
;
this
.
_emit
(
MessageTypes
.
USER_DEVICE_STATUS_CHAANGE
,
{
nodeId
:
GlobalConfig
.
nodeId
,
userRole
:
GlobalConfig
.
userRole
,
userName
:
GlobalConfig
.
userName
,
userId
:
GlobalConfig
.
userId
,
openCamera
:
GlobalConfig
.
openCamera
,
openMicrophones
:
GlobalConfig
.
openMicrophones
});
});
},
(
err
)
=>
{
loger
.
warn
(
"webRtc->推流->本地流开启失败"
,
err
);
this
.
isPublish
=
false
;
this
.
_emit
(
MessageTypes
.
WEB_RTC_PUBLISH_FAILED
,
err
);
});
}
unpublish
()
{
clearTimeout
(
this
.
rePublishDelay
);
loger
.
log
(
"webRtc->停止推流 "
);
loger
.
log
(
"webRtc->停止推流 "
,
new
Date
().
getTime
()
);
if
(
!
this
.
client
||!
this
.
localStream
)
{
return
;
}
...
...
请
注册
或
登录
后发表评论