The HTML5 video element is an easy and well supported way to play video on your website.
It supports multiple video formats and accepts multiple attributes that can change the behavior.
The above is a video element set to autplay, on loop and muted with a playsinline
attribute:
If you read our camera api post you might remember that we used the video
element there as well. Let’s check some attributes of the video element:
Similar to the audio element the video
element emits some events which we can bind to so we know what the video
is doing.
Video is not playing Video is not seeking
Are you looking to covert videos from different formats as well? You can use
ffmpeg to easily convert
video and audio to multiple formats. For example to go from .mov to .mp4 in your temrinal
you can run:
You can convert .mp4 to .webm by running:
Read more about the video element here.
Check this article
with recommendations on how to replace GIF’s with video.