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