auto poster for video

This commit is contained in:
2022-07-09 09:45:27 +08:00
parent 3769b15542
commit 04aabf4d84

View File

@@ -1,4 +1,5 @@
function Video({ src }) { function Video({ src }) {
const poster = src.substr(0, src.indexOf('.mp4')) + '_poster.jpg';
return ( return (
<p <p
style={{ style={{
@@ -7,7 +8,9 @@ function Video({ src }) {
> >
<video <video
src={src} src={src}
poster={poster || ""}
controls controls
preload="none"
width="70%" width="70%"
/> />
</p> </p>