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