Created: 27/02/2011
By: Digital Zoom Studio
Twitter: http://twitter.com/
Facebook: http://facebook.com/dzs
Support Forum: http://dzs.net/support/
Thank you for purchasing my component. If you have any questions that are beyond the scope of this help file, please feel free to apply for membership on the forum, it's the fastest way of support [ link to the left ] and post a thread about your question after your membership is validated.
DZS Video Gallery is the ultimate gallery for your videos. Its the only gallery that can display YouTube videos and videos from your server in the same container. It can be used as a portfolio or a video showcase. You choose. It is XML driven and only needs a simple text editor to be set up. It can be embedded in html ( just drag and drop with your favorite html editor ), can be used stand-alone and also can be integrated in your flash project very easy.
All you have to do for installing on your site (ie. yoursite.com) is copy the contents of the /deploy folder to a folder (ie. yourfolder) on your site via ftp ( recomended program: filezilla ) or any other upload service. You can then access your contents via http://yoursite.com/yourfolder.
Recommended: Some web servers don't have html5 video support yet. So if you notice your videos do not work ( and were properly uploaded ) an easy fix is to add this to to your .htaccess file:
AddType video/ogg ogv
AddType video/webm .webm
AddType video/mp4 .mp4
There are several ways to include the gallery in your project depending on the features you need - w/o flashobject - w/o html5 gallery
<div class="flashgallery-con>
<object type="application/x-shockwave-flash" data="preview.swf" width="915" height="360" id="flashcontent" style="visibility: visible;">
<param name="movie" value="preview.swf"><param name="menu" value="false"><param name="allowScriptAccess" value="always">
<param name="scale" value="noscale"><param name="allowFullScreen" value="true"><param name="wmode" value="opaque">
<param name="flashvars" value="xml=xml/gallery.xml">
</object>
</div>
Important: This is where you modify the size to your component. In the width and height variables above.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script src="videogallery/vplayer.js"></script>
<script src="videogallery/vgallery.js"></script>
<script src="videogallery/flashhtml5main.js"></script>
<link rel="stylesheet" type="text/css" href="videogallery/vplayer.css"/>
<link rel="stylesheet" type="text/css" href="videogallery/vgallery.css"/>
<link rel="stylesheet" type="text/css" href="videogallery/skin_white.css"/>
<script type="text/javascript">
var width=915;
var height=360;
var flashvars={xml:"xml/gallery.xml"};
var params={menu: "false",allowScriptAccess: "always",scale: "noscale",allowFullScreen: "true",wmode:'opaque'};
var attributes={};
swfobject.embedSWF("preview.swf", "flashcontent1", width, height, "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
<div class="gallery-precon gp1">
<div class="flashgallery-con">
<div id="flashcontent1"></div>
</div>
<div class="videogallery-con" style="width:915px; height:360px; display:none;"><div class="preloader"></div>
<div id="vg1" class="videogallery" style="width:640px; height:360px;">
<div class="vplayer-tobe" data-videoTitle="Pages" data-description="<img src=thumbs/pages1.jpg class='imgblock'/><div class='the-title'>Pages</div>AE Project by Generator" data-sourcemp4="video/pages.mp4" data-sourceogg="video/pages.ogv" ><div class="videoDescription">You can have a description here if you choose to.</div></div>
<div class="vplayer-tobe" data-videoTitle="Iron Man 2 - without ads" data-description="{ytthumb}<div class='the-title'>Iron Man 2 - without ads</div>This gallery lets you showcase youtube/local/vimeo movies togheter." data-type="youtube" data-src="FNQowwwwYa0" ></div>
<div class="vplayer-tobe" data-videoTitle="This Gallery on iPad/iPhone" data-description="{ytthumb}<div class='the-title'>This Gallery on iPad/iPhone</div>Make sure you do not miss a single guest with this gallery." data-type="youtube" data-src="puj20NRu5VM" ></div>
<div class="vplayer-tobe" data-videoTitle="Iron Man 2 - with an image ad" data-description="{ytthumb}<div class='the-title'>Iron Man 2 - with an image ad</div>This gallery lets you showcase youtube/local/vimeo movies togheter." data-type="youtube" data-src="FNQowwwwYa0" ></div>
<div class="vplayer-tobe" data-videoTitle="Local Video - with a video ad" data-description="<img src=thumbs/ad1.jpg class='imgblock'/><div class='the-title'>Local Video - with a video ad</div>You can have your own ad play before the video. Very simple to setup!" data-sourcemp4="video/thunder.mp4" data-sourceogg="video/thunder.ogv" ><div class="videoDescription">You can have multiple thumbs showcasing your video.</div></div>
<div class="vplayer-tobe" data-videoTitle="Thunder" data-description="<img src=thumbs/thunder1.jpg class='imgblock'/><div class='the-title'>Thunder</div>Another great project by Generator." data-sourcemp4="video/thunder.mp4" data-sourceogg="video/thunder.ogv" ></div>
<div class="vplayer-tobe" data-videoTitle="Nature by Numbers" data-description="{ytthumb}<div class='the-title'>Nature by Numbers</div>A beautiful video displaying the wonders of nature" data-type="youtube" data-src="kkGeOWYOFoA" ></div>
</div>
</div>
<script>
var flashhtml5main = {
defaultis : 'flash', //flash or html5
target : 'gp1'
}
var videoplayersettings = {
autoplay : "off",
constrols_out_opacity : 0.9,
constrols_normal_opacity : 0.9,
design_scrubbarWidth:-201
}
jQuery(document).ready(function(){
if (jQuery.browser.safari && document.readyState != "complete"){
setTimeout( arguments.callee, 120 );
return;
}
$("#vg1").vGallery({
menuSpace:0,
randomise:"off",
autoplay :"off",
autoplayNext : "on",
menuitem_width:275,
menuitem_height:76,
menuitem_space:1,
menu_position:"right",
transition_type:"slideup",
design_skin: "skin_default",
videoplayersettings : videoplayersettings
})
flashhtml5(flashhtml5main);
})
</script>
<div class="shadow"></div>
<div class="html5-button-con"><div class="html5-button">Switch to HTML5</div></div>
</div>
In the first preview you may notice thumbnail of the current video at the selected time appear above the scrubbar. This is done by making a folder with thumbnails named after the time which marks the respective moment in the video. For that we used a custom php extension on our localhost named ffmpeg. This is the code we used :
if (make_jpg($input, $second . '.jpg', $second)){
echo 'success';
}else{
echo 'bah!';
}
$second = '01';
make_jpg($input, $second . '.jpg', $second);
$second = '02';
make_jpg($input, $second . '.jpg', $second);
function make_jpg($input, $output, $fromdurasec="00") {
global $ffmpegpath;
$duration = 100;
if(!file_exists($input)) return false;
//$command = "$ffmpegpath -i $input -an -ss 00:00:$fromdurasec -r 1 -vframes 1 -f mjpeg -y $output";
$command = "$ffmpegpath -i $input -an -ss 00:00:$fromdurasec -s 60x35 -r 1 -vframes 60 -f image2 -y %02d.jpg";
@exec( $command, $ret );
if(!file_exists($output)) return false;
if(filesize($output)==0) return false;
return true;
}
Of course, the thumbs can be made manually too.
This is optional and represents the container of the gallery and the preloader ( recommended )
<div id="vGallery" class="videogallery" style="width:638px; height:300px; opacity:0;">
</div>
This is the main gallery contianer, you add gallery items inside. You can also modify size directly from the style attribute. Opacity is optional.
<div class="vplayer-tobe" data-videoTitle='Big Buck Bunny' data-description='<img src="img/thumb.png" class="imgblock"/><div class="the-title">Big Buck Video</div>Here you can have a video description of your choosing.' data-sourcemp4='video/test.m4v' data-sourceogg='video/test.ogv'></div>
This is gallery item. Add as many as you wish inside the videogallery container.
Customisable parameters
data-videoTitle - optional - the title that appears in the top left of the video.
data-description - optional - title and description of the video that appears in the menu item of the glalery - html accepted
data-sourcemp4 - location of the mp4 format of the video ( or m4v )
data-sourceogg - location of the ogg format of the video ( or ogv )
data-sourcewebm - location of the webm format of the video
data-sourceflash - location of the mp4 format of the video ( or m4v or flv or H.264 .mov )
var videoplayersettings = {
autoplay : "off",
videoWidth : 500,
videoHeight : 300,
constrols_out_opacity : 0.9,
constrols_normal_opacity : 0.9,
design_scrubbarWidth:-201,
design_background_offsetw : 0
}
Both the gallery and video player are highly customizable.
autoplay - only matters if you are using it independent of the gallery - autoplay video on / off
videoWidth / videoHeight - only matters if you are using it independent of the gallery - video player size
constrols_out_opacity - controls opacity when video player is not focused
constrols_normal_opacity - controls opacity when video player is focused
design_scrubbarWidth - only for skin customization purposes - scrubbar width offset
design_background_offsetw- only for skin customization purposes - background width offset
$('#vGallery').vGallery({
menuSpace:0,
randomise:"off",
autoplay :"off",
autoplayNext : "on",
menuitem_width:275,
menuitem_height:76,
menuitem_space:1,
menu_position:'right',
transition_type:"slideup",
design_skin: 'skin_default',
videoplayersettings : videoplayersettings
})
Both the gallery and video player are highly customizable.
menuSpace - space between the menu and video player
menuitem_width / menuitem_height - the menu item size
menuitem_space - the space between menu items
autoplay - autoplay the first video on / off
autoplayNext - autoplay the next video on/off
randomise - randomise video gallery items
menu_position - the menu position - right / left / up / down / none
transition_type - choose between 'fade' and 'slideup'
design_skin - choose between 'skin_default' or make your own following the instructions from bellow
videoplayersettings - the video player settings object
design_scrubbarWidth - only for skin customization purposes - scrubbar width offset
design_background_offsetw- only for skin customization purposes - background width offset
You can check this link for a list of popular questions. Other questions you might have:
Access the source/videogallery.fla . Open with with Flash CS3 or more. Go to the button movieclip labeled Button - marked red in the image above. Then do the embedding of characters as shown here - http://blog.activeden.net/resources/common-questions-by-flashden-buyers/common-questions-using-special-characters-like/ .
Or simpler then that - instead of using preview.swf, use preview_all_chars.swf
Access the xml [ default : deploy/xml/gallery.xml ], and add the bolded lines, remember to change yourvideo to your actual video path:
<item>
<source>video/yourvideo.flv</source>
<thumb>thumbs/yourthumb.jpg</thumb>
<title>Slides Video</title>
<description><![CDATA[<font
size="20">cev</font><br></br>ceva
aceva ceva ceva]]></description>
<menuDescription>Something</menuDescription>
<type>video</type>
</item>
Add this to the xml inside the <content>
Offcourse, you need to change the id to fit your desired video.
Just go to the location you have installed the gallery /designer ( the designer folder ) and click Save when you are happy with the changes.
Take this movie for example - http://www.youtube.com/watch?v=UXLvR6ZaZk4 . The youtube ID is just this part: UXLvR6ZaZk4
This is a variation of Method 2 of embedding in html
This is a variation of Method 2 of embedding in html
This is a variation of Method 1 of embedding in html. You need to edit video/test.mp4 to your video path in both places:
Use the html5 gallery example and make sure your videos are mp4 / m4v and are properly encoded ( recommended - Handbrake.fr ) and it should work with no problem.
You just give this as the link - http://www.facebook.com/share.php?u=http://yourlink.html.
There is a WordPress version.
Here is the admin version.
You need your movie converted to two formats in order to make sure the html5 video plays in all browsers.
Browser support & recommended encoding program
IE9, IE8 ( Flash ) & Safari : M4V -> http://handbrake.fr/
Chrome & Opera & Firefox : OGG-> http://video.online-convert.com/convert-to-ogg
When you want to manipulate pictures - ie: you depend on their size - like a ken burns slider or scroller does, it's best to use jQuery(window).load because that executes the code in it AFTER all the images and content has loaded. For everything else, there is jQuery(document).read -which only waits for the html to be parsed corectly & all elements formed.
This gallery provides source files ( in the source folder ) so if you are developer you can start cusmizing it.
You can generally use any text editing software to edit most content/code, but this is what I recommend:
The structure of the fla file -
Digital Zoom Studio