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
f737b7356d61e09c6759bf665a5fc7b55bec28d6
f737b735
1 parent
56e03988
1.设webRtc自己视图和远程视图的布局和样式设置;2.处理本地视图被翻转的问题;
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
21 行增加
和
6 行删除
src/EngineEntrance.js
src/apes/WebRtcApe.js
src/EngineEntrance.js
查看文件 @
f737b73
...
...
@@ -62,7 +62,7 @@ export default class MessageEntrance extends Emiter {
constructor
()
{
super
();
//sdk 信息
GlobalConfig
.
sdkVersion
=
"v2.
4.4.20170908
"
;
GlobalConfig
.
sdkVersion
=
"v2.
5.5.20170914
"
;
loger
.
warn
(
"sdkVersion:"
+
GlobalConfig
.
sdkVersion
);
//设置
...
...
src/apes/WebRtcApe.js
查看文件 @
f737b73
...
...
@@ -125,21 +125,22 @@ class WebRtcApe extends Emiter {
if
(
GlobalConfig
.
getUserRoleFromeNodeId
(
stream
.
getId
())
==
ApeConsts
.
invisible
){
//把远程视频添加到监课列表
loger
.
log
(
"获取远程视频流成功->监课:"
+
stream
.
getId
(),
new
Date
().
getTime
());
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.invisibleVideoWidth}px;height:${this.invisibleVideoHeight}px;"
><
/div>`
;
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.invisibleVideoWidth}px;height:${this.invisibleVideoHeight}px;
float: left;margin-right: 1px;
"
><
/div>`
;
$
(
this
.
invisibleViewId
).
append
(
viewDiv
);
}
else
if
(
GlobalConfig
.
getUserRoleFromeNodeId
(
stream
.
getId
())
==
ApeConsts
.
host
){
//把远程视图添加到老师列表
loger
.
log
(
"获取远程视频流成功->老师:"
+
stream
.
getId
(),
new
Date
().
getTime
());
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.hostRemoteVideoWidth}px;height:${this.hostRemoteVideoHeight}px;"
><
/div>`
;
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.hostRemoteVideoWidth}px;height:${this.hostRemoteVideoHeight}px;
float: left;margin-right: 1px;
"
><
/div>`
;
$
(
this
.
hostRemoteViewId
).
append
(
viewDiv
);
}
else
{
//把视图添加到学生列表
loger
.
log
(
"获取远程视频流成功->学生:"
+
stream
.
getId
(),
new
Date
().
getTime
());
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.normalRemoteVideoWidth}px;height:${this.normalRemoteVideoHeight}px;"
><
/div>`
;
let
viewDiv
=
`
<
div
id
=
"${this.xdyRemote + stream.getId()}"
style
=
"width:${this.normalRemoteVideoWidth}px;height:${this.normalRemoteVideoHeight}px;
float: left;margin-right: 1px;
"
><
/div>`
;
$
(
this
.
normalRemoteViewId
).
append
(
viewDiv
);
}
//播放视频
try
{
$
(
"bar_"
+
stream
.
getId
()).
hide
();
stream
.
play
(
this
.
xdyRemote
+
stream
.
getId
());
}
catch
(
err
){
...
...
@@ -252,7 +253,19 @@ class WebRtcApe extends Emiter {
return
;
}
this
.
localStream
.
init
(()
=>
{
let
viewName
=
this
.
localViewId
.
replace
(
"#"
,
""
);
//let viewName = this.localViewId.replace("#", "");
let
viewName
=
'localVideoBox_'
+
this
.
uid
;
let
videoBox
=
document
.
createElement
(
"div"
);
videoBox
.
id
=
viewName
;
videoBox
.
style
.
width
=
this
.
localVideoWidth
+
'px'
;
videoBox
.
style
.
height
=
this
.
localVideoHeight
+
'px'
;
videoBox
.
style
.
float
=
'left'
;
videoBox
.
style
.
marginRight
=
"1px"
;
$
(
this
.
localViewId
).
prepend
(
videoBox
);
//自己的视图往前添加
$
(
"#"
+
viewName
).
css
(
"transform"
,
'rotateY(180deg)'
);
loger
.
log
(
"webRtc->推流->"
,
viewName
,
new
Date
().
getTime
());
this
.
localStream
.
play
(
viewName
);
this
.
client
.
publish
(
this
.
localStream
,
(
err
)
=>
{
...
...
@@ -293,7 +306,9 @@ class WebRtcApe extends Emiter {
loger
.
log
(
"webRtc->停止推流->失败"
+
err
);
});
this
.
localStream
.
close
();
$
(
this
.
localViewId
).
html
(
""
);
//$(this.localViewId).html("");
$
(
'#localVideoBox_'
+
this
.
uid
).
remove
();
this
.
isPublish
=
false
;
GlobalConfig
.
openCamera
=
0
;
GlobalConfig
.
openMicrophones
=
0
;
...
...
请
注册
或
登录
后发表评论