Force youtube embed to start in 720p - html

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?

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

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

Youtube doesn't support playback quality anymore

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

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.

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.

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.

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.

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.

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

Related

Why is an HTML video tag displaying the video upside down only in Mozilla Firefox?

I have a page that displays multiple videos using html video tags. The code looks like the below snippet:
<video controls="controls" class="vw" name="Video" src="videos/ACS_Video_2b.mp4"></video>
The class is simply a class that dynamically sets the width, height, etc.
The video looks and plays very nicely in all browsers except for Firefox. All of the videos on the website using these tags are upside down in Firefox. I can't seem to find anything online about people having similar problems. In fact, when I go to other websites using identical video tags and video extensions, etc., the video displays perfectly on their site for me in Firefox.
Here is the website with the upside down videos for reference:
http://www.larrykrannich.com/video.html
The videos display upside down locally, on a local server, and hosted on a real server.
Any help would be greatly appreciated.
This is a firefox problem, I have seen that several people have complained over and over about this problem but all to no avail. it only happens when the video is recorded from mobile, firefox doesn't seem to use the camera details to encoded rotation that came along with the mobile video. for the main time you have to figure out a fix for yourself, you can use css transform to rotate the video tag, but one problem with that is that it will rotate the video control with it.
you can use videojs, then add the rotate plugin, you can just google it. it will help rotate for video.
you can do something like this
if ( isfirefox ) {
<video class="video-js vjs-default-skin" controls preload="auto" width="270" height="360" data-setup='{ "plugins": { "zoomoomrotate": { "rotate": "270", "zoom": "1.4" } } }'>
<source src="video-source" type="video/mp4">
</video>
}
also, there is a recent issue in chrome update that compress mobile video as well. still looking for a fix for it
It seems to have something to do with rotation metadata in the video files. The problem can be solved by transcoding and rotating the video. Similar post here
Most likely, you have recorded the video upside down, without realizing it - which can happen, e.g. when using a smartphone-camera.
There are video-players, that auto-correct for such things, which might be, why you didn't realize the video being upside-down.
There is a free Videoplayer called VLC, which you can correct this with by rotating the video.
Get it here and install it, if you don't already have it:
http://www.videolan.org/vlc/
Steps:
Open video in VLC media player
Pause the video, if it's too short to keep running, while you perform the other steps
In the upper menu, navigate as follows:
Tools
Video Effects
In the window, that just opened go to the Geometry-tab and do the following:
Check the box "Transform"
Select "Rotate by 180 degrees"
Your video should now look nice and right side up
To save your changes:
In the upper menu click, navigate as follows:
Media
Convert/Save
Choose, where you want to save the file.
Upload the rotated video in place of the upside-down one.
Now your video should be displayed correctly :)

Make a Youtube video a full height and width cover video

I want to use a Youtube video as a fullscreen background for a splash page (including sound). However there should be no controls, ability to pause, etc. It should just look like a background movie.
What is the best way to do this?
Should I be using the tag or is there some other HTML5 tag, or entirely different method I can use?
If you're ok to use JS/jQuery: http://www.seanmccambridge.com/tubular/
Also, see the source if you want to take some of the concepts: https://code.google.com/p/jquery-tubular/source/browse/trunk/js/jquery.tubular.1.0.js
If you want to use YT player, I recommend you to use Youtube Player API
Please keep in mind that you can make the player full-background size, but you can't stretch the video inside the player (so you will need to accept black stripes for different screen ratio than original ratio of the video). I recommend you to use html5 video player (maybe video.js can help you)
P.S.: #Besto's suggestion Tubular breaks Youtube's Terms of Services!
<div id="ytcon" style="overflow: hidden">
<iframe id="fullyt" src="//www.youtube.com/embed/QVr0M7WCBu4?autoplay=1" frameborder="0" allowfullscreen></iframe>
</div>
<script>
$("#ytcon").height($(window).height());
$("#ytcon").width($(window).width());
$("#fullyt").height($(window).height());
$("#fullyt").width($(window).width());
$(window).on('resize', function(){
$("#ytcon").height($(window).height());
$("#ytcon").width($(window).width());
$("#fullyt").height($(window).height());
$("#fullyt").width($(window).width());
});
</script>

Why is youtube embed poster image not showing at full viewer size?

Here is my embed code:
<iframe width="1920" height="1080" src="//www.youtube.com/embed/2JkquK7PJ-c?rel=0&color=white&modestbranding=1&showinfo=0&wmode=transparent&autoplay=1" frameborder="0" allowfullscreen></iframe>
And here's how it's showing.
The video upload is 1080p and the poster image was chosen from the video (though I had the same issue with one that was a custom image) so I'm not sure what's missing.
Yes, this appears to be across all YouTube embeds. If it really bugs you, like it does me, I'd suggest showing the thumbnail and then swapping it out on click to the video with autoplay on. I wrote about doing this using jQuery years ago here: start/play embedded (iframe) youtube-video on click of an image
Your thumbnail is avaialble at: http://img.youtube.com/vi/YOURVIDEOID/maxresdefault.jpg
I was tidying up an AngularJS YouTube directive when they made this switch and I spent half an hour trying to figure out what I'd done to create that black border around the thumbnail until I looked around the internet at other embedded videos and noticed that it was YouTube system wide. Heh.
No idea why YouTube decided to do this, it looks horrible.
Try setting the iframe size using css, initially inline like this:
<iframe style="height: 1080px; width: 1980px" src="//www.youtube.com/embed/2JkquK7PJ-c?rel=0&color=white&modestbranding=1&showinfo=0&wmode=transparent&autoplay=1" frameborder="0" allowfullscreen></iframe>
If this works, neaten it up by giving the iframe an id and then add the dimensions as a rule to the external css file.

Facebook embeded video with iframe not working

we were embedding facebook videos in our website using iframe, it was working fine before, but from last few days site is not able to load video. we have tried it with simple web page as well but no luck. below is the code we are using
<iframe src="https://www.facebook.com/video/embed?video_id=video_id" width="650" height="400" frameborder="0" allowfullscreen></iframe>
please let me know if anyone can do a quick help
Just Use this link. It worked for me. "http://www.facebook.com/video/embed?video_id=XXXXXXXXXXXXX";
where XXXXXXXX is your facebook video id.
eg:
Facebook Sample Video:
<iframe src="http://www.facebook.com/video/embed?video_id=10152463995718183" frameborder="0" width="100%" height="100%">
You need to use this link now :)
https://m.facebook.com/video/video.php?v=xxxxxxxx
OLD ANSWER
the problem isnt that the video is not embeded but that it is not in an iframe correctly stretched. Cca a week before facebook has changed the embed link and video is not stretch to screen width and it cant be done in this fashion. I havent find a solution how to fix it yet.
Maybe there is a possibility to gut out mobile version of the video which is even in HTML5 ... problem with that approach is that the video is available only for a limited amount of time (cca 2 hours) .. then the link will expire and you need to click on a facebook video again which will create a different video.
Example here - https://m.facebook.com/story.php?story_fbid=751234308276798&id=643601645706732&_rdr
Try to use this URL: https://www.facebook.com/v2.3/plugins/video.php?allowfullscreen=true&autoplay=true&container_width=800&href=https%3A%2F%2Fwww.facebook.com%2Fredbull%2Fvideos%2F10155801793140352%2F&locale=en_US&sdk=joey
It's better then the embed url. The video fits in viewport.
did you try to embed different video? the video you're trying to embed may have been remove or hide so it can't show on your site. try embeding a sample video. if it appear the problem is on your video.

Embedded YouTube videos in native HTML5 mode and full screen

I know about the issues of HTML5 video and full screen in general. However, this is about embedded YouTube videos and using the YouTube default iframe embed code.
The context is me trying to answer my own question about seamless and sandbox for YouTube videos more in depth. Work has begun at a test page
(Note that form elements do not work at all so far.)
The thing is that currently I am not able to get any video to play in full screen, if I am signed in to the HTML trial. Attributes are therefore pointless.
Does anyone have up to date knowledge about YouTube's plans to provide full screen and if browser would allow it because of security restrictions or have a work around for the issue today?
I do not wish to enable full screen by default. The user must initiate it by him-/herself.
Using an alternative video player is currently not an option, since the purpose is to test YouTube's default code.
Add this to the end of your iframe src:
allowfullscreen
This should be your code:
<iframe width="500" height="500" src="https://www.youtube.com/embed/0U8VA-0SF5E" frameborder="0" allowfullscreen></iframe>