On sites where you convert a YouTube link to an embedded player (which apparently doesn't include MSO, so I can't put an example directly in this post), can you use 16:9 aspect ratio instead of 4:3? It's much more common these days. Here's an example
-
7so... why all the downvotes?– KipMay 30, 2011 at 16:02
-
1Downvotes here usually mean disagreement, so people probably don't like your proposal.– Kevin JiMay 30, 2011 at 16:58
-
7Yeah.... not sure about the downvotes on this one? Could someone explain? (+1 so it gets back on the homepage)– Jon SeigelMay 30, 2011 at 17:27
-
4Maybe they don't care for widescreen. Maybe you didn't provide a good enough reason. Maybe there's no point. Maybe widescreen isn't as common as you think for those things that are illustrated via YouTube videos.– randomMay 31, 2011 at 19:39
-
The YouTube API will actually give the video ratio, so SE shouldn't have to decide which ratio to use: it should ask YouTube.– TRiGFeb 18, 2015 at 14:43
2 Answers
Starting with the next build, youtube embeds will be 640x385px (25px for the player), a 16:9 ratio.
This won't affect existing posts, since the conversion is done at the time of a save/edit. If you want a post to switch to the new format, simply edit it.
For anyone who would like this, I wrote a Grease Monkey script to fix it. You can find it over on StackApps.
Edit: That StackApps link is dead, unless you have enough rep to view deleted posts. I deleted it because there's no need for it anymore; as noted in accepted answer, they made this change in the StackExchange code.
For anyone interested in the code from a purely academic perspective, here it is:
// ==UserScript==
// @name StackExchange embedded YouTube in 16:9
// @namespace stackexchange
// @description Changes YouTube videos embedded in StackExchange pages to use widescreen format.
// @include http://stackoverflow.com/*
// @include http://meta.stackoverflow.com/*
// @include http://superuser.com/*
// @include http://meta.superuser.com/*
// @include http://serverfault.com/*
// @include http://meta.serverfault.com/*
// @include http://*.stackexchange.com/*
// @author Kip Robinson - http://stackoverflow.com/users/18511/kip
// ==/UserScript==
(function() {
function with_jquery(f) {
var script = document.createElement("script");
script.type = "text/javascript";
script.textContent = "(" + f.toString() + ")(jQuery)";
document.body.appendChild(script);
};
with_jquery(function($) {
var attrs = {width: 640, height: 360};
if($.browser.webkit)
attrs.height = 390; //for some reason, embedded YouTube player uses different settings in Chrome
$('embed[src*="youtube"],embed[src*="youtu.be"]').attr(attrs).parent().css(attrs);
}
);
})();
-
1
-
-
1@DenilsonSá updated with the source code. Although you don't need a browser extension anymore to do this.– KipFeb 18, 2015 at 14:40