/silverlight_player_helper

A Rails Plugin to provide view helper for JW SIlverlight player

Primary LanguageRubyMIT LicenseMIT

JW Silverlight Player ActionView Helper (Rails 3.x and Rails 2.x Compatible)

What Is It?

silverlight-player-helper is a Rails plugin that presents an ActionView wrapper for rendering JW Silverlight Player by using silverlight

JW Silverlight Player is a popular open source Media player that supports WMV, WMA and MP3 format.

Getting Started

Rails 2.x

script/plugin install git://github.com/bagwanpankaj/silverlight_player_helper.git

Rails 3.x

railsplugin install git://github.com/bagwanpankaj/silverlight_player_helper.git

This will automatically do what is required by JW Silverlight Player.

If required files are not copied autometically under public directory then run

rake sl_player:install

How to use

First you need to include two javascript files into your views

<%= javascript_include_tag 'silverlight', 'wmvplayer' %>

then In your views use it like

<%= silverlight_player({:file => '/path/video.wmv',:width => 640, :height => 480}) %>

in which options contains hash of JW Silverlight variables. You can find list of those variables here
and player_config contains hash of player_id and path to xaml file.

More Info

This plugin provides you a helper method all option supported by JW Silverlight Player.

silverlight_player(options = {}, player_config={})

In options you can pass any variable supported by JW Silverlight Player. player_config contains the hash to define xaml file path, id that wraps player and css class to attach with.

Here are the list of options you can pass in player config
:player_id Defines id of player container (default: ‘silverlight_player’)
:player_class Defines the css class to be used for player container (default: none)
:xaml_file Defines path for xaml file. (dfault: ‘/others/wmvplayer.xaml’)
:player_message Defines message to be shown when something goes wrong with player initialization. (default: ‘The Player will be placed here.’)

For more info write me at bagwan.pankaj[at]railsjaipur.in

Copyright © 2010 Bagwan Pankaj, released under the MIT license