html5 - HTML 5 Video stretch -
can make video "stretch" width & height of video element? apparentlyby default, video gets scaled & fitted inside video element, proportionally.
thanks
from the spec <video>
:
video content should rendered inside element's playback area such video content shown centered in playback area @ largest possible size fits within it, video content's aspect ratio being preserved. thus, if aspect ratio of playback area not match aspect ratio of video, video shown letterboxed or pillarboxed. areas of element's playback area not contain video represent nothing.
there no provisions stretching video instead of letterboxing it. because stretching gives bad user experience, , of time not intended. images stretched fit default, , because of that, see lots of images badly distorted online, due simple mistake in specifying height , width.
you can achieve stretched effect using css 3 transforms, though aren't standardized or implemented in browsers yet, , ones in implemented, need use vendor prefix such -webkit-
or -moz-
. here's example:
<!doctype html> <style> video { -webkit-transform: scalex(2); -moz-transform: scalex(2); } </style> <video src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv"></video>
Comments
Post a Comment