Full screen Youtube Videos in Fancybox using type iframe?

3,150 views
Skip to first unread message

Djako Carey

unread,
Nov 11, 2012, 11:23:56 PM11/11/12
to fanc...@googlegroups.com
Hi there.

I'm wondering if anybody knows how to enable fullscreen playback of youtube videos with fancybox using type: iframe (not swf)?

Whenever i select the fullscreen box it simply grays out and the youtube videos stays the same size i specified in the javascript.

Here is my current setup:

  $(document).ready(function () {
        $('.fancybox-media').click(function () {
            $.fancybox({
                'padding': 10,
                'transitionIn': 'none',
                'transitionOut': 'none',
                'width': 980,
                'height': 650,
                'href': this.href.replace(new RegExp('watch\\?v=', 'i'), 'v/') + '?rel=0&autohide=1&modestbranding=1&autoplay=1&showinfo=1&hd=1',
                'type': 'iframe'
            });
            return false;
        });
    });

Thanks heaps for your help.


JFK

unread,
Nov 13, 2012, 12:40:02 AM11/13/12
to fanc...@googlegroups.com
I guess the parameter for full screen is 
fs=1

Djako Carey

unread,
Nov 13, 2012, 1:24:32 AM11/13/12
to fanc...@googlegroups.com
Thanks for the suggestion.

fs=1 is a parameter i have tried out in the past. Unfortunately this does not seem to work, the fullscreen button continues to be grayed out when clicked with no change to the videos dimensions. :( 

RavanH

unread,
Nov 13, 2012, 3:59:24 PM11/13/12
to fanc...@googlegroups.com
I do not think it has anything to do with Fancybox but all with Youtube. I've noticed some weird differences trying to embed a Youtube playlist in Fancybox in iframe mode. The issue can be seen when accessing the URLs directly without fancybox, where you can see that the same playlist via both URLs has the fullscreen button but one URL handles it correctly while the other does indeed 'grey out' and does nothing. No matter if the fs=1 parameter is used...
Notice this is the exact same playlist, just accessed via a different URL.

Or open these two URLs straight in your browser -- sorry for bad music, it's just an example ;) -- and test the full size button:



Op dinsdag 13 november 2012 07:24:32 UTC+1 schreef Djako Carey het volgende:

Djako Carey

unread,
Nov 13, 2012, 8:41:51 PM11/13/12
to fanc...@googlegroups.com
Hiya.

Thanks heaps for your help. I had been embedding the videos by grabbing the youtube url: http://www.youtube.com/watch?v=piOIk7ghp2Q Changing this to http://www.youtube.com/embed/piOIk7ghp2Q it now works perfectly with full screen.

Thanks again.

Djako
Reply all
Reply to author
Forward
0 new messages