WordPress is probably one of the most widely used blog scripts in the Internet today and with the growing use of flash videos in the Internet (Youtube, Google Video), integrating both of these can cause a problem. Since WordPress filters out some HTML tags, unless you alter the PHP source script, you will have to use a modification. I personally prefer the mod called WP-FLV. Here is a small guide on how to use WP-FLV.
- Create a folder named wp-flv in the plugins folder.
The /plug-ins folder is located in the /wp-content folder, which is in the WordPress root folder. - Download the JW FLV Media Player, off which this modification is based on.
Go to www.jeroenwijering.com/?item=JW_FLV_Media_Player and download the player (the latest version is the first one under the History header). - Extract and upload the files into a new folder named jwflvplayer.
First create the folder /jwflvplayer and then upload the files from the archive into this folder. For this guide, after you extract, open the folder called /mediaplayer-x-xx (note that the x’s stand for number depending on the version you downloaded) and drag the files from there; don’t upload the folder itself. Also, you don’t have to upload the /source folder which is in the /mediaplayer-x-xx folder. So, by now /wp-content/plugins/wp-flv/jwflvplayer/ should have a file called mediaplayer.swf. - Download the WP-FLV modification.
Go to roel.meurders.nl/downloads/wp-flv.php.txt and save the file as wp-flv.php (without the .txt extension). - Upload the WP-FLV modification to your plugins folder.
Simply upload the wp-flv.php file to /plugins folder. This should the same folder where the /jwflvplayer folder is located. - Activate the WP-FLV on your WordPress blog.
In the admin control panel for your blog, click on the Plugins tab on the top and you should see the WP-FLV plugin listed there along with the other plugins. Click Activate the get the plugin working. - Point WP-FLV to the location of the JW FLV Player you uploaded.
Go to the Options tab on the admin CP. Now go to WP-FLV in the submenu (right below the tabs on the top). The first text box should ask you for the full url to flvplayer.swf. In my download it was called mediaplayer.swf, so we’ll point to that. First, type in the root URL for the blog and then add this: “/wp-content/plugins/wp-flv/jwflvplayer/mediaplayer.swf” (without the quotes). For this blog, it would be http://www.alvinjohnson.net/blog/wp-content/plugins/wp-flv/jwflvplayer/mediaplayer.swf. After your done, click Update Options on the bottom.
If you followed these steps correctly, the plugin should be ready to be used. Basically, this mod lets you embed FLV files by using a <flv> tag when creating posts. To use the tag, begin writing a new post and switch to the Code view. Now, there are four attributes for this tag. The “height” attribute alters the height of the video and the “width” attribute alters its width. The “href” attribute is where you type in the URL of the FLV you want to embed. And finally, the “autostart” attribute determines whether the video should start automatically or not.
Here are a few examples:
<flv href="http://www.example.com/video.flv" height="320" width="240" autostart="false" />
<flv href="http://www.example.com/video.flv" autostart="false" />
<flv href="http://www.example.com/video.flv" />
The first example used all the attributes, but the second one omitted the dimensions. When this happens, the mod uses the default dimensions (these can be edited in the WP-FLV sub-tab under the Options tab in the admin CP) As per the third example, you can also use the default autostart value, which can also be edited. You can also use the WP-FLV quicktag in the Visual view to help you out.
Here’s an example of how a finished product might look:
First the code:
<flv href="http://www.alvinjohnson.net/blog/wp-content/uploads/2008/02/riseagainst_prayeroftherefugee.flv" height="280" width="400" autostart="false" />
And the actual player (the video is a music video by Rise Against singing Prayer of the Refugee):
Update: As Steve has pointed out below in the comments, since JW FLV Media Player also supports extensions such as SWF, MP3, H.264, JPG, GIF, and PNG, streams, and playlists, you can also use them using WP-FLV. Just replace the href attribute with the desired source.