video - Fix YouTube black sidebars in iframe 853 by 480 -
video - Fix YouTube black sidebars in iframe 853 by 480 -
when embeding hd video youtube using generated iframe, notice 2 black sidebars added player when utilize preset.
<iframe width="853" height="480" src="http://www.youtube...
for excample in; http://www.villagedurable.org/tv if insert iframe dimensions 640*360 or utilize hd size 1280x720 2 sidebars desappear allowing beautiful layout.
it's true both 640*360 , 1280x720 utilize aspect ration of 1.777777777777778, multiplying 480 1.777777777777778 gives 853.3333333333333 which, think makes youtube add together nasty black bars :(
after much fuss found solution.
apparently because 853x480 not same ratio 16/9, player doesn't have controls automatically fade away. video controls take 30 pixels of wide, leaving 450 pixels height. maintain aspect ratio, video shrunk , hence black borders (or black sidebars, whatever phone call them).
the solution utilize 853x510 dimensions in iframe:
<iframe width="853" height="510" ... />
imho, bug on youtube's end, since offer 853x480 preset resolution in 'embed code' selection.
from http://www.h3xed.com/web-and-internet/embedding-youtube-videos-in-hd:
of 4 resolution options youtube shows on embed dialog (for 16 x 9 videos), 853 x 480 1 doesn't load in player fade-away controls. because 16 x 9 not go 853 x 480 evenly. you'll notice there black bars on sides of 16 x 9 video. play 853 x 480 video in embedded youtube player, you'll want take 853 x 510 width , height in embed code.
video iframe youtube size embed
Comments
Post a Comment