auto poster for video
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user