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
05a52909
Commit
05a52909
authored
May 24, 2024
by
李纪文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 视频回放展示优化
parent
1ad946bf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
25 deletions
+40
-25
index.js
packages/base-components/VmsVideo/src/apis/index.js
+1
-1
缺省页.png
packages/base-components/VmsVideo/src/assets/缺省页.png
+0
-0
dmeo3.tsx
packages/base-components/VmsVideo/src/demos/dmeo3.tsx
+4
-3
index.js
...base-components/VmsVideo/src/recVideo/hkh5player/index.js
+33
-19
index.js
packages/base-components/VmsVideo/src/recVideo/index.js
+2
-2
No files found.
packages/base-components/VmsVideo/src/apis/index.js
View file @
05a52909
...
@@ -37,7 +37,7 @@ export function controlSlim(data) {
...
@@ -37,7 +37,7 @@ export function controlSlim(data) {
// 获取isc ws回看流
// 获取isc ws回看流
export
function
hiswsUrl
(
data
)
{
export
function
hiswsUrl
(
data
)
{
return
request
({
return
request
({
url
:
`
${
baseURI
}${
CommonPath
}
/
PandaCore/GateWay/
pandavms/camera/isc/hiswsurl`
,
url
:
`
${
baseURI
}${
CommonPath
}
/pandavms/camera/isc/hiswsurl`
,
method
:
REQUEST_METHOD_POST
,
method
:
REQUEST_METHOD_POST
,
data
,
data
,
});
});
...
...
packages/base-components/VmsVideo/src/assets/缺省页.png
View replaced file @
1ad946bf
View file @
05a52909
44.1 KB
|
W:
|
H:
15.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
packages/base-components/VmsVideo/src/demos/dmeo3.tsx
View file @
05a52909
...
@@ -13,12 +13,13 @@ const Demo2 = (props) => {
...
@@ -13,12 +13,13 @@ const Demo2 = (props) => {
},
},
VideoInfo
:
{
VideoInfo
:
{
id
:
'
FB4FAC6B
-4
AC1
-4
EE6
-8133-
A613098F5AEF
',
id
:
'
FB4FAC6B
-4
AC1
-4
EE6
-8133-
A613098F5AEF
',
beginTime
:
'2024-05-2
0
00:00:00',
beginTime
:
'2024-05-2
4
00:00:00',
endTime
:
'2024-05-2
0
23:59:59',
endTime
:
'2024-05-2
4
23:59:59',
playTime
:
'2024-05-2
0
06:00:00',
playTime
:
'2024-05-2
4
06:00:00',
hoursRuler
:
24,
hoursRuler
:
24,
},
},
ProgressBar
:
{
strokeColor
:
'
red
',
textColor
:
'
red
'
},
ProgressBar
:
{
strokeColor
:
'
red
',
textColor
:
'
red
'
},
EmptyIcon
:
'',
}}
}}
ref=
{
jessibuca
}
ref=
{
jessibuca
}
/>
/>
...
...
packages/base-components/VmsVideo/src/recVideo/hkh5player/index.js
View file @
05a52909
...
@@ -22,7 +22,7 @@ const HKh5player = (props, ref) => {
...
@@ -22,7 +22,7 @@ const HKh5player = (props, ref) => {
const
IS_MOVE_DEVICE
=
document
.
body
.
clientWidth
<
992
;
// 是否移动设备
const
IS_MOVE_DEVICE
=
document
.
body
.
clientWidth
<
992
;
// 是否移动设备
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'hk-h5-player-view'
);
const
prefixCls
=
getPrefixCls
(
'hk-h5-player-view'
);
const
{
VideoInfo
=
{},
JessibucaObj
,
ProgressBar
}
=
props
;
const
{
VideoInfo
=
{},
JessibucaObj
,
ProgressBar
,
EmptyIcon
=
''
}
=
props
;
const
videoID
=
VideoInfo
?.
id
||
`VIDEO_PLAY_BACK`
;
const
videoID
=
VideoInfo
?.
id
||
`VIDEO_PLAY_BACK`
;
const
[
showId
,
setShowId
]
=
useState
(
VideoInfo
?.
id
||
''
);
//视频ID
const
[
showId
,
setShowId
]
=
useState
(
VideoInfo
?.
id
||
''
);
//视频ID
const
[
peridos
,
setPeridos
]
=
useState
([]);
//可播放视频时间段
const
[
peridos
,
setPeridos
]
=
useState
([]);
//可播放视频时间段
...
@@ -100,7 +100,10 @@ const HKh5player = (props, ref) => {
...
@@ -100,7 +100,10 @@ const HKh5player = (props, ref) => {
if
(
!
id
)
return
setShowId
(
null
);
if
(
!
id
)
return
setShowId
(
null
);
const
hoursPerRuler
=
calculateHours
(
beginTime
,
endTime
)
||
24
;
const
hoursPerRuler
=
calculateHours
(
beginTime
,
endTime
)
||
24
;
const
stTimes
=
moment
(
beginTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
const
stTimes
=
moment
(
beginTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
const
edTimes
=
moment
(
endTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
const
edTimes
=
moment
(
new
Date
()).
valueOf
()
>=
moment
(
endTime
).
valueOf
()
?
moment
(
endTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
moment
(
new
Date
()).
format
(
'YYYY-MM-DD HH:mm:ss'
);
const
params
=
{
const
params
=
{
id
:
id
,
id
:
id
,
startTime
:
stTimes
,
startTime
:
stTimes
,
...
@@ -120,22 +123,29 @@ const HKh5player = (props, ref) => {
...
@@ -120,22 +123,29 @@ const HKh5player = (props, ref) => {
},
},
]);
]);
setLoading
(
true
);
setLoading
(
true
);
hiswsUrl
(
params
).
then
((
res
)
=>
{
hiswsUrl
(
params
)
setLoading
(
false
);
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
setLoading
(
false
);
const
data
=
res
?.
data
||
''
;
if
(
res
.
code
===
200
)
{
const
url
=
data
.
split
(
'?'
)[
0
].
split
(
'/'
).
pop
()
||
''
;
const
data
=
res
?.
data
||
''
;
if
(
!
url
)
return
setShowId
(
null
);
const
url
=
data
.
split
(
'?'
)[
0
].
split
(
'/'
).
pop
()
||
''
;
videoUrl
.
current
=
url
;
if
(
!
url
)
return
setShowId
(
null
);
getVideoReplayInfo
({
videoUrl
.
current
=
url
;
beginTime
:
playTimestamp
?
moment
(
playTimestamp
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
stTimes
,
getVideoReplayInfo
({
endTime
:
edTimes
,
beginTime
:
playTimestamp
});
?
moment
(
playTimestamp
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
else
{
:
stTimes
,
endTime
:
edTimes
,
});
}
else
{
setShowId
(
null
);
message
.
warn
(
res
.
msg
);
}
})
.
catch
((
err
)
=>
{
setLoading
(
false
);
setShowId
(
null
);
setShowId
(
null
);
message
.
warn
(
res
.
msg
);
});
}
});
};
};
// 获取计算小时数
// 获取计算小时数
...
@@ -462,7 +472,7 @@ const HKh5player = (props, ref) => {
...
@@ -462,7 +472,7 @@ const HKh5player = (props, ref) => {
if (recordInfo && playOffset) {
if (recordInfo && playOffset) {
setPlayTimestamp(time);
setPlayTimestamp(time);
} else {
} else {
message.warn('当前时间节点
没有视频可以播放哦
!');
message.warn('当前时间节点
超出回放时间区间
!');
}
}
}}
}}
timecell={peridos}
timecell={peridos}
...
@@ -523,7 +533,11 @@ const HKh5player = (props, ref) => {
...
@@ -523,7 +533,11 @@ const HKh5player = (props, ref) => {
const emptyBoxRender = () => {
const emptyBoxRender = () => {
return (
return (
<div className={classNames(`
$
{
prefixCls
}
-
empty
`)}>
<div className={classNames(`
$
{
prefixCls
}
-
empty
`)}>
<Empty image={empty_icon} theme={'dark'} description={'咦~暂时没有查询到视频回放信息呢~'} />
<Empty
image={EmptyIcon || empty_icon}
theme={'dark'}
description={'咦~暂时没有查询到视频回放信息呢~'}
/>
</div>
</div>
);
);
};
};
...
...
packages/base-components/VmsVideo/src/recVideo/index.js
View file @
05a52909
...
@@ -13,7 +13,7 @@ const RecVideo = (props, ref) => {
...
@@ -13,7 +13,7 @@ const RecVideo = (props, ref) => {
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'rec-video-view'
);
const
prefixCls
=
getPrefixCls
(
'rec-video-view'
);
const
{
VideoInfo
,
JessibucaObj
,
ProgressBar
}
=
props
;
const
{
VideoInfo
,
JessibucaObj
,
ProgressBar
,
EmptyIcon
=
''
,
}
=
props
;
const
jessibuca
=
useRef
(
null
);
const
jessibuca
=
useRef
(
null
);
const
[
hoursRuler
,
setHoursRuler
]
=
useState
(
VideoInfo
.
hoursRuler
||
24
);
const
[
hoursRuler
,
setHoursRuler
]
=
useState
(
VideoInfo
.
hoursRuler
||
24
);
const
[
showId
,
setShowId
]
=
useState
(
null
);
//视频ID
const
[
showId
,
setShowId
]
=
useState
(
null
);
//视频ID
...
@@ -196,7 +196,7 @@ const RecVideo = (props, ref) => {
...
@@ -196,7 +196,7 @@ const RecVideo = (props, ref) => {
)
:
(
)
:
(
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-empty`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-empty`
)}
>
<
Empty
<
Empty
image
=
{
empty_icon
}
image
=
{
EmptyIcon
||
empty_icon
}
theme
=
{
'dark'
}
theme
=
{
'dark'
}
description
=
{
'咦~暂时没有查询到视频回放信息呢~'
}
description
=
{
'咦~暂时没有查询到视频回放信息呢~'
}
/
>
/
>
...
...
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