Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
8f7e1eb3
Commit
8f7e1eb3
authored
Feb 19, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 云台控制
parent
fa7e03e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
App.jsx
packages/base-components/VmsVideo/src/App.jsx
+16
-12
CloudPlate.less
...s/base-components/VmsVideo/src/components/CloudPlate.less
+8
-8
No files found.
packages/base-components/VmsVideo/src/App.jsx
View file @
8f7e1eb3
...
...
@@ -12,6 +12,7 @@ class App extends React.Component {
this
.
showOperateBtns
=
true
;
this
.
$container
=
null
;
this
.
forceNoOffscreen
=
false
;
this
.
domRef
=
React
.
createRef
();
this
.
state
=
{
isPlaying
:
false
,
...
...
@@ -130,17 +131,20 @@ class App extends React.Component {
}
appendControl
()
{
const
parentElement
=
document
.
getElementsByClassName
(
"jessibuca-controls-right"
)[
0
];
const
childElement
=
document
.
createElement
(
"div"
);
childElement
.
className
=
'jessibuca-control'
;
const
childChildElement
=
document
.
createElement
(
"i"
);
childElement
.
addEventListener
(
"click"
,
()
=>
{
// 点击 childElement 时触发的代码
this
.
setState
({
isShowControl
:
!
this
.
state
.
isShowControl
});
});
// 将子元素添加到子元素的子元素中
parentElement
.
insertBefore
(
childElement
,
parentElement
.
firstChild
);
childElement
.
appendChild
(
childChildElement
);
try
{
if
(
!
this
.
domRef
.
current
||
this
.
domRef
.
current
.
getElementsByClassName
(
'jessibuca-control'
).
length
)
return
false
;
const
parentElement
=
this
.
domRef
.
current
.
getElementsByClassName
(
"jessibuca-controls-right"
)[
0
];
const
childElement
=
document
.
createElement
(
"div"
);
childElement
.
className
=
'jessibuca-control'
;
const
childChildElement
=
document
.
createElement
(
"i"
);
childElement
.
addEventListener
(
"click"
,
()
=>
{
// 点击 childElement 时触发的代码
this
.
setState
({
isShowControl
:
!
this
.
state
.
isShowControl
});
});
// 将子元素添加到子元素的子元素中
parentElement
.
insertBefore
(
childElement
,
parentElement
.
firstChild
);
childElement
.
appendChild
(
childChildElement
);
}
catch
(
err
)
{}
}
closeCloudPlate
()
{
...
...
@@ -162,7 +166,7 @@ class App extends React.Component {
);
}
render
()
{
return
<
div
className=
{
style
.
root
}
>
{
this
.
renderCheckedArr
()
}
</
div
>;
return
<
div
className=
{
style
.
root
}
ref=
{
this
.
domRef
}
>
{
this
.
renderCheckedArr
()
}
</
div
>;
}
}
...
...
packages/base-components/VmsVideo/src/components/CloudPlate.less
View file @
8f7e1eb3
.cloud-plate {
position: absolute;
bottom:
38
px;
right:
0
;
bottom:
43
px;
right:
5px
;
width: 278px;
height: 165px;
border-radius: 5px 0px 0px;
background:
rgba(0, 0, 0, 0.75)
;
background:
#000000bf
;
display: flex;
.cloud-right {
...
...
@@ -194,10 +194,10 @@
.close-wrapper {
position: absolute;
right:
10
px;
top:
8
px;
width:
21
px;
height:
21
px;
right:
5
px;
top:
5
px;
width:
18
px;
height:
18
px;
border-radius: 50%;
background: #474a4c;
display: flex;
...
...
@@ -208,7 +208,7 @@
:global {
.anticon-close {
font-size: 1
4
px;
font-size: 1
2
px;
color: #000000;
opacity: 0.6;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment