1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 How do I get YouTube embeds in HD?

Discussion in 'XenForo Questions and Support' started by Booth, Jan 7, 2012.

  1. Booth

    Booth Well-Known Member

    Is there anything I can add to the YouTube code that will make all the videos on my site default automatically in 720p? At the moment they are opening in 480p which looks nasty at times compared to the clear HD I've uploaded.
     
  2. Kevin

    Kevin Well-Known Member

    Modify your YouTube media code...

    ACP => Home => BB Code Media Sites => YouTube

    ... and then change all references of "&fs=1" to "&fs=1&hd=1" (there are 3 of them in the default XF code).

    After that create a new message and try embedding a video like this one. It should now play back at 720p.

    Just watch out there because your visitors on slower connections might not appreciate the videos taking a lot longer to load & play.
     
    Booth likes this.
  3. Booth

    Booth Well-Known Member

  4. Brogan

    Brogan XenForo Moderator Staff Member

    Those parameters are for the default object code.
     
  5. Kevin

    Kevin Well-Known Member

    Sounds like you changed your definition somewhere along the way to use the iframe version. The default XF definition is...
    Code:
    <object width="500" height="300" data="http://www.youtube.com/v/{$id}&amp;fs=1" type="application/x-shockwave-flash">
    <param name="movie" value="http://www.youtube.com/v/{$id}&amp;fs=1" />
    <param name="allowFullScreen" value="true" />
    <param name="wmode" value="opaque" />
    <embed src="http://www.youtube.com/v/{$id}&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="opaque" width="500" height="300" />
    </object>
    I am supposed to be heading out the door so I don't have a chance to test this right now but with your modified version try changing the "wmode=opaque" to "wmode=opaque&amp;hd=1" to see if that works.
     
  6. EQnoble

    EQnoble Well-Known Member

    It will work...but not on the iframe player...well not with that method of calling it directly at any rate.

    As Kevin pointed out you can throw it on the end of the urls in the bbcode and it will work...mine looks like this.
    HTML:
    <object width="640" height="380" data="http://www.youtube.com/v/{$id}&amp;fs=1&amp;hd=1" type="application/x-shockwave-flash">
    <param name="movie" value="http://www.youtube.com/v/{$id}&amp;fs=1&amp;hd=1" />
    <param name="allowFullScreen" value="true" />
    <param name="wmode" value="opaque" />
    <embed src="http://www.youtube.com/v/{$id}&amp;fs=1&amp;hd=1" type="application/x-shockwave-flash" allowfullscreen="true" wmode="opaque" width="640" height="380" />
    </object>
     
  7. mrGTB

    mrGTB Well-Known Member

  8. EQnoble

    EQnoble Well-Known Member

    Yes I know that...(not the validation thing though) I was responding to kevin's post since he said he had to step away... I was pointing out that you can't throw the hd=1 into the url on the iframe player as it will not except it as I have read on the same link you posted actually.
     
  9. Booth

    Booth Well-Known Member

    Thanks for the advice everyone. Can't understand why that code was changed, I haven't changed it :confused:

    I think YouTube 720p must be higher bitrate than Vimeo because it stutters on my Macbook Pro. So now I'm trying to figure out how to default to 480p.

    YouTube defaulting to 360p is o_O
     
  10. Kevin

    Kevin Well-Known Member

    Getting it to default to 480p is a case of good news/bad news.

    The good news is that "fmt=22" would default the player to 480p. (y)

    The bad news is that it is no longer supported nor functional and so as of the current moment "hd=1" is the only option available to us. (n)
     
  11. Mike

    Mike XenForo Developer Staff Member

    For reference, the iframe version is the current default (as it can work on iOS).
     
  12. ChemicalKicks

    ChemicalKicks Well-Known Member

    AFAIK YouTube is very clever and automatically presents the best quality that can be delivered with your broadband pipe, changing it to default to HD won't really benefit anyone. Those with fast lines should in theory already be getting videos in HD and those with slower line speeds are going to get stuttering.
     
  13. Marco Famà

    Marco Famà Active Member

    Ciao everyone,
    I would like to ask you a bit of your help, cause upon one of my users' suggestions, I've decided to implement this great solution to have YT videos embedded in HD 720 by default.

    Please have a look at this discussion on my xenForo instance:
    http://timelapseitalia.com/forum/threads/video-youtube-in-hd.1035/

    The point is: although the code is perfectly embedded I guess - as per EQNoble code - videos are still starting at lower bitrates... :-/

    Any chance you can help me sorting this thing out?

    Thanks everyone
    Marco
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Marco Famà likes this.
  15. Marco Famà

    Marco Famà Active Member

Share This Page