I have a video run in the background in my react app. It works perfectly and auto-plays on page load.
here is the code JSX I have used.
<video
autoPlay
loop
style={{
backgroundImage: `url(${topVideoImage})`,
}}
muted
playsInline
>
<source type="video/mp4" src={topVideo} />
</video>
It doesn't auto play after I use react-snap
.
my package.json looks like this:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"postbuild": "react-snap",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
It works after I remove "postbuild": "react-snap",
. How can I solve (autoplay the video on load) this without removing react-snap
?