This module can be used to manage galleries or albums of videos that are hosted on sites such as Youtube, Dailymotion, Google Videos, Yahoo Videos, Veoh, MSN (or Bing) Videos, Vimeo, MySpace or MetaCafe.
It is also possible to deal with videos stored on your web server. Supported formats are mkv, divx, avi, mp4 (using the divx web player plugin) or flv (JarisFLVPlayer), ogg (cortado applet), wmv (Silverlight VideoPlayer.xap or Windows Media Player)...
HVA manages 3 levels: category, video album (or gallery) and video itself. It allows embedding videos one by one, in fancybox or awkward showcase (default mode) galleries or in paged list.
Make sure your users have the appropriate permissions. If you are not using the access restriction option (see settings), the
"HostedVideoAlbums: Normal user" permission will be enough to use the module. In the settings tab, you can choose which tabs
will be displayed for the normal user. Only the administrator and users with the "HostedVideoAlbums: Advanced" permission
will have access to settings tab.
If you wish to define level-specific permissions, activate the access restriction option in the settings tab and give the "HostedVideoAlbums: Manage
name_of_level" permission to the appropriate users.
To use this module, you will need to create the 3 levels (ie category, album and video). First, you will have to create the categories in the "Categories" tab, then create the video albums in the "Video Albums" tab and then the videos themselves in the "Video" tab.
For categories, all you need to provide is the display name of the category, and optionally its alias (used with the "alias"
parameter) and its description.
For albums, you will also provide a name, an alias (optional), the category to which the album is
attached, a description (optional), a language (in the form fr or en-US), and the default width and height of the videos in this album
(used when the width or height of the video is not set).
For videos, you need to provide a name, an alias (optional), the album to which the video is attached, a description (optional), the video site where the video is hosted, the video identifier (see below), optionally the width an height of the video (if not set, the default one of the album is used), and finally a thumbnail for preview (see below for details on thumbnails)
For Youtube, the video id is the last part of the url after "v=". For instance, in
http://www.youtube.com/watch?v=7SZtGvXkEIw, it's "7SZtGvXkEIw".
For Dailymotion, it's the last part of the url after the last "/". For instance, in
http://www.dailymotion.com/video/xcqa0g_cornershop-who-fingered-rock-n-roll_music, it's "xcqa0g_cornershop-who-fingered-rock-n-roll_music".
For Yahoo videos, it's also the 2 last numbers of the url after the penultimate "/". For instance, in
http://video.yahoo.com/watch/7095687/18465878, it's "7095687/18465878".
For Google videos, it's the last part of the url after "docid=". For instance,
in http://video.google.com/videoplay?docid=7521423388637542657#, it's "7521423388637542657#"
For Veoh, it's the last part of the url after the last "/". For instance,
in http://www.veoh.com/browse/videos/category/music/watch/v555658setkP3D8, it's "v555658setkP3D8".
For MSN or Bing Videos, use "msn video" and look in the embedding code for "player.v=...", the video id is
the hexa string after "player.v". For instance, in "player.v=fcc409a0-a8b0-4243-83b2-ff4a5eb3a86e", the id is "fcc409a0-a8b0-4243-83b2-ff4a5eb3a86e"
For metacafe, it's the numeric part in the url. For instance, in "http://www.metacafe.com/watch/4474839/pasta_013/", it's
4474839
For MySpace, it's the part after "videoid=" in the url. For instance, in
"http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=104317949", it's 104317949
For Vimeo, it's the last part in the url. For instance, in "http://vimeo.com/10875088", it's 10875088
To insert a video hosted on your own site, choose the "local.XXX" type depending on the video kind:
WARNING: the root of the local videos has changed since version 2.0.1. You MUST change the path of all your local videos.
The video id is the complete filename from the site root. You can use the file chooser to pick the video you want. If your upload parameters are big enough, you can even upload your video directly from the file chooser. The file chooser opens in the directory provided in the settings (frame Videos Settings) (usually /uploads/videos). You can arrange your videos in sub directories (for instance one directory per album).
The width and height of videos can generally be found in the "embed" code of the video sites. For each of these sites, either directly in the page or by clicking on a link in the page (youtube & google videos) or by clicking on the export button in the video (dailymotion), you will be provided with a piece of html code containing a width and a height.
For most of the hosted videos, HVA is able to derive automatically the thumbnail image of the video. This is the case for youtube, dailymotion, yahoo videos, google videos, vimeo, veoh, metacafe and myspace. So you don't need to provide a thumbnail for these videos.
It's not the case for msn video (if someone can tell me how to do this, he's welcome) and for all local videos. For all of them, you must provide a thumbnail (if not, a default thumbnail is provided). To provide a thumbnail, when entering the video parameters, click on the little directory icon near the thumbnail field, then either choose an existing image or upload it from your local disk. The image will be automatically resized to the thumbnail size given in the settings (frame video settings). You can arrange your thumbnails in sub directories (for instance one directory per album). The default directory where thumbnails are stored is given by the settings too (usually /upload/images/HVAThumbs.)
To call the module, simply use the following tag:
{HostedVideoAlbums what="<level>"}
If you omit the what parameter, the whole list of videos will be displayed. It is equivalent to:
{cms_module
module="HostedVideoAlbums" what="video"}
{HostedVideoAlbums what="category"} will display the categories list.
{HostedVideoAlbums what="album"} will display the albums list, whatever the category.
You may also ask for elements who belong to a specific parent:
{HostedVideoAlbums parent="alias_of_parent"}You may finally ask for a specific element:
{HostedVideoAlbums alias="alias_of_item"}
You will need to create a default category anyway. Name it for instance "default" then create all your albums in this
category and use the
{HostedVideoAlbums what="album"} to display all the albums.
Same, if you don't need the video albums, create a default album in the default category and link all your videos to this album. Then insert the
videos using
{HostedVideoAlbums what="video"}
You may limit the number of items to be shown on one page:
{HostedVideoAlbums nbperpage="5"}It's quite simple to add a new hosting site!
First, you must have a look at the "embedding code" of this site and locate what is the form of the video id and where it should be inserted in the url (movie parameter of the embedding code). Then just add the new site name in the "Sites" tab then edit the EmbedVideo template and add just before the {/if} line a set of lines in the form:
(WARNING: Don't modify directly the EmbedVideo template, make a copy as it might be rewritten by the next module version)
{elseif $item->site_namevalue=="<the new site name>"}
{assign var="movie" value="<begining of the url>`$item->videoid`<end of the url>"}
Look at the other cases to find the inspiration :)
If you do nothing for the thumbnails of new types of videos or sites, you will need to provide the images manually.
It may be considerably more complex to take into account automatically the thumbnails for hosted videos sites. For this, we must modify (a copy
of) Fancybox or Awkwar template template and add lines of the form (eg vimeo)
{elseif $item->site_namevalue=="vimeo"}
{$aswf}"http://vimeo.com/moogaloop.swf?clip_id={$item->videoid}&server=vimeo.com&show_title=true&show_byline=1&color={$item->color1}&fullscreen={$item->fullscreen_int}">
{$img}{php}
$item= $this->get_template_vars('item');
$hash = unserialize(file_get_contents("http://vimeo.com/api/v2/video/".$item->videoid.".php"));
$url = $hash[0]['thumbnail_small']; echo "'$url'";
{/php}>
The way to automatically deduce the url of the thumbnail is different for each site and you must investigate to find out how to ...
These are special actions you can use in the module declaration to create sitemaps, breadcrumbs and so on...
To embed a video inside an HVA template, you can use the "embedvideo" action:
{HostedVideoAlbums action="embedvideo" item=$item}You may use the action "link" to create a link to the default action, using the same parameters:
{HostedVideoAlbums action="link" what="video" random="1"}You may use the action "sitemap" to create a video sitemap:
{HostedVideoAlbums action="sitemap"}This will help you include the module entries to a google sitemap, provided that your elements are all displayed on the same page.
*** If you are using the google sitemap generator module ***
Open your sitemap generator (gsitemap.php), and just before the closure of the urlset (echo ' </urlset>'."\\n";), add the following lines:
$modulename = "HostedVideoAlbums";
if( isset($gCms->modules[$modulename]) && $gCms->modules[$modulename]["active"] && $themodule = $gCms->modules[$modulename]["object"]){
$params = array("mode"=>"google");
$themodule->DoAction("sitemap", "", $params);
}Of course, enter a detailpage, be it an id or page alias.
Note that you could also use the "what" parameter to specify which levels you wish to see displayed (you can specify several levels with "level1|level2" and so on). Otherwise, all levels will be displayed.
*** If you are using the SiteMap Made Simple module ***
Simply put the code above in a UDT (user-defined-tag), and call the UDT at the end of your sitemap's template, just before </urlset>.
You may use the action "search" to display a search form:
{HostedVideoAlbums
action="search"}
Use the "searchmode" parameter to switch between advanced (default) and simple mode. You
may specify the level in which to search using the "what" parameter. You cannot use the advanced search mode in all levels at
the same time.
The following parameters can be used with the search action: what, limit, nbperpage, orderby, detailpage,
listtemplate, inline, searchmode.
See HostedVideoAlbums/templates/search.tpl to modify the search form.
This module has been originally created with CTLModuleMaker and modified after. It is released under the GNU
Public License.
Parameters for the Vimeo, MetaCafe and MySpace sites are inspired from the webvideos module.
JARIS flash player (Site: http://jaris.sourceforge.net/,
Project Page: https://sourceforge.net/projects/jaris/)
Cortado applet (http://www.theora.org/cortado/)
Fancybox (http://fancybox.net)
Awkward showcase (http://www.awkwardgroup.com/)