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
075e3965
Commit
075e3965
authored
Jul 11, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 视频组件萤石云视频自适应大小节流
parent
6a317cba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
index.jsx
packages/base-components/VmsVideo/src/index.jsx
+9
-2
No files found.
packages/base-components/VmsVideo/src/index.jsx
View file @
075e3965
...
@@ -117,9 +117,12 @@ const Video = (props, ref) => {
...
@@ -117,9 +117,12 @@ const Video = (props, ref) => {
getToken
();
getToken
();
}
}
let
resizeTime
=
null
;
const
resizeObserver
=
new
ResizeObserver
(()
=>
{
const
resizeObserver
=
new
ResizeObserver
(()
=>
{
PlayersA
&&
if
(
resizeTime
)
clearTimeout
(
resizeTime
);
PlayersA
.
reSize
(
refs
?.
current
?.
offsetWidth
||
952
,
refs
?.
current
?.
offsetHeight
||
500
);
resizeTime
=
setTimeout
(()
=>
{
PlayersA
&&
PlayersA
.
reSize
(
refs
?.
current
?.
offsetWidth
||
952
,
refs
?.
current
?.
offsetHeight
||
500
);
},
300
);
});
});
refs
?.
current
&&
resizeObserver
.
observe
(
refs
.
current
);
refs
?.
current
&&
resizeObserver
.
observe
(
refs
.
current
);
...
@@ -135,6 +138,10 @@ const Video = (props, ref) => {
...
@@ -135,6 +138,10 @@ const Video = (props, ref) => {
}
catch
(
e
)
{}
}
catch
(
e
)
{}
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
PlayersA
=
null
;
PlayersA
=
null
;
if
(
resizeTime
)
{
clearTimeout
(
resizeTime
);
resizeTime
=
null
;
}
if
(
document
.
getElementById
(
`
${
keyID
}
`
))
document
.
getElementById
(
`
${
keyID
}
`
).
innerHTML
=
''
;
if
(
document
.
getElementById
(
`
${
keyID
}
`
))
document
.
getElementById
(
`
${
keyID
}
`
).
innerHTML
=
''
;
}
catch
(
e
)
{}
}
catch
(
e
)
{}
};
};
...
...
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