yes, fancybox will play youtube videos but take note of the following:
1. if your video is not in autostart mode and then you press click to
run the video, it will disappear; you need to set hideOnContentClick
to false
2. you can't group videos (at least I am not aware of any workaround);
grouping normally would be for image galleries so you don't net to set
any 'rel' attribute here
3. please DON'T use $("a").fancybox();
it will open (or will try to) ALL the links you may have in your page,
unless you mean to do that; it's better to associate fancybox to an ID
or class
4. there is a known issue with videos and IE and the workaround is
adding $("#fancy_content").empty();
5. it is always recommended to set the size of you fancybox according
to the size of your video, otherwise it will scale to the default size
(you may get not the resolution expected)
I don't see any problem with your code but the tweaks mentioned above
so try this:
<script type="text/javascript">
$(document).ready(function() {
//Activate FancyBox
$("a.group").fancybox({
// avoid closing fancybox with clickable content
'hideOnContentClick': false,
// set the fancybox size
'frameWidth':480,
'frameHeight':295,
// avoid video keep playing after
// fancybox is closed in IE
'callbackOnClose': function() {
$("#fancy_content").empty();}
});
});
</script>
your html:
<a class="group" href="#testube1"><img src="img1.jpg" /></a>
this should do the job
> <object width="480" height="295"><param name="movie" value="
http://www.youtube.com/v/vO5ZlhNGxzU&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2..."></param><param
> name="wmode" value="transparent"></param><embed src="
http://www.youtube.com/v/vO5ZlhNGxzU&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2..."