Home > OS >  Video in React.js not autoplaying
Video in React.js not autoplaying

Time:12-14

I've tried a few different fixes but I can't figure out why this video I am using in a react app is not playing. I added the autoplay and muted properties but it still won't play. It works perfectly fine when I run it as pure HTML but not with react. Here is the code:

<video width="518" height="518" loop autoplay preload="auto" playsinline="true" style={{maxWidth: "518px"}} muted>
    <source src="https://media.tenor.com/f02cT4A-dC4AAAPo/speechless-shocked.mp4" type="video/mp4" />
      <source src="https://media.tenor.com/f02cT4A-dC4AAAPs/speechless-shocked.webm" type="video/webm" />
      Your browser does not support video.
  </video>

CodePudding user response:

autoPlay on video element, is in camelcase in ReactJS

  • Related