Gallery3:Modules:videos - Gallery Codex
Personal tools

Gallery3:Modules:videos

From Gallery Codex

Development and support for this module has stopped. This module has been replaced with core functionality.
For more information, please see the documentation page at Gallery3:User_guide:Obsolete_modules.

Videos Module

Allows authorized users to load videos directly from your web server.

Description

Video's allows users to upload "unsupported" video files to their Gallery 3 albums.

Video's contains a modified version of Galley's Gallery3:Modules:serveradd module that allows for transferring files from a directory on the server into a Gallery 3 album. With this module installed, a user can ftp a large video file in an unsupported format (like .avi) to their web server, and then log in as an admin in Gallery and add that file to an album using the Add -> Add videos menu option (you many want to read up on Gallery3:Modules:serveradd if you've never used it before). Visitors will then see a "Click here to download video" link instead of the normal flash player when viewing these videos (as Gallery's flash video player can't handle these formats).

By default, this module will allow admins to add videos with the following file extensions to their albums: "avi", "mpg", "mpeg", "mov", "wmv", "asf", "mts". This list of "accepted" file extensions is controlled by a module variable, which can be edited from the Settings -> Advanced screen (it's the "videos" / "allowed_extensions" value). See customization below for how to expand.

This module also contains support for a .flv "resized" version of the video. In the event that an appropriately named .flv file is found in Gallery's var/resizes folder, Gallery will load the resize in flowplayer instead of displaying the download link (the original video can still be downloaded via the DownloadFullsize module: Gallery3:Modules:downloadfullsize). The flash video must be encoded by the user, and then manually uploaded to the server -- there's no support for server-side encoding. The .flv video can be uploaded along with the original video, in which case the modified server add will automatically find and copy it to the resizes folder. The .flv file can also be uploaded directly to the resizes folder later. In order for Gallery to locate the .flv video, it's file name must be originalname.extension.flv. So for example, if your video is "testvideo.avi", the flash video would be "testvideo.avi.flv".

More information can be found in the Gallery 3 forums at http://galleryproject.org/node/98149

Features

  • Store unsupported video formats in Gallery 3
  • Works with "avi", "mpg", "mpeg", "mov", "wmv", "asf", "mts".

Installation

To install, copy the "videos" folder into your Gallery 3 modules folder. Afterwards log into your Gallery web site as an administrator and activate the module in the Admin -> Modules menu. The will prompt you to add a location on the server where videos can be added from.
You will now see a "add video" on the "add" item drop-down.

If you don't have FFMPEG on your server, you may also need to install the Gallery3:Modules:noffmpeg module.

Screenshots

Configure the location to add items from:
Add from server.png


New menu action item to add videos to the album:
Video add.png



Customization

Expanding of the allowed file types in the advanced settings:
Old value:

  a:7:{i:0;s:3:"avi";i:1;s:3:"mpg";i:2;s:4:"mpeg";i:3;s:3:"mov";i:4;s:3:"wmv";i:5;s:3:"asf";i:6;s:3:"mts";}

New value:

  a:8:{i:0;s:3:"avi";i:1;s:3:"mpg";i:2;s:4:"mpeg";i:3;s:3:"mov";i:4;s:3:"wmv";i:5;s:3:"asf";i:6;s:3:"mts";i:7;s:3:"mp4";}

The pattern is that the second item needs to be incremented (from 7 to 8) to allow the addition of the i:7 setting of mp4. The s:3 indicates the length of the string to be matched.

Text changing

If you want to change the text Click Here To Download Video Edit modules/videos/js/videos_download.js

Modifications

If you want registered users to upload videos as well as the admin try: http://galleryproject.org/node/103811#comment-382525