SWF Tools
Now with CCK filefield support
The new 6.x-2.4 includes support for CCK filefields. When you create a filefield you can assign SWF Tools as the field formatter, and your swf, mp3 or flv will be handed over to SWF Tools to render and display in the player of your choice. You can choose to include / exclude the download link for the file, so it's an easy way to create podcasts etc. If your content has multiple files you can choose to have them shown individually in separate players, or built in to a playlist in a single player or slideshow.
Overview
SWF Tools allows you to easily embed flash content on your pages using filter syntax like [swf file="mymovie.swf"], or by PHP using 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 of everything to create your player.
SWF Tools also supports playlists, so writing [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.
For even greater convenience you might also 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. Alternatively, you can take advantage of the built in CCK integration to render files that have been uploaded in a filefield.
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!
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.
HEAD 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 extend the streaming support to include playlists. As this is work in progress HEAD is great if you want to test a feature, but bear in mind the code may, at times, be broken.
At some point in the future HEAD will be used for SWF Tools 7 development. When this happens a new SWF Tools 6 development branch will be created.
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!
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-2.5 | 2009-Apr-27 | 152.52 KB | Download · Release notes | Recommended for 6.x | |
| 5.x-2.4 | 2009-Mar-09 | 118.79 KB | Download · Release notes | Recommended for 5.x | |
