nealrs nealrs - 2 months ago 9
HTML Question

Can i use a svg as the poster for html 5 video?

I'm building a streaming video experience (web based, not native) for desktop & mobile.

The

<video>
element supports a thumbnail / poster image (if omitted, it uses the first frame of video. Since I can't use
src set
or whatever to ensure a reasonably sized image is used, can I use an svg instead (assuming appropriate aspect ratio)?

Answer

<video controls width="640" height="480" poster="https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg">
    <source src="http://techslides.com/demos/sample-videos/small.mp4">
</video>

I believe that this configuration does work.

Comments