Introduction

SWF Tools provides a lot of components and elements. While it is designed to work straight away when you download and install it you may want to (or need to) download and configure some additional software to make the best use of what it has to offer.

In particular the package that is downloaded from drupal.org doesn't, due to license requirements, include the javascript files for embedding methods like SWF Object 2, and it doesn't include the player files for media players like the JW Media player. To use these features you will need to follow the steps described below.

If you just want to try SWF Tools out, or just want to embed flash content and not use the media player features, then a basic installation is sufficient. The extra packages can be added at any time later.

Basic installation

Simply download the package from the project page, extract the files, and install the module under sites/all/modules/swftools (you could install it in the main module directory, but it is better practice to install contributed modules under sites/all/modules).

After the module has been installed, enable it from the Site building > Modules page. You will see that the SWF Tools modules are all grouped together under SWF Tools for convenience.

The "core" module is simply called SWF Tools and you must enable this one. This provides all the core functions of SWF Tools, and also includes the SWF Tools filter that can be assigned to input formats where you want to allow flash to be added. The core module provides the capability for direct embedding of flash content using a standards compliant version of the <object> syntax. The core package also provides access to a basic mp3 player, and a basic flv player. However, these players provide very limited functionality. SWF Tools is designed to work with a number of full-featured, third-party media players. You can take advantage of SWF Tools support for these players by downloading them from their respective vendors and configuring them to work within the module. See below!

Adding support for JavasScript replacement methods

You can enhance SWF Tools by enabling support for a JavasScript embedding method. SWF Tools is provided with modules to support SWF Object 2 (the preferred replacement technique) but it also includes support for SWF Object 1.5, jQuery Flash Replacement, and UFO (unobtrusive flash object). The latter techniques are more for legacy support and existing sites, and if you want to use JavasScript you should probably consider using SWF Object 2. SWF Object 2 code is also standards compliant.

To add support for a JavasScript method you will first need to download the supporting JavasScript package and add it to the correct location in the directory specified by your version of the module.

Note: File locations have changed between 6.x-2.x and 6.x-3.x

In 2.x and earlier versions, the methods and players go in the SWF Tools module directory, e.g. sites/all/modules/swftools/shared. In version 3.x, they instead go in sites/all/libraries. Refer to this page for details.

2.x and earlier

Method Download it from Install it to
SWF Object 2 http://code.google.com/p/swfobject modules/swftools/shared/swfobject2/swfobject.js *
SWF Object 1.5 http://blog.deconcept.com/swfobject/#download modules/swftools/shared/swfobject/swfobject.js
jQuery Flash http://jquery.lukelutman.com/plugins/flash modules/swftools/shared/lutman/jquery.flash.js
UFO http://www.bobbyvandersluis.com/ufo modules/swftools/shared/ufo/ufo.js

3.x and later

Method Download it from Install it to
SWF Object 2 http://code.google.com/p/swfobject sites/all/libraries/swfobject/swfobject.js
SWF Object 1.5 http://blog.deconcept.com/swfobject/#download sites/all/libraries/swfobject/swfobject.js
jQuery Flash http://jquery.lukelutman.com/plugins/flash sites/all/libraries/lutman/jquery.flash.js
UFO http://www.bobbyvandersluis.com/ufo sites/all/libraries/ufo/ufo.js

* The distribution file swfobject_2_2.zip extracts by default to ~/swfobject/. As mentioned above, SWF Tools requires that the subdirectory be named swfobject2. You will need to rename that subdirectory from swfobject to swfobject2.

After making sure that the necessary JavasScript package has been installed you can then activate the module by going to the Site building > Modules page and activating the appropriate SWF Tools module for the method you want to use.

Finally, you need to tell SWF Tools to use the method now it is available. This is done at the Site configuration > SWF Tools > Embedding settings page. Open the Embedding settings and choose the method you want to use as the default, and save the settings.

Note - you can activate more than one embedding module, and you can change the default setting at any time. So you can try out different embedding methods to see which you prefer.

Adding support for media players

Media player modules are added in much the same way as adding support for embedding methods. You download the required support files from the appropriate website, add them to a sub-directory under modules/swftools/shared, and then activate the appropriate SWF Tools module to enable it.

The media player modules let you add support for flash based mp3 players, flv players and image rotators. Some players just support playback of one file, while others support playlists of several files, or even mixed types.

SWF Tools comes with support for players as listed in the table below. The table provides a link to where you can obtain the support files, and shows where to install the files to.

Note: The table below describes only the SWF Tools 3.x locations. For 2.x and earlier versions, replace sites/all/libraries with the sites/all/modules/swftools/shared as per the note above.

3.x and later

Player Download it from Install it to
1 Pixel out http://downloads.wordpress.org/plugin/audio-player.1.2.3.zip sites/all/libraries/audio-player/audio-player/player.swf
FlowPlayer 2 http://www.tucows.com/download.html?software_id=519713&t=2 sites/all/libraries/flowplayer/FlowPlayerClassic.swf
Flowplayer 3 http://flowplayer.org/download sites/all/libraries/flowplayer3/flowplayer-3.x.x.swf
JW Image Rotator 3 http://www.longtailvideo.com/players/jw-image-rotator/ sites/all/libraries/imagerotator/imagerotator.swf
JW Media Player 4 http://www.longtailvideo.com/players/jw-flv-player/ sites/all/libraries/mediaplayer4/player-viral.swf
Simple Viewer http://www.airtightinteractive.com/simpleviewer sites/all/libraries/simpleviewer/simpleviewer.swf

Additional notes about Flowplayer 3:

  • Flowplayer 3 will extract to a flowplayer directory by default, but you need to rename this to flowplayer3.
  • You need to install all three files if you wish to support streaming video (the rtmp plugin) and audio playback (the audio plugin). Place the plugin files inside your flowplayer3 directory at the same level as the main player (flowplayer-3.x.x.swf).
  • You also need to tell the FlowPlayer 3 module what the player filename is, as this changes with each FlowPlayer release. You enter this at Administer > Site configuration > SWF Tools > FlowPlayer 3 (admin/settings/swftools/flowplayer3), under the Player and plugin files
    section.

After making sure that the necessary supporting files have been installed you can then activate the module by going to the Administer > Site building > Modules page and activating the appropriate SWF Tools module for the player you want to use.

Finally, you need to tell SWF Tools to use the player now it is available. This is done at the Administer > Site configuration > SWF Tools > File handling page. Open the File handling section, choose the player that you would like to associate with each type of media, and save the settings.

Note - you can activate as many media player modules as you like, and you can change the default setting at any time. So you can try out different players to see which you prefer!

SWF Tools status page (SWF Tools 6 only)

If when you go to the embedding settings or file handling pages you see Missing - Download here next to a method or player then it means that SWF Tools couldn't find the supporting files that are needed.

Check that you put the support files in the correct location and try the settings page again. If things still don't seem to be working then try the SWF Tools status page at Administer > Reports > SWF Tools status. This will show a series of tables indicating the current settings and status of available embedding methods and players. If a problem is detected then the tables will try to show a helpful message that suggest how to resolve the issue.

The correct placement of the supporting scripts and files is the key to a successful SWF Tools installation. Please make sure to follow the instructions carefully, particularly with regard to where you install the supporting files!

Comments

David Ting’s picture

Purpose: To share the solutions with new people who want to use SWF Tools but run into the 2 common problems:

(1) "JW Player 4 - Missing flash_media_player/player_viral.swf - Download here"
(2) "warning: Parameter 2 to wijering4_swftools_flashvars() expected to be a reference" - after saving the page or blog with a FLV file.

-----------------------------
(1) To solve the problem "JW Player 4 - Missing flash_media_player/player_viral.swf - Download here"

Inside the File Handling page, the option for "JW Player 4" has these words in red:
"JW Player 4 - Missing flash_media_player/player_viral.swf - Download here"

Details
I used drupal 6 with xampp on C:\ drive (inside Windows Vista).

The folder (directory) where the "JW Player 4" files are kept, need to have the name "flash_media_player"
( inside "sites\all\modules\swftools\shared\" (otherwise it will not work).

The full-path on my computer is: C:\xampp\htdocs\drupal6\sites\all\modules\swftools\shared\flash_media_player

Steps
(1) Download the JW Player 5 files.
Go to http://www.longtailvideo.com/players/jw-flv-player/ to download.

(2) Inside the folder "all\modules\swftools\shared\" - Create a new folder with the name "flash_media_player".
(3) Copy the 3 files - jwplayer, player.swf, swfobject.js (from JW Player 5) into the folder "flash_media_player".
(4) Rename the file "player.swf" to "player-viral.swf".

(5) To activate the module - go to Administer > Site building > Modules page
(6) Enable the "SWF Tools" and "JW Media Player 4" options.
(7) Click "Save Configuration".

(8) To choose the default player for FLV, MP3 and SWF Files:
- go to Administer > Site configuration > SWF Tools > File Handling.
(9) Inside the File Handling section:
- Select the option - "JW Media Player 4" (to be the default player for the FLV, MP3 and SWF files)
(10) Click "Save Configuration".

Result - Now, it does not show the message "Missing flash_media_player/player_viral.swf - Download here".

--------------------------
(2) A work-around to the problem "warning: Parameter 2 to wijering4_swftools_flashvars() expected to be a reference".

After inserting the FLV file, this message shows up after clicking the "Preview" or "Save" button (when writing a blog or story).

(1) Go to this link http://drupal.org/node/589326
(2) Read the Post #3 written by Stuart Greenfield
(3) Modify the file "swftools.module" based on the instructions
File Location is inside - C:\xampp\htdocs\drupal6\sites\all\modules\swftools

Result - Now it does not show the message "warning: Parameter 2 to wijering4_swftools_flashvars() expected to be a reference"
------------------------

David

GreenSkunk’s picture

Using SWF Tools 6.x.3.x and WordPress Audio player (used to be 1 Pixel Out?), see my comment at http://drupal.org/node/1118192#comment-4462000

"It is a damn poor day when you don't learn something!" - Mr. Jones, teacher

syngi’s picture

Are the suggested installation paths for the players correct? I had to install the JW player to 'sites/all/modules/swftools/shared/flash_media_player/player.swf'. See also my installation guide on #1243634: JW player installation guide.

Rob Cottingham’s picture

I'm pretty sure

sites/all/libraries/audio-player/audio-player/player.swf

should read

sites/all/libraries/1pixelout/player.swf

ThandavaPati’s picture

I am using SWF tools module to play .flv video files.
Its working but the controllers of the player are not getting displayed.