Mark Kramer
Mark Kramer

Reputation: 3214

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?

Upvotes: 54

Views: 213749

Answers (10)

Marcos J.D Junior
Marcos J.D Junior

Reputation: 317

2021 here is my answer that works.

https://youtube.com/embed/ZkTzXrczk5M?vq=hd720p;feature=oembed&controls=0&hd=1&modestbranding=1&autohide=1&showinfo=0        

The secret is in placing a "p" e.g. ?vq=hd720p not ?vq=hd720, after your desired resolution on the of the src.

Upvotes: 9

Vivek Sampara
Vivek Sampara

Reputation: 457

Youtube doesn't support playback quality anymore

Youtube doesn't support playback quality anymore

Upvotes: 10

TrySpace
TrySpace

Reputation: 2460

(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.

Upvotes: 113

rcz
rcz

Reputation: 211

None of the above solutions seem to work if the width/height is less than the line resolution of quality you select. For example, the following doesn't work for me in Chrome:

<iframe width="720" height="480" src="//youtube.com/embed/hUezoHa1ZF4?autoplay=true&rel=0&vq=hd720" frameborder="0" allowfullscreen></iframe>

I want to show the high quality video, but not use up 1280 x 720 pixels on the webpage.

When I go to youtube itself, playing 720p video in a 720x480 window looks better than 480p at the same size. I want to play 720p in a 720x480 window (downsampled better quality). There is no good solution yet afaik.

Upvotes: 3

Brian Armstrong
Brian Armstrong

Reputation: 19863

The first example below does not work for me, but the second one does (in Chrome).

<iframe width="720" height="405" src="//www.youtube.com/embed/GX_c566xYcQ?rel=0&vq=hd1080" frameborder="0" allowfullscreen="1"></iframe>
<iframe width="720" height="405" src="//youtube.com/v/IplDUxTQxsE?rel=0&vq=hd1080" frameborder="0" allowfullscreen="1"></iframe>

I believe the first one uses the new HTML5 youtube player whereas the bottom one (which works) uses the older flash player. However, the second one doesn't seem to load correctly in Safari/Firefox etc so probably not usable.

Upvotes: 4

Mob
Mob

Reputation: 11098

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

Upvotes: 24

user3053317
user3053317

Reputation: 1

Use this, it works 100% _your_videocode?rel=0&vq=hd1080"

Upvotes: 0

t1gor
t1gor

Reputation: 1292

I've managed to get this working by the following fix:

//www.youtube.com/embed/_YOUR_VIDEO_CODE_/?vq=hd720

You video should have the hd720 resolution to do so.

I was using the embedding via iframe, BTW. Hope someone will find this helpful.

Upvotes: 6

whatever61
whatever61

Reputation: 79

In case you're still wondering how to do it, then add: &feature=youtu.be&hd=1 Actually now I checked, this works only when you're sending the URL to someone else, not on embed.

Upvotes: 2

Costantin Busuioceanu
Costantin Busuioceanu

Reputation: 91

This is an embed example of video played in HD 1080.

<iframe width="560" height="315" src="http://youtube.com/v/IplDUxTQxsE&vq=hd1080" frameborder="0" allowfullscreen="1"></iframe>

Let's break apart the code:http://youtube.com/v/ video_id &vq=hd1080

Video id for that video: IplDUxTQxsE you will see this type of random code in the link of every YouTube video.

So far so good, this trick works for playing full HD videos directly on webpages!

You can change the quality to 720 too. &vq=hd720

Upvotes: 8

Related Questions