Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS jQuery: Fluid Width YouTube videos – multiple aspect ratios

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #30226
    alienmode
    Participant

    Hey folks I’m using Chris’ fluid width YouTube videos script:

    https://css-tricks.com/fluid-width-youtube-videos

    Problem is, doesn’t seem to work when you have videos of different aspect ratios. I believe the script is hunting for the width and height of the first embed on the page, then when it finds them, it uses them to resize every other object on the page. So if the first video is 640×480, and the second video is 1280×720, the 1280×720 player gets resized to a 4×3 rectangle…

    How do I fix this? You’d have to make the script check every set of width/height coordinates on the page… Would you use .each()? I gave that a shot but couldn’t quite figure it out.

    Thanks in advance for any advice!

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.