The easiest way to play videos in HTML, is to use YouTube.
To play your video on a web page, do the following: Upload the video to YouTube Take a note of the video id Define an <iframe> element in your web page Let the src attribute point to the video URL Use the width and height attributes to specify the dimension of the player Add any other parameters to the URL (see below)
Add mute=1 after autoplay=1 to let your video start playing automatically (but muted).
<iframe> element pointing to https://www.youtube.com/embed/VIDEO_ID and append the parameters ?autoplay=1&mute=1&controls=0 to the URL.
<!DOCTYPE html> <html> <head> <title>YouTube Embed Practice - Part 1</title> </head> <body> <h2>Featured Video (Autoplay & Hidden Controls)</h2> <iframe width="560" height="315" src="https://www.youtube.com/embed/kUMe1FH4CHE?autoplay=1&mute=1&controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe> </body> </html>
autoplay=1: Tells the YouTube player to start playing the video automatically when loaded.mute=1: Mutes the audio. Web browsers block unmuted autoplay to prevent unwanted noise for users.controls=0: Hides the default play/pause buttons, volume slider, and video seek bar.loop=1 with the playlist=VIDEO_ID parameter set to the exact same video ID in the source URL string.
<!DOCTYPE html> <html> <head> <title>YouTube Embed Practice - Part 2</title> </head> <body> <h2>Continuous Looping Video Player</h2> <iframe width="560" height="315" src="https://www.youtube.com/embed/UB1O30fR-EE?loop=1&playlist=UB1O30fR-EE&controls=1" title="YouTube Looping Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen> </iframe> </body> </html>
UB1O30fR-EE).loop=1 and playlist=UB1O30fR-EE ensures that when this specific coding video finishes, YouTube restarts it automatically.