Is it possible to add alt attribute for the poster of the video?
Just because it is an image does not imply that it will behave like an <img>
tag. In fact in this case it is not even a tag, and there would be no way to do that.
Nesting <img>
inside <video>
would not have the desired effect, since the browser will interpret it only if it doesn't know about <video>
tag at all (i.e. an old browser), and this is not the demographic you are shooting for.
What are you attempting to do here?
If you are adding alt
to achieve some sort of search engine optimisation, then you should only do so in the event that search engine will actually recognise it as legitimate text to index and identify with the image in question. In this case it may very well be a good idea to add an <img>
inside your <video>
as so:
<video poster='image.png'>
<source .../>
<img src='image.png' alt='Image showing a cute cat' />
Unfortunately your browser is too old.
</video>
If, on the other hand, you are attempting to do this to enable screen-reader to understand what is displayed there; then you are in much more trouble, since they are usually smarter than most search engines, and will often read text under the cursor. The approach above will not work, since <img>
will not be displayed at all. I don't know enough about screen readers to help you further.