tags:

views:

648

answers:

2

Is there a way to manipulate jquery Fancybox plugin to display flash video files (.flv)? I mean making it behave like Malsup's Media plugin that can handle both .swf and .flv

Putting my question in context:

I have a php file that works dynamically to read the videos:

 if($ext=="flv"){
    $fileSize = filesize($file);


header("Expires: Mon, 20 Dec 1980 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

# content headers
            header("Content-Type: application/x-shockwave-flash");
            header("Content-Disposition: attachment; filename=\"" . $path . "\"");
            header("Content-Length: " . $fileSize);

}
readfile("$file");


}

then my markup is as follows

                                <li><a class="vids" href="viewThumb.php?type=media&amp;name=<?php echo $row['video']?>"><img src="viewThumb.php?type=artist&amp;name=a5339732e90416ee1df65dfe83bfba16.jpg" width="200" height="200"></a></li>

where $row['video'] is the name returned from an database query.

Now what I want is that when a client clicks on the thumbnail a fancybox with my video would display. It works well with .swf and other extensions explicitly noted in the fancybox documentation but not with .flv.

Help will be greatly appreciated

+1  A: 

Fancybox allows you to load content dynamically using jQuery's Ajax.

It shouldn't be different than creating your own PHP/HTML page that takes care of embedding the FLV or SWF, and dynamically loading it inside the Fancybox.

Wadih M.
+1  A: 

you could try handling the click event like this

$('a[href$=.flv]').bind('click',function(evt){
// stuff that shows swf with flv path as parameter
})
markcial