Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force youtube embed to start in 720p

There are a few methods suggested for doing this online, but none of them seem to work.

For example:

http://blog.makezine.com/archive/2008/11/youtube-in-720p-hd-viewin.html

That article is about making it start in 720p, but it doesn't even work on their own video.

Does anyone here know how to do it?

like image 751
Mark Kramer Avatar asked Sep 28 '11 11:09

Mark Kramer


People also ask

How do I add quality to YouTube links?

To force a specific video quality during playback, add the VQ parameter to the URL to specifically set the video quality, regardless of the window size. For example, using the code below causes the video to play at 480p by default. (The highest for this particular video.) Notice this URL uses the vq=large parameter.


2 Answers

(This answer was updated, as the previous method using vq isn't recognized anymore.)

Specifying the height of the video will change the quality accordingly. example for html 5;

<iframe style='width:100%; height:800px;' src='https://www.youtube.com/embed/xxxxxxxx'></iframe> 

If you don't want to hardcode the width and height you can add a class to the iframe for css media queries.

Tested on a working server + passes the w3.org nuhtml validator.

like image 106
TrySpace Avatar answered Oct 05 '22 03:10

TrySpace


You can do this by adding a parameter &hd=1 to the video URL. That forces the video to start in the highest resolution available for the video. However you cannot specifically set it to 720p, because not every video has that hd ish.

http://www.youtube.com/watch?v=VIDEO_ID&hd=1

http://code.google.com/apis/youtube/player_parameters.html

UPDATE: as of 2014, hd is deprecated https://developers.google.com/youtube/player_parameters?csw=1#Deprecated_Parameters

like image 32
Mob Avatar answered Oct 05 '22 02:10

Mob