The FlashVideo Module API


Using the FlashVideo Hook System

With the FlashVideo module becoming more widely accepted within the Drupal community, there has been many requests to introduce a common API to allow for an interface for other modules to interact with. As of version 2.2, FlashVideo now introduces a complete API that allows for other plugins to hook into the conversion process allowing for specific conversion functionality. What this creates is a video conversion module that is no longer tied to the defaulted FFMPEG conversion utility. Now, a plugin can be created to hook into the FlashVideo module and insert its very own conversion utility, while at the same time, upholding the FlashVideo video handling functionality. This is all done by utilizing two new hooks introduced in version 2.2. These hooks are described as follows...

  • flashvideo_submit - Gets invoked when the user presses the Submit Button upon node insertion and update
    Parameters:
    • $node - Standard Drupal Node.
    • $params - The Default Parameters passed from the FlashVideo Module. See Table Below for the whole list of parameters to override.

  • flashvideo_get_params - Invoked before the conversion routine is called allowing the plugin to override the parameters.
    Parameters:
    • $file - Standard Drupal File Object.
    • $flags - Flags that can be set by the plugin to allow for conversion control within the FlashVideo module.
    • $params - The Default Parameters passed from the FlashVideo Module. See Table Below for the whole list of parameters to override.
    Returns:
    • $params - The overridden parameters.

FlashVideo Parameter List. : The following is a list of all parameters that can be overridden by using these hooks.

Parameter NameTypeDescription
output_dirTextUsed to command the output directory. This is relative to the system files directory.
cmd_pathText Used to specify the CWD path to the conversion utility executable. Be sure to include the executable in the path. Example /usr/bin/ffmpeg
video_argsTextThe arguments given to the conversion utility executable to generate a video. The same format should be used as in the FlashVideo Settings.
thumb_argsText The arguments given to the ffmpeg executable to generate a thumbnail. The same format should be used as in the FlashVideo Settings.
thumbsizeTextThe thumbnail size specified in the following format "WIDTH x HEIGHT". Example 130x100
thumbwidthIntegerThe thumbnail width.
thumbheightIntegerThe thumbnail height.
thumbtimeTextThe amount of time to delay before taking a snapshot of the video. Denoted as "00:00:00"
thumbsecsIntegerThe amount of seconds to delay before taking a snapshot of the video.
thumbextTextThe extension of the output thumbnail. Example: For JPG's this would be jpg
videoextTextThe extension of the output video. Example: For output FLV's, this would be flv
videomimeTextThe mime type of the output video.



FlashVideo API Functions

Along with those hooks, the FlashVideo module has also standardized the conversion routine so that calling it outside of the cron job is a simple task. Because of this change, the old function _perform_ffmpeg has been deprecated, and has been replaced with a more complete function called flashvideo_convert. Here is the information needed to convert any Drupal Video using this new method.

  • flashvideo_convert - More standard conversion routine to convert a video file into the Flash Format.
    Parameters:
    • $file - A Standard Drupal File Object.
    • $node_type - The current node type doing the conversion.
    • $params - An array of parameters... Used to override functionality. Leave blank if you wish to use defaults.. See Table Above for the whole list of parameters to override.
    Returns: TRUE on success, FALSE on failure.

Along with the simplified conversion routine, the FlashVideo module provides two additional functions used to easily retrieve any video or thumbnail in the system. These routines are described as the following...

  • flashvideo_get_video - Retrieves any Flash Video given the provided parameters.
    Parameters:
    • $node - A Standard Drupal Node Object.
    • $params - An array of parameters... Leave blank if you wish to use the default (First uploaded video of the given node).
      • index - Within a given node, this is the video index within that node.
      • node - The Node ID of any Drupal node.
      • fids - A string of File ID's to play in the format '34-21-35'. Note: You must have the flashvideo_playlist.php file in your root to use this feature.
      • file - The file name of the file you wish to show. Path is relative to the system files Directory.
      • autostart - String 'true' or 'false' to automatically play the video
      • width - Integer video width in pixels.
      • height - Integer video height in pixels.
      • id - String YouTube or Google Video ID.
    Returns: HTML code to show the video. "Video Currently Not Available" image if no video was found.

  • flashvideo_get_thumbnail - Retrieves any Flash Video thumbnail given the provided parameters.
    Parameters:
    • $node - A Standard Drupal Node Object.
    • $params - An array of parameters... Leave blank if you wish to use the default (First uploaded video of the given node).
      • index - Within a given node, this is the video index within that node.
      • node - The Node ID of any Drupal node.
      • fids - A string of File ID's to play in the format '34-21-35'. Note: You must have the flashvideo_playlist.php file in your root to use this feature.
      • file - The file name of the file you wish to show. Path is relative to the system files Directory.
      • width - Integer video width in pixels.
      • height - Integer video height in pixels.
      • id - String YouTube or Google Video ID.
    Returns: HTML code to show the thumbnail. "Thumbnail Not Available" image if no thumbnail was found.

I really like this

I really like this site.Thanks for sharing.
bates boots

links of london

I'm proposing

I'm proposing a new module: Media Mover which I've been developing.
geo parts

thank a lot for sharing

I am very interested

I am very interested.Can you plz post some more comments with more details in it .
electric guitar beginner lessons

I'm proposing a new module

I'm proposing a new module: Media Mover which I've been developing. While it's far from done, it implements a hook system for other modules to act as file harvesters, file processors.
Happy Casino

Nice and thanks for given

Nice and thanks for given information to us.
Research Paper

Thank you very much

I may need to learn and study more about Drupal Hook mechanism. Thanks!
Buy Cheap Computers Online

The video and storage are both complicated

The video and storage are both complicated and require a fair bit of specific kinds of configuration, I'm proposing a new module: Media Mover which I've been developing.
wiring diagram

i need to learn

I may need to learn and study more about Drupal Hook mechanism. Thanks.
NY Daily Paper

I'm working to get the code

I'm working to get the code cleaned up so that other people can start using it, but as it stands i have an integration with ffmpeg and amazon's s3 already running.
Notebooks Plus

I always enjoy visiting your

I always enjoy visiting your site. The content is always informative and enjoyable to read. I even have you bookmarked.

Fat Blockers

I always enjoy visiting your

I always enjoy visiting your site. The content is always informative and enjoyable to read. I even have you bookmarked. Thanks so much for the info you provide.
Digital Signage | Digital Signage | electronic cigarette

Auto Insurance Quotes

Everyone is running by cars now a days. And Insurance is most important terms on it. I will recommend you some good Auto Insurance Quotes Auto Insurance quotes provide by http://allinsurancereviews.com

Thanks for sharing this

Thanks for sharing this valuable information on this article

excellent post very informative

e-cig

Nice and thanks for given

Nice and thanks for given information to us.
cigarette filter

Rado watch for sale

fashion Tiffany Rings

This is a very new

This is a very new technology it seems to be . i m very interested.Can you plz post some more comments with more details in it . thanks for this post as well

frm jake Excalibur Investments Holding Ltd services

Excellent Tips

There are excellent tips, thanks for the inspiration!

Tactical Market is the great online source to get info about night vision products like ATN Night Vision , night vision camera, night vision rifle scope and more

Nice

Thanks for sharing this valuable information on this article
modern furniture

links of london Sweetie Bracelets

links of london Charms links of london Charms links of london Charms links of london Charms links of london Charms links of london Charms links of london sweetie bracelet links of london sweetie bracelet links of london Friendship Bracelets links of london Friendship Bracelets links of london Friendship Bracelets links of london Friendship Bracelets links of london Bracelets links of london Bracelets links of london Bracelets links of london Bracelets links of london sweetie bracelet links of london sweetie bracelet links of london sweetie bracelet links of london sweetie bracelet links of london sweetie bracelets links of london sweetie bracelets links of london sweetie bracelets links of london sweetie bracelets links of london sweetie bracelets

Re;

I've been working on various video solutions on drupal.
kamagra tablets wholesale
kamagra supplier
kamagra buy

Re;

It seems relatively easy, but I can't understand them all.
live football scores
live soccer scores
Live sport scores

I have created the

I have created the directories thesis | theses | thesis writing | buy thesis named ""video_import and "video_output" for import video and output directory for converted .
custom thesis | thesis help | online thesis

It seems

It seems relatively easy, but I can't understand them all. Probably, I may need to learn and study more about Drupal Hook mechanism. Thanks, anyway.
-----
Boggle

I've been working on various

I've been working on various video solutions on drupal. Because video and storage are both complicated and require a fair bit of specific kinds of configuration, I'm proposing a new module: Media Mover which I've been developing. While it's far from done, it implements a hook system for other modules to act as file harvesters, file processors, and file storage modules. This creates a plugable system to process files in multiple ways.
I'm working to get the code cleaned up so that other people can start using it, but as it stands i have an integration with ffmpeg and amazon's s3 already running.
Dogs for sale

what is the php syntax to

what is the php syntax to use the parameters? in particular for flashvideo_get_video?

i want to get a video of from an already exisitng node