SWF Tools in SWF Tools 6.3
Enables comprehensive support for Flash based media.
SWF Tools provides a convenient way to enable Flash based media within a Drupal website. It can be used to place a simple .swf file on the page, and the module is easily extended with other components to enhance its capabilities. Modules are available to enable play back of audio, video and image based content through a variety of Flash based media players.
The features of SWF Tools can be accessed in a number of ways.
For simple display of a single file directly within a node the module makes an SWF Tools input filter available. Enable this for an input format and Flash, audio and video can be rendered directly from within the node using [swf file="myFile.swf"] or [swf files="myAudio.mp3&&moreAudio.mp3&&otherAudio.mp3"]
From within PHP SWF Tools is accessed via a simple function call such as
$output = swf($file, $options);
It is also possible to include Flash, audio or video within a form definition by using the swftools element.
$form['mySWF'] = array(
'#type' => 'swftools',
'#value' => 'myFlash.swf',
);
SWF Tools has built in integration with CCK and Views. By default it will expose some basic formatters that can be used with file fields, text fields and link fields. These allow the fields to be rendered in to a series of discrete players, or assembled in to a playlist.
With the addition of the SWF Tools Profiles module different player setups can be created and these are all exposed as additional formatters. This makes it possible to have different styles of player associated with different CCK content types.
Integration with Views lets SWF Tools act as a handler to render a query into a playlist. For example, a query could extract all the uploaded files from a content type and return the five most recent items. The results can be passed to any player profile to be rendered. This makes it very simple to create a page or a block that shows customised views.
With players like LongTail Player and FlowPlayer 3 playlists can include a thumbnail image. This will be displayed in the player when it is waiting for the content to play, or as a background image when audio is playing.
SWF Tools supports a number of image gallery modules, such as SimpleViewer and LongTail Image Rotator. These can be used directly in a node as a formatter for a CCK content type, but they are most effective when used in conjunction with Views to generate a Flash based slideshow.
User topics:
Developer topics:
File
- docs/
swftools.php, line 8 - Doxygen documentation for SWF Tools.
Functions
Name![]() |
Location | Description |
---|---|---|
hook_swftools_methods |
docs/ |
Reports an embedding method or a player to SWF Tools. |
hook_swftools_playlist_PLAYER |
docs/ |
Processes a playlist ready for use by the specified player. |
hook_swftools_preprocess_PLAYER |
docs/ |
Does the final preparation prior to rendering the specified player. |
swf |
./ |
Processes a file, or an array of files, and returns the relevant mark-up to render a Flash based player. |
theme_swftools |
includes/ |
Themes an swftools element by passing it on to the appropriate theme function. |
theme_swftools_accessible_controls |
./ |
Builds a list of accessible controls for the specified player. |
theme_swftools_direct |
includes/ |
Turns an SWF Tools data array in to markup for inclusion on the page, using W3C compliant HTML. |
theme_swftools_embed |
includes/ |
Produces finished markup ready for inserting on the page. |
theme_swftools_empty_image |
includes/ |
Returns a path to a default image. |
theme_swftools_flowplayer3_accessible |
flowplayer3/ |
Returns markup to enable accessible controls for Flowplayer 3. |
theme_swftools_formatter_playlist |
includes/ |
Themes multiple value CCK content in to a playlist. |
theme_swftools_formatter_swftools |
includes/ |
Themes a CCK element in to flash content. |
theme_swftools_formatter_thumbnail |
includes/ |
Theme function to store and retrieve thumbnail images. |
theme_swftools_html_alt |
includes/ |
Themes the alternate HTML markup for an SWF Tools element. |
theme_swftools_jw5_accessible |
jw5/ |
Returns markup to enable accessible controls for the Wijering 4 player. |
theme_swftools_profiles |
profiles/ |
Hands an element to the appropriate SWF Tools formatter for theming. |
theme_swftools_swfobject2 |
swfobject2/ |
Turns an SWF Tools data array in to markup and JavaScript for inclusion on the page. |
theme_swftools_wijering4_accessible |
wijering4/ |
Returns markup to enable accessible controls for the Wijering 4 player. |
theme_swftools_wpaudio_accessible |
wpaudio/ |
Returns markup to enable accessible controls for the WordPress audio player. |
Constants
Name![]() |
Location | Description |
---|---|---|
SWFTOOLS_ACCESSIBLE_DISABLED |
./ |
Accessible controls should be disabled. |
SWFTOOLS_ACCESSIBLE_HIDDEN |
./ |
Accessible controls should be enabled but hidden. |
SWFTOOLS_ACCESSIBLE_VISIBLE |
./ |
Accessible controls should be enabled and visible on the page. |
SWFTOOLS_ADMIN_RETRIEVE |
./ |
Settings are being retrieved from the variables table. |
SWFTOOLS_ADMIN_STORE |
./ |
Settings are being stored in to the variables table. |
SWFTOOLS_ALWAYS_ADD_JS |
includes/ |
JavaScript will be added to all pages when they are served, even if SWF Tools isn't called directly. |
SWFTOOLS_API_INSTALLED |
api/ |
Other modules can query whether SWF Tools API is present by checking for this constant. |
SWFTOOLS_DEFAULT_HTML_ALT |
includes/ |
The default alternate markup string that is displayed if the embedding process fails. |
SWFTOOLS_DO_NOT_CLEAN_ID |
api/ |
Do not clean the id when the user supplies their own. |
SWFTOOLS_ERROR_NONE |
./ |
Don't write any error messages. |
SWFTOOLS_ERROR_SCREEN |
./ |
Write error messages to the screen. |
SWFTOOLS_ERROR_WATCHDOG |
./ |
Write error messages to the watchdog. |
SWFTOOLS_ERROR_WATCHDOG_AND_SCREEN |
./ |
Write error messages to both screen and watchdog. |
SWFTOOLS_FLOWPLAYER3_CURRENT_PALETTE |
flowplayer3/ |
Return the current palette for Flowplayer 3. |
SWFTOOLS_FLOWPLAYER3_DEFAULT_PALETTE |
flowplayer3/ |
Return the default palette for Flowplayer 3. |
SWFTOOLS_FULL_SETTINGS |
./ |
The calling function is requesting player settings and wants the full set, including blanks and defaults. |
SWFTOOLS_INSTALLED |
./ |
Other modules can query whether SWF Tools is present by checking for this constant. |
SWFTOOLS_JAVASCRIPT_FOOTER |
includes/ |
JavaScript will be added to the page footer. |
SWFTOOLS_JAVASCRIPT_HEADER |
includes/ |
JavaScript will be added to the page header. |
SWFTOOLS_JAVASCRIPT_INLINE |
includes/ |
JavaScript will be added inline with the page markup. |
SWFTOOLS_MINIMUM_SETTINGS |
./ |
The calling function is requesting player settings and only needs settings that are non-default. |
SWFTOOLS_NON_XML_PLAYLIST |
./ |
This playlist does not return xml but updates the data array directly. |
SWFTOOLS_NOT_CACHED |
./ |
The swf content was not available in the cache. |
SWFTOOLS_PRIVATE_ACCESS_ALLOWED_EXTENSIONS |
./ |
When private access via SWF Tools is enabled grant access to these extensions. |
SWFTOOLS_PRIVATE_ACCESS_DENIED |
./ |
SWF Tools does not allow access to private files by default. |
SWFTOOLS_RETURN_CID |
./ |
SWF Tools should return the cid for the content which was stored in the cache. |
SWFTOOLS_RETURN_MARKUP |
./ |
SWF Tools should return mark up to place on the page. |
SWFTOOLS_UNDEFINED |
./ |
Used in various places to indicate that the requested item is undefined. |