Linode VPS Hosting, Starting at $19.95/month!

Get 2GB of Free Space from Dropbox

You are here

SWF Tools


SWF Tools allows you to easily embed flash content on your pages. You can use CCK filefields, use an input filter with [swf file="mymovie.swf"], or use PHP and call print swf('mymovie.swf');. The module consists of a number of components that you can choose to install. For example, you can choose a variety of embedding methods, such as direct embedding markup, or SWF Object 2 JavaScript. You can also enable support for a number of common media players, such as Wijering Player or FlowPlayer. When you enable those you can easily add video and audio content to your site simply by writing [swf file="myAudio.mp3"] or [swf file="myVideo.flv"]. SWF Tools will take care of everything to create your player.

SWF Tools also supports playlists. You can do this via CCK (upload a number of files and they will be assembled to a playlist), or you can us the input filter and [swf files="first.mp3&&second.mp3&&third.mp3"] will create a playlist in the media player you have chosen to use.

SWF Tools now also supports rtmp streaming, so you can let users skip through the content. To use that you just write a line like [swf file="stream.flv" stream="rtmp://server/application"].

The whole concept of SWF Tools is to let you focus on displaying media on your site, but without having to write code to enable it.

If you don't want to use CCK then you might want to investigate the related flash node project. This lets you create a new content type, a flash node, that takes a single file as an upload. It integrates with SWF Tools, so you simply upload an swf, flv or mp3, submit it, and you have media on your website. This is ideal for sites where you want to allow users to upload flash, audio or video content, but you don't want them to have to use a filter, and you don't want to expose PHP.

When setting up SWF Tools please be sure to read the documentation! It is not a particularly difficult module to set up, but it does take a little more effort than just downloading the main package. In particular, pay attention to the fact that you (a) have to download supporting JavaScript and media player files separately, and (b) you must install the supporting files in the right place!

SWF Tools 6.x-3.x is coming!

A BETA4 package is now available below. Please read this documentation page as the upgrade is a little different to just uploading the new files.

BETA4 has one absolutely massive change - SWF Tools now works with Views! Build a view that fetches a playlist, and send it directly to SWF Tools. Audio playlists, video playlists and slideshows are now all possible directly from Views with no third party modules needed. Views integration is built in and SWF Tools will present itself as a style. There are no docs yet, but see #581470: Playlist via Views for the latest discussions.

Other new features in this release are that SimpleViewer now requires SimpleViewer2, so you will need to upgrade your supporting library. The SimpleViewer module also supports TiltViewer, which works great with Views.

FlexPaper is now supported as a means of displaying PDFs in a flash based viewer.

SoundManager 2 support is in this release too, although it is the least stable of all the code and at this time is more "proof of concept", but it is functional.

What are people doing with SWF Tools

There are all sorts of sites using SWF Tools to add media to their site. use it for a weekly videocast, use it to provide podcasts. It's been used to showcase products, provide guitar tutorials, and show home videos to family. SWF Tools is designed to make it easy to put media on your site. If you know of a good example please post it in the issue queue!

New feature - FlowPlayer 3

FlowPlayer is a very nice looking media player that handles audio and video. The FlowPlayer3 module supports a wide range of configuration options, and when customising the player you can use the Farbtastic color picker to help choose colors (much easier than remembering hex codes!). To use FlowPlayer3 simply download the required files into swftools/shared/flowplayer3. FlowPlayer is a little more tricky to set up - you will need to download the player (the zip includes the player and the control bar plugin). Then for audio playback you need the audio plugin, and for rtmp you need the streaming plugin. All plugins are also installed in swftools/shared/flowplayer3. Note that the name of the player and the streaming plugin varies with each FlowPlayer release, so remember to visit the site configuration page and make sure the names match the ones you have!

Note - the new 3.1 release of FlowPlayer will work with the current SWF Tools module. Just remember to go to the settings page and change the player and plug in filenames to match the new version. The new version player doesn't have the bug with the audio plug in that was discovered by Drupal users! It should also play back flv files that have missing metadata.

New feature - Streaming

RTMP streaming support at the moment is limited to single files, primarily because I want to get the feature out in the open and tested. To stream a file just use the existing swf filter syntax, but supply the parameter stream. For example,

[swf file="movie.flv" stream="rtmp://server/application"]

Streaming support is available for Wijering 4 and FlowPlayer 3.

CVS strategy

If you are using CVS to pick up SWF Tools then you might find it helpful to understand how the branches are currently arranged, so that you can pick up the code that best suits your needs.

DRUPAL-5 is the current stable branch for SWF Tools 5. The end of this branch will contain the latest bug fixes. Code from this branch should always be stable and contain the very latest fixes that haven't yet been released. Use CHANGELOG.txt to work out what is in there.

At present there is no development branch for SWF Tools 5 as there are no new feature plans. The SWF Tools module is pretty complex so it is not always feasible to port features back. However, if someone REALLY wants a feature to come back from SWF Tools 6 it can be considered, and of course, patches and contributions are always welcome!

DRUPAL-6--2 is the current stable branch for SWF Tools 6. As for the D5 equivalent, this is stable code but it will contain the latest bug fixes that are ready for testing prior to a new release. If there is a specific bug fix that you are looking for, then this is the place to get it.

DRUPAL-6--3 is currently tracking new feature work for SWF Tools 6. The code is usually stable, but it may break at times. At present the main feature plan is to improve support for playlists, introducing better support for theming (particularly for FlowPlayer3 which lends itself to this), and more features to integrate SWF Tools with CCK. As this is work in progress the branch is great if you want to test a feature, but bear in mind the code may, at times, be broken.

HEAD will be used for SWF Tools 7 development, but this isn't underway yet. While I'd love to be able to commit to having a D7 release ready on launch day things are too hectic for me to make that promise right now! Sorry!!

Where next...

SWF Tools has come a long way since it was started by sime, and there are lots of people using it to enhance their sites with all sorts of media, so where is it going to go next? Clearly, there will be an SWF Tools 7. However, there is also a new project starting called embed which is trying to be a more generic way of adding objects such as audio and video to a site. It builds on SWF Tools, but does things slightly differently to make a lightweight system that ANY module can interact with. If embed works out then SWF Tools will remain as a means of getting your content out of CCK or an input filter, but some of the component parts will migrate to embed. All this would mean for you as an end user is that you would need both embed and swftools on your site. The intention of embed is to try and encourage other developers to support players via the embed module. That would mean that you get access to a wider range of players, and that all the effort can be focussed on making each player module as good as it can possibly be. And that's good for everyone!

Available Releases: 
Friday, July 9, 2010 - 20:58