Adding a background video with React?

import sample from './sample.mp4';

<video className="videoTag" autoPlay loop muted>
    <source src={sample} type="video/mp4" />
</video>

Thank the note that ‘autoplay’ should be changed to ‘autoPlay’ from Mr_Antivius.
This is an alternative way to play the video in React. It works for me. Remember that the sample.mp4 file is in the same directory of the JS file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)