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
443d79a6
Commit
443d79a6
authored
May 24, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改视频回放
parent
26194513
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
index.js
...base-components/VmsVideo/src/recVideo/hkh5player/index.js
+9
-10
No files found.
packages/base-components/VmsVideo/src/recVideo/hkh5player/index.js
View file @
443d79a6
...
...
@@ -48,10 +48,9 @@ const HKh5player = (props, ref) => {
useEffect
(()
=>
{
setShowId
(
props
?.
VideoInfo
?.
id
||
''
);
setHoursRuler
(
props
?.
VideoInfo
.
hoursRuler
||
24
);
setPlayTimestamp
(
props
?.
VideoInfo
?.
playTime
?
moment
(
props
?.
VideoInfo
?.
playTime
).
valueOf
()
:
null
,
);
changeReplayCfg
?.();
const
playTimes
=
props
?.
VideoInfo
?.
playTime
?
moment
(
props
?.
VideoInfo
?.
playTime
).
valueOf
()
:
null
;
setPlayTimestamp
(
playTimes
);
changeReplayCfg
?.(
playTimes
);
// 设置播放容器的宽高并监听窗口大小变化
window
.
addEventListener
(
'resize'
,
resizeVideo
);
return
()
=>
{
...
...
@@ -96,12 +95,12 @@ const HKh5player = (props, ref) => {
};
// 更改播放配置
const
changeReplayCfg
=
()
=>
{
const
changeReplayCfg
=
(
playTimes
)
=>
{
const
{
beginTime
=
moment
().
format
(
'YYYY-MM-DD 00:00:00'
),
endTime
=
moment
().
format
(
'YYYY-MM-DD 23:59:59'
),
id
=
''
,
}
=
VideoInfo
||
{};
}
=
props
?.
VideoInfo
||
{};
if
(
!
id
)
return
setShowId
(
null
);
const
hoursPerRuler
=
calculateHours
(
beginTime
,
endTime
)
||
24
;
const
stTimes
=
moment
(
beginTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
...
...
@@ -119,7 +118,7 @@ const HKh5player = (props, ref) => {
setHoursRuler
(
hoursPerRuler
);
setMinTimestamp
(
moment
(
stTimes
).
valueOf
());
setMaxTimestamp
(
moment
(
edTimes
).
valueOf
());
setPlayTimestamp
(
playTimes
tamp
?
playTimestamp
:
moment
(
stTimes
).
valueOf
());
setPlayTimestamp
(
playTimes
?
playTimes
:
moment
(
stTimes
).
valueOf
());
setPeridos
([
{
beginTime
:
moment
(
beginTime
).
valueOf
(),
...
...
@@ -261,7 +260,7 @@ const HKh5player = (props, ref) => {
const {
beginTime = moment().format('YYYY-MM-DD 00:00:00'),
endTime = moment().format('YYYY-MM-DD 23:59:59'),
} = VideoInfo || {};
} =
props?.
VideoInfo || {};
const bgTimes = moment(beginTime).format('YYYY-MM-DD HH:mm:ss');
const edTimes = moment(endTime).format('YYYY-MM-DD HH:mm:ss');
player.current?.JS_GetOSDTime?.()?.then(
...
...
@@ -402,7 +401,7 @@ const HKh5player = (props, ref) => {
const {
beginTime = moment().format('YYYY-MM-DD 00:00:00'),
endTime = moment().format('YYYY-MM-DD 23:59:59'),
} = VideoInfo || {};
} =
props?.
VideoInfo || {};
const bgTimes = moment(beginTime).format('YYYY-MM-DD HH:mm:ss');
const edTimes = moment(endTime).format('YYYY-MM-DD HH:mm:ss');
playbackStart({
...
...
@@ -469,7 +468,7 @@ const HKh5player = (props, ref) => {
<div className={classNames(`
$
{
prefixCls
}
-
time
`)}>
{peridos.length ? (
<TimeSlider
key={JSON.stringify(props?.VideoInfo ||
'{}'
)}
key={JSON.stringify(props?.VideoInfo ||
{}
)}
minTimestamp={minTimestamp}
maxTimestamp={maxTimestamp}
hoursPerRuler={hoursRuler || 24}
...
...
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