JW WMV Player

From LongTail Video Wiki

Jump to: navigation, search

The JW Player for Silverlight is a simple yet flexible player for displaying Windows Media video, audio and (live) streams on your website. While not yet widely installed and not as feature-rich as Flash, Silverlight is excellent for publishers who have content encoded in WMV or WMA. The player features a similar list of variables as the JW Player for Flash, with the exception of playlist support. The 1.1 version also introduces a javascript API.

Installation

This section describes a very simple installation. First, transfer the two .JS files and the. XAML file from the download ZIP to your website and include these lines in the header of your site:

 <script type="text/javascript" src="silverlight.js"></script>
 <script type="text/javascript" src="player.js"></script>

Next, setup an element you want the player to appear in and place the javascript that will actually place the player below it:

 <div id="myplayer">the player will be placed here</div>

 <script type="text/javascript">
	var elm = document.getElementById("myplayer");
	var src = 'wmvplayer.xaml';
	var cfg = {
		file:'/videos/myvideo.wmv',
		width:'320',
		height:'180'
	};
	var ply = new jeroenwijering.Player(elm,src,cfg);
 </script>

The cfg object in the code is the place to put your configuration variables. To quickly get the ones you want, use the setup wizard. Select an example, set the variables you want and copy-paste the code to your page. That's all!

When installing the player, make sure to refer to all files with the correct directory prefix! Also make sure to upload your videos to your website!

Documentation

All documentation of the JW Player can be found at the JW Player Wiki. It also includes the roadmap, source code and bug tickets. Note that there's no playlist and captioning support in the Silverlight version yet (waiting for SL 2.0). If you find a CMS module that uses the player, please report!

If you want to learn more about Microsoft Silverlight, I recommend you download the Silverlight 1.0 SDK. This SDK contains an extremely useful helpfile with a quickstart, some howtos and a complete reference. It's in a Windows help format, but MAC people can use Chamonix to view it.

Support

Anybody proficient with javascript will find that changing or adding to the player is quite simple. The Expression Studio Software is not really needed; a decent code editor will suffice. Since the XAML code is plain XML (a great idea), the design can be instantly edited as well.

All logic of the player is in the 600-lines wmvplayer.js file. The accompanying wmvplayer.xaml file contains all graphical elements (XAML is like SVG, or the graphics part of SWF). The third file, silverlight.js, is a small helperscript that places the Silverlight object on your page, showing a downloadlink if you haven't installed it yet. It is comparable to the SWFObject javascript for Flash.

Note that, despite the lack of built-in playlist support, you can easily set up a playlist with the player. Take a look at the excellent playlist examples from Lars Andersen and download his Periboea library.

A warning note: it seems that, when you install the Silverlight plugin on Windows without de-installing the previous version, IE Silverlight support will break! It'll probably be a temporary issue, but if you need to upgrade Silverlight make sure to de-install before installing the new version.

For tips, tricks, additional info and bug reports, you can always have a look at the support forum.

Personal tools