How to upload videos to Drupal 6 using Flowplayer

A year ago it took me a whole week to learn how to upload a video in Drupal 6 using Flowplayer. This is the translation to English of the instructions that will help whoever is in the same situation. After a whole year I still haven’t found out how to make it work, but I also have to recognize that I haven’t tried hard. First of all, I read the instructions from the original Drupal tutorial page. I then had to read them several times more to finally understand how to make my video work.

While uploading a video from YouTube or other similar services is really easy, uploading it to your own server requires way more work. And, as usual in Webdesign, there are several ways to do it. I started working with Flowplayer because, according to Google, it seemed a very good option. And since I made it work, I don’t regret my choice. Here is what I did:

What you need

First thing you have to do is download the files you are going to use. Please, notice that I used the latest versions at that time, so you will probably work with updated files. This also means the whole process may have changed a little, but hopefully not too much.

  1. SWFTools module for Drupal 6 (http://drupal.org/project/swftools)
  2. Flowplayer 3 files (http://flowplayer.org/)
  3. Swfobject2 files (http://code.google.com/p/swfobject/)
  4. Any video in FLASH format (.flv). As far as I know, this is the only format that will work. You can easily convert any video with free software that you may find on the Internet. I highly recommend Free Video Converter if you are lucky and work with Windows (I’m still looking for something similar for Mac).

How the magic works

Now that you have everything you need, you have to upload the files to the proper folder. Let’s start with the SWFTools module, which is the easiest: just upload the “swftools” folder to the “modules” folder in your Drupal installation. Once done, create inside this folder two new folders for the other files you downloaded:

  1. swftools/shared/flowplayer3: In this folder you have to upload the files flowplayer-3.0.5.swf ,flowplayer.audio-3.0.4.swf and flowplayer.rtmp-3.0.2.swf. In the instructions, at some point there is a little comment that says there is a bug with  flowplayer.audio-3.0.4.swf and that you need to change the file name to flowplayer.audio-3.0.3.swf. You will find all these files at Floplayer’s site, the first one included in the basic package and the other two among the “streaming plugins”. You may also like to download and put in your installation the file  flowplayer.controls-3.0.4.swf (also included in the basic package), which will add the control bar to your video player.
  2. modules/swftools/sharedswfobject2: You upload to this folder the file swfobject.js that you will find at http://code.google.com/p/swfobject/. Beware that versions one and two have exactly the same name, so be sure you take the proper one. If not, I assume that when trying to make the whole thing work Drupal will tell you the files that you are missing.

Once everything is installed, you go to admin/build/modules and activate the following modules: SWF Tools, FlowPlayer 3 and SWFObject2. Once activated, you configure everything (colors, sizes and many other things) at web/admin/settings/swftools. There are only two things with which you have to be careful: in Embedding Options > Embedding methods select SWFObject 2 – JavaScript; and in File Handling check everywhere that you are going to use Flowplayer 3.

The last step to have video in your site, and this is the trick that took me a long time to discover, is that you have to create a new Input Format (which I called “flash”, in a creativity attack) choosing the SWFTools Filter.

Videos have to be uploaded in .flv to sites/default/files, or (reading the instructions from the same tag SWF Tools> file handling> file locations) adding to our settings.php file these lines:

$conf = array(
‘swftools_media_url’ => ‘http://anothersite.com/media’, // No trailing slashes!
);

Where ‘http://anothersite.com/media’ must point to the folder where you are going to upload the videos.

Now you just have to create the content. You can use a page, a history or whatever you want, as long as you don’t forget to choose the FLASH Entry Format. Then, wherever you want the video (it can go either alone or among text) you just have to write <swf file=”myvideo.flv”>

In the end, I have to admit that I couldn’t get my player centered, so I just wrote in the CSS file of my theme the following lines, since I found that this is the DIV tag that SWFTools automatically generates to add the video:

/***flowplayer***/
.swftools-wrapper { text-align:center }

5 thoughts on “How to upload videos to Drupal 6 using Flowplayer”

  1. Hi, sorry for this offtopic question but i dont find the RSS Feed Link to add this Blog to my Feedreader. Could you please give me the URL? Thanks a lot.

    Greetings from Switzerland

  2. you said “The last step to have video in your site, and this is the trick that took me a long time to discover, is that you have to create a new Entry Format (whichI called “flash”, in a creativity attack) choosing the SWFTools Filter.”

    i just can’t get what did you mean by “create a new entry format”! can you please explain this step a bit more.

  3. @nubix: I think it’s just a translation error I’ll fix right now…. I think in the English version of Drupal it reads “Input Format”, but I wrote first this article in Spanish and didn’t check.

    Thanks for making me realize😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s