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
b3f38373
Commit
b3f38373
authored
May 24, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改视频回放
parent
9a116785
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
index.js
...base-components/VmsVideo/src/recVideo/hkh5player/index.js
+5
-2
No files found.
packages/base-components/VmsVideo/src/recVideo/hkh5player/index.js
View file @
b3f38373
...
...
@@ -23,7 +23,7 @@ const HKh5player = (props, ref) => {
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'hk-h5-player-view'
);
const
{
VideoInfo
=
{},
JessibucaObj
,
ProgressBar
,
EmptyIcon
=
''
}
=
props
;
const
videoID
=
VideoInfo
?.
id
||
`VIDEO_PLAY_BACK`
;
const
videoID
=
VideoInfo
?.
id
||
`VIDEO_PLAY_BACK
${
Date
.
now
().
toString
(
36
)}
`
;
const
[
showId
,
setShowId
]
=
useState
(
VideoInfo
?.
id
||
''
);
//视频ID
const
[
peridos
,
setPeridos
]
=
useState
([]);
//可播放视频时间段
const
[
hoursRuler
,
setHoursRuler
]
=
useState
(
VideoInfo
.
hoursRuler
||
24
);
...
...
@@ -46,12 +46,15 @@ const HKh5player = (props, ref) => {
const
player
=
useRef
(
null
);
useEffect
(()
=>
{
setShowId
(
props
?.
VideoInfo
?.
id
||
''
);
setHoursRuler
(
props
?.
VideoInfo
.
hoursRuler
||
24
);
setPlayTimestamp
(
props
?.
VideoInfo
?.
playTime
?
moment
(
props
?.
VideoInfo
?.
playTime
).
valueOf
()
:
null
);
changeReplayCfg
?.();
// 设置播放容器的宽高并监听窗口大小变化
window
.
addEventListener
(
'resize'
,
resizeVideo
);
return
()
=>
{
window
.
removeEventListener
(
'resize'
,
resizeVideo
);
player
.
current
?.
JS_
StopRealPlayAll
?.();
player
.
current
?.
JS_
Destroy
?.();
player
.
current
=
null
;
};
// eslint-disable-next-line react-hooks/exhaustive-deps
...
...
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