1

The embed I am working on needs to be having the maximum width and height of your current browser size. (so it's kinda responsive). What I now have defined is a height of 890 and a width of 1640 which obviously needs to be changed to what I want. However a simple 100% doesnt work on both. (Somehow it works for the width only)

Help is appreciated.

function onYouTubeIframeAPIReady() {
    player = new YT.Player('player', {
        height: '890',
        width: '1640',
        playerVars:
        {       
            controls: 0,
            autoplay: 0,
            enablejsapi: 1,
            iv_load_policy: 3,
            playsinline: 0,
            autohide: 0,
            listtype:'playlist',
            list:'PLDlvzhdA4-Pdv-zwkSUGr5-Bu_nn_33bP'
        }
    });
}
  • I gave the body a width and height of 100% and gave the height and width of the function 100% aswell, but I'm not sure if I'm doing it the right way. – Alessio Jordaan May 09 '14 at 10:28
  • possible duplicate of [Get YouTube Video dimensions (width/height)](http://stackoverflow.com/questions/9514635/get-youtube-video-dimensions-width-height) – davidcondrey Oct 05 '14 at 00:15

1 Answers1

0

add the following to the css

body { width: 100%; height: 100%; }

This will work.

maartenpaauw
  • 555
  • 2
  • 7
  • 20