You are here

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

Namesort descending Location Description
hook_swftools_methods docs/swftools.php Reports an embedding method or a player to SWF Tools.
hook_swftools_playlist_PLAYER docs/swftools.php Processes a playlist ready for use by the specified player.
hook_swftools_preprocess_PLAYER docs/swftools.php Does the final preparation prior to rendering the specified player.
swf ./swftools.module Processes a file, or an array of files, and returns the relevant mark-up to render a Flash based player.
theme_swftools includes/swftools.core.inc Themes an swftools element by passing it on to the appropriate theme function.
theme_swftools_accessible_controls ./swftools.module Builds a list of accessible controls for the specified player.
theme_swftools_direct includes/swftools.core.inc Turns an SWF Tools data array in to markup for inclusion on the page, using W3C compliant HTML.
theme_swftools_embed includes/swftools.theme.inc Produces finished markup ready for inserting on the page.
theme_swftools_empty_image includes/swftools.theme.inc Returns a path to a default image.
theme_swftools_flowplayer3_accessible flowplayer3/swftools_flowplayer3.module Returns markup to enable accessible controls for Flowplayer 3.
theme_swftools_formatter_playlist includes/swftools.theme.inc Themes multiple value CCK content in to a playlist.
theme_swftools_formatter_swftools includes/swftools.theme.inc Themes a CCK element in to flash content.
theme_swftools_formatter_thumbnail includes/swftools.theme.inc Theme function to store and retrieve thumbnail images.
theme_swftools_html_alt includes/swftools.core.inc Themes the alternate HTML markup for an SWF Tools element.
theme_swftools_jw5_accessible jw5/swftools_jw5.module Returns markup to enable accessible controls for the Wijering 4 player.
theme_swftools_profiles profiles/swftools_profiles.module Hands an element to the appropriate SWF Tools formatter for theming.
theme_swftools_swfobject2 swfobject2/swftools_swfobject2.module Turns an SWF Tools data array in to markup and JavaScript for inclusion on the page.
theme_swftools_wijering4_accessible wijering4/swftools_wijering4.module Returns markup to enable accessible controls for the Wijering 4 player.
theme_swftools_wpaudio_accessible wpaudio/swftools_wpaudio.module Returns markup to enable accessible controls for the WordPress audio player.

Constants

Namesort descending Location Description
SWFTOOLS_ACCESSIBLE_DISABLED ./swftools.module Accessible controls should be disabled.
SWFTOOLS_ACCESSIBLE_HIDDEN ./swftools.module Accessible controls should be enabled but hidden.
SWFTOOLS_ACCESSIBLE_VISIBLE ./swftools.module Accessible controls should be enabled and visible on the page.
SWFTOOLS_ADMIN_RETRIEVE ./swftools.module Settings are being retrieved from the variables table.
SWFTOOLS_ADMIN_STORE ./swftools.module Settings are being stored in to the variables table.
SWFTOOLS_ALWAYS_ADD_JS includes/swftools.core.inc JavaScript will be added to all pages when they are served, even if SWF Tools isn't called directly.
SWFTOOLS_API_INSTALLED api/swftools_api.module Other modules can query whether SWF Tools API is present by checking for this constant.
SWFTOOLS_DEFAULT_HTML_ALT includes/swftools.core.inc The default alternate markup string that is displayed if the embedding process fails.
SWFTOOLS_DO_NOT_CLEAN_ID api/swftools_api.module Do not clean the id when the user supplies their own.
SWFTOOLS_ERROR_NONE ./swftools.module Don't write any error messages.
SWFTOOLS_ERROR_SCREEN ./swftools.module Write error messages to the screen.
SWFTOOLS_ERROR_WATCHDOG ./swftools.module Write error messages to the watchdog.
SWFTOOLS_ERROR_WATCHDOG_AND_SCREEN ./swftools.module Write error messages to both screen and watchdog.
SWFTOOLS_FLOWPLAYER3_CURRENT_PALETTE flowplayer3/swftools_flowplayer3.admin.inc Return the current palette for Flowplayer 3.
SWFTOOLS_FLOWPLAYER3_DEFAULT_PALETTE flowplayer3/swftools_flowplayer3.admin.inc Return the default palette for Flowplayer 3.
SWFTOOLS_FULL_SETTINGS ./swftools.module The calling function is requesting player settings and wants the full set, including blanks and defaults.
SWFTOOLS_INSTALLED ./swftools.module Other modules can query whether SWF Tools is present by checking for this constant.
SWFTOOLS_JAVASCRIPT_FOOTER includes/swftools.core.inc JavaScript will be added to the page footer.
SWFTOOLS_JAVASCRIPT_HEADER includes/swftools.core.inc JavaScript will be added to the page header.
SWFTOOLS_JAVASCRIPT_INLINE includes/swftools.core.inc JavaScript will be added inline with the page markup.
SWFTOOLS_MINIMUM_SETTINGS ./swftools.module The calling function is requesting player settings and only needs settings that are non-default.
SWFTOOLS_NON_XML_PLAYLIST ./swftools.module This playlist does not return xml but updates the data array directly.
SWFTOOLS_NOT_CACHED ./swftools.module The swf content was not available in the cache.
SWFTOOLS_PRIVATE_ACCESS_ALLOWED_EXTENSIONS ./swftools.module When private access via SWF Tools is enabled grant access to these extensions.
SWFTOOLS_PRIVATE_ACCESS_DENIED ./swftools.module SWF Tools does not allow access to private files by default.
SWFTOOLS_RETURN_CID ./swftools.module SWF Tools should return the cid for the content which was stored in the cache.
SWFTOOLS_RETURN_MARKUP ./swftools.module SWF Tools should return mark up to place on the page.
SWFTOOLS_UNDEFINED ./swftools.module Used in various places to indicate that the requested item is undefined.