Here is a link to my video gallery.
http://www.prawdzik.ca/testingserver/FondationSemafo/index.php?id=30
I have a container document for my video gallery, and under it i create documents which will represent my videos. I fill the template variable tvYouTubeID with the YouTube video ID (example: for the
http://www.youtube.com/watch?v=svg9Dx_ID5U video, the ID is "svg9Dx_ID5U")
I do not use Maxigallery for this because there aren’t really pictures in my galleries. To go through the children of the container document (i.e. the videos), I used Ditto. The container document has id 30, and the &dateFormat, &dateSource and sorting are needed because I want to show the pub_date of each video beside its thumbnail.
<div id="videoscontainer">
[[Ditto? &parents=`30` &display=`all` &tpl=`myVideoGallery` &dateFormat=`%Y/%m/%d` &dateSource=`pub_date` &sortBy=`pub_date` &sortDir=`DESC`]]
</div>
The &tpl is the following:
<div class="videothumbnail">
<div class="videoheader"><div class="videodate">[+date+]</div><div class="videoduration"></div></div>
<a class="fancybox" rel="videogallery" href="#[+tvYouTubeID+]" title="[+introtext+]"><img src="http://img.youtube.com/vi/[+tvYouTubeID+]/0.jpg" alt="[+introtext+]" /></a>
<div id="[+tvYouTubeID+]" style="display:none">
<object type="application/x-shockwave-flash" width="425" height="355" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.youtube.com/v/[+tvYouTubeID+]" />
<embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/[+tvYouTubeID+]" wmode="transparent"></embed>
</object>
</div>
<h4>[+pagetitle+]</h4>
</div>
Notes:
1- the <a> is a link to the <div> that contains an embeddect flash movie.
2- as far as I know, the "class" parameter in the <a> has to be "fancybox".
3- use the "rel" paramater if you want to have a gallery of videos. you will be able to loop through the videos as you do with pictures. fancybox will group together videos with the same value for "rel".
4- the "title" parameter of the <a> is the text used for the video’s caption. insert any value you want as usual.
5- the img src is a static address where you can find thumbnails for your videos. there are a few thumbnails and i also found a bigger image, perfect for my needs. you resize it in CSS and the job is done.
- make sure the id of the <div> is the same as the #href of the <a>
6- the embedded flash movie is a bit of an annoyance, because i did not find a perfect solution. if you leave the <object> as is, the code will not validate xhtml strict but works great in all browsers. to have code that validates, you can use this code, which validates xhtml strict but does not work that well. once displayed by fancybox, the object seems on top of my navigation and close icons, which doesn’t work for me...
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0">
<param name="movie" value=" http://www.youtube.com/v/[+tvYoutubeID+]" />
<object type="application/x-shockwave-flash" data=" http://www.youtube.com/v/[+tvYoutubeID+]" width="425" height="350"></object>
</object>
It is somewhat the same as the one produced by the YouTube snippet ([[YouTube? &id=`TOUTUBE_ID`]]), which doesn’t validate xhtml strict either:
<object id="svg9Dx_ID5U" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="425" height="350">
<param name="movie" value=" http://www.youtube.com/v/svg9Dx_ID5U&rel=1&autoplay=0&loop=0&disablekb=0&egm=0&border=0&hl=en" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data=" http://www.youtube.com/v/svg9Dx_ID5U&rel=1&autoplay=0&loop=0&disablekb=0&egm=0&border=0&hl=en" width="425" height="350">
<!--<![endif]-->
<p>This video requires the free Flash plugin.</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
Until I find a solution I will use the first solution, the non-validating but working well one.
By the way, I am using Fancybox 1.2.1 , downloaded from
http://fancy.klade.lv/home which comes with jQuery 1.3.2. You need these lines in your header as well.
<link rel="stylesheet" href=".....fancybox/jquery.fancybox.css" type="text/css" media="screen" />
<script type="text/javascript" src="...../fancybox/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="...../fancybox/jquery.fancybox-1.2.1.js"></script>
<script type="text/javascript" src="...../fancybox/jquery.easing.1.3.js"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("a.fancybox").fancybox();
});
</script>
This way the end-user only has to input a YouTube videoID and a description and it’s done. I’m sure you can use some snippet to make a front-end for this.
I am sure I can do many things better, but this is what I could come up with. Is this something like what you were looking for?