开发者

Fancybox for .flv

Is there a way to manipulate jquery Fancybox plugin to display flash video files (.flv)? I mean makin开发者_JAVA技巧g 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


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
})


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜