Using HTML5 video on a React App in such a way that it will work on all Mobile platforms (iOS, Android, MS etc.), esp, making the auto start working at page load.
I'm trying to use HTML5 video in my React App the following way:
But this will not auto start when the page loads the first time. But when I visit another page and come back to the home page, the video works. Any idea what's happening? Any suggestions to make it work properly and esp on mobile devices will be appreciated.
1-always add a poster to your video so at least user will see an image.
2-you need to provide several video format in the source because browser can support different format
3-And autoplay will not occurred most of the time because browser policy and user preference (battery life, security, user experience etc)
See ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#Attributes
Open in new window