I have a react <video> component. And I have added autoplay as an attribute.
<video autoplay muted src="/vids/vid.mp4">
And not working. But when I set autoplay="true" it starts working.
<video autoplay="true" muted src="/vids/vid.mp4"> //Works
why is it for a boolean attribute, only putting autoplay is not working on react? on other occasions for attributes like hidden it works.
Why is this happening? Which one is the correct way to specify boolean attribute?
I had the same problem with the autoplay attribute with React. You want to use autoPlay instead. You should then just be able to use it like this:
<video autoPlay muted src="/vids/vid.mp4">