JW Silverlight Player Helper for Rails
Recently while working on a project I needed to add JW Silverlight player. But I found it difficult to manually setup every thing. so to I started to build it in ruby way and extrated the code to make it plugin.
Silverlight Player Helper provides you an Action View Helper method available to all views and provides all required files that are needed to build the player.
JW Silverlight Player supports wmv, wma and mp3 file formats. List of all supported format can be found here
How To Use
To use silverlight_player_helper you first need to install it as a plugin
1 | script/plugin install git://github.com/bagwanpankaj/silverlight_player_helper.git |
And you are done. This command will automatically copies all required files to default folers under your public folder.
If it doesn’t do it automatically then run:
1 | rake sl_player:install |
this rake task will copies all files to required folders.
Now to use this plugin write
1 | <%= jw_silverlight_player(:file => '/path/to/your/file.wmv',:width => 640, :height => 480) %> |
The minimum required options are nothing. If no file is provided then it runs default file (supplied with plugin).
You can provide all options supported by JW Silverlight Player. These options can be found here
For more info write me at
bagwan.pankaj[_at_]railsjaipur.in