Reputation: 2076
I've been trying to get a way of showing both gif
s and video
s (.mp4
, .ogg
, .webm
) within the same tag.
So, if it is within a <video>
tag I would only change the source or the <source>
to a gif
or video
and show it accordingly.
Unfortunately I'm not finding anything consensual that would allow doing this.
Does anyone got a simple solution before I move on to the hardest ones?
Upvotes: 6
Views: 23421
Reputation: 980
You can use poster
attribute in <video>
tag to show gif files. but it is not a complete solution, because you can not use them (video and gif) together.
Upvotes: 2
Reputation: 60593
According to MDN
The HTML
<video>
element is used to embed video content. It may contain several video sources, represented using thesrc
attribute or the element; the browser will choose the most suitable one.
Therefore gif
- not a video content - is NOT an option to be used in <video>
tag
Here is the list of supported formats for <video>
and <audio>
Upvotes: 6