How Do You Add Fullscreen Option To Youtube Video In Lightbox?
  • Hey you guys my first time posting in here. Love prettyphoto its super clean.

    I am having trouble with the youtube videos I want to pop out into the light box.

    Firstly I need to have the fullscreen option available when the video pops out.

    Also I notice when the video does pop out the default lightbox fullscreen button is in the top right corner but, that is normally used for pictures to zoom in on them. It doesn't work right with the videos.

    Is there anyway I can remove that default lightbox fullscreen button with just some simple tags in the link?

    For example purposes this is what Im workin with:

    <a href=\" sek3QMQr03I?iframe=true&width=1280&height=720&allowfullscreen=true\" title=\"Swifty\" rel=\"prettyPhoto\"><img src=\"\"></a>

    I had to put an extra space inside the youtube url after v= that way it wouldn't embed on the forum.

    Anyway Im getting close. I know there are just a few things Im doing wrong.

    Thanks you guys :)
  • You guys I figured this one out.

    <a href=\" /embed/sek3QMQr03I?iframe=true&width=1280&height=720\" title=\"Swifty\" rel=\"prettyPhoto\"><img src=\"\"></a>

    For those of you having this same trouble just use the embed version of the url in place of the orignial Youtube url. This also gets rid of the default lightbox fullscreen button on the top left :D
  • Here is how I solved the problem.

    I modified prettyphoto javascript. Just search for iframe_markup in the .js file and add the attribute allowfullscreen=true in the iframe tag.

    Now it looks like below:
    iframe_markup: '<iframe src ="{path}" width="{width}" allowfullscreen="true" height="{height}" frameborder="no"></iframe>'

    This allows full screen in youtube video.

    Note that I am using /watch url instead of /embed url in the original youtube url.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter