YouTube iframe embed not starting in HD

后端 未结 8 660
甜味超标
甜味超标 2020-12-08 04:05

I\'m trying to embed an HD YouTube video but no matter what I try, it only ever seems to load the 480p version.

According to YouTube, embedding an HD video is as sim

8条回答
  •  醉梦人生
    2020-12-08 04:36

    As per this answer on the YouTube support forum:

    [The iframe embed] will attempt to "optimize" the experience and will work off of the dimensions of the embed player to choose what quality to play it back at by default.

    If the embed is much smaller than 1280x750, such as 853x510 or 640x390, it will play 480p or 360p, regardless of whether the &hd=1 parameter is set.

    (Emphasis mine)

    I changed the dimensions of the iframe to 1280x720 and the video loaded at 720p resolution.

    So, basically the iframe embed mechanism is intelligent and only loads the closest resolution according to the size of the iframe.

提交回复
热议问题