Flowplayer in fancybox?

advertisements

I am trying to get the Flowplayer to be shown inside a Fancybox, but can't quite get it working. This is my code so far;

            $("a.video_link").click(function () {

            $.fancybox({
                'autoScale': false,
                'transitionIn': 'none',
                'transitionOut': 'none',
                'title': this.title,
                'width': 680,
                'height': 495,
                'href': '/flowplayer/flowplayer.swf?video=myvideo.flv', /* have also tried a couple of other options for the url settings, but without luck)
                'type': 'swf',
                'swf': {
                    'wmode': 'transparent',
                    'allowfullscreen': 'true'
                }
            });

            return false;
        });

Any suggestions?


Try manually launching fancybox and setting setting its content to a flowplayer. For instance, given the link:

<a href="http://pseudo01.hddn.com/vod/demo.flowplayervod/flowplayer-700.flv"
    class="videoLink">Demo</a>

create a JQuery click function like this:

$('a.videoLink').click(function(e) {
    e.preventDefault();

    var container = $('<div/>');

    container.flowplayer(
        'http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf',
        $(this).attr('href')
    );

    $.fancybox({
        content: container,
        width: 300, height: 200,
        scrolling: 'no',
        autoDimensions: false
    });
});

Note that flowplayer by default takes up size of it's container, so must be given finite dimensions to view it properly.