At some point I wanted to integrate a Silverlight based player into my blog, so I was looking for a WordPress plugin that would do that. However, I could not find any that was easy enough to use. So I decided to write one myself for self-educational purposes. This post describes and demonstrates the plugin that I wrote and explains how to use it to add Silverlight-based media players to blog posts and pages of a WordPress powered blog.
Description and Features
The plugin has the following features:
- Default player configuration settings, such as size, thumbnail, auto load and auto play.
- Per-instance player configuration settings that can be used to customize each individual player within or across blog posts.
- Unlimited number of players within the same blog post or page.
- Option to not load players on the home page of the blog. This helps to reduce the amount of content to download for visitors who do not want to watch a video.
- 6 player styles
Here is an example of how the media player plugin works:
Play Video
(the video may play with interruptions - my server’s internet connection is pretty slow)
Download and Install
Download the plugin from here:
WP Media Player (140.52 KB)
The plugin has been tested on WordPress versions from 2.5 up to 2.7. Once you downloaded the plugin files follow these steps to install and configure it:
Step 1: Unzip plugin files into your /wp-content/plugins/ directory. If you’re uploading it make sure to upload the top-level folder. Don’t just upload all the php files and put them in /wp-content/plugins/.
Step 2: Activate the plugin through the ‘Plugins’ menu in WordPress.
Step 3: Visit the plugin settings options (Options – WP Media Player) for Wordpress 2.3.x, (Settings – WP Media Player) for Wordpress 2.5.x-2.7

Usage walkthrough
To add a player to a blog post or a page, follow these steps:
Step 1: Encode the video to a Windows Media Video (WMV) format by using Microsoft Expression Encoder or Windows Media Encoder. If you use Windows Media Encoder then follow these instructions to properly encode the video content for Silverlight.
Step 2: Upload the video to WordPress either via FTP or by clicking on “Add Video” in the post editing page:

When uploading the video, take a note of the absolute URL path where the video file has been placed to. Do not click on “Insert into Post” button!

Step 3: Place the following tag inside of the blog post content where you want the video player to appear:
[mediaplayer src=”/absolute/url/path/to/video/file.wmv”]
Usage examples
To use a custom placeholder image instead of the default one use the “thumb” parameter, e.g.:
[mediaplayer src=”/absolute/url/path/to/video/file.wmv” thumb=”/absolute/url/path/to/thumb/file.jpg”]
To specify player’s width and height, use the “width” and “height” parameters, e.g.:
[mediaplayer src=”/absolute/url/path/to/video/file.wmv” width=320 height=240]
To change auto load and auto play settings use “autoLoad” and “autoPlay” parameters, e.g.:
[mediaplayer src=”/absolute/url/path/to/video/file.wmv” autoLoad=1 autoPlay=0]
Please try it out on your WordPress installation and let me know if you find any bugs or if you have any suggestions.
WP Media Player (140.52 KB)
View the original post
Comments