Force youtube embed to start in 720p

后端 未结 9 1966
感动是毒
感动是毒 2020-11-30 23:16

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

相关标签:
9条回答
  • 2020-11-30 23:55

    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.

    0 讨论(0)
  • 2020-11-30 23:57

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

    0 讨论(0)
  • 2020-11-30 23:58

    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.

    0 讨论(0)
  • 2020-12-01 00:02

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

    0 讨论(0)
  • 2020-12-01 00:05

    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.

    0 讨论(0)
  • 2020-12-01 00:08

    Youtube doesn't support playback quality anymore

    0 讨论(0)
提交回复
热议问题