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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Video.js v8.x puts the poster image in a
picturetag inside thePosterImagecomponent. So far, however, the poster option, nevermind the poster attribute, only allows for a string containing a specific URL, and then thepicturetag contains only a 'standard'imgtag.This is a sketch of how to use
picturetag 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 otherpicturefeatures by simply tweaking the tag's content.At page load, the
pictureis a child of thevideo[-js]tag. Use of JavaScript is limited to moving thepictureinto thePosterImagecomponent and then showing the'PosterImage'component. Settingposter()using the picture'simgtag'scurrentSrcis possible, but then picture capabilities like dynamic image selection are lost.Beta Was this translation helpful? Give feedback.
All reactions