Simple example of how to actually use picture tag features for poster #8947
phloxic
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Video.js v8.x puts the poster image in a
picture
tag inside thePosterImage
component. So far, however, the poster option, nevermind the poster attribute, only allows for a string containing a specific URL, and then thepicture
tag contains only a 'standard'img
tag.This is a sketch of how to use
picture
tag capabilities for the Video.js poster. It is self-contained, i.e., no additional scripts to determine the image type. So it can be extended with otherpicture
features by simply tweaking the tag's content.At page load, the
picture
is a child of thevideo[-js]
tag. Use of JavaScript is limited to moving thepicture
into thePosterImage
component and then settingposter
by reading thecurrentSrc
picked by the browser.Beta Was this translation helpful? Give feedback.
All reactions