Much as I hate flash, it is a nice way to embed a sound or video player in a page. Here's how I did it in rails using the JW FLV Media Player. I added the following to my view:
1 <script type="text/javascript" src="/javascripts/swfobject.js"></script> 2 3 <% for oRssItem in @rssitems %> 4 <hr/> 5 <h3><%= oRssItem.title %></h3> 6 <p><%= oRssItem.description %></p> 7 <table width="470"> 8 <tr> 9 <td wIdth="50%"><%= oRssItem.created.strftime( "%m %B %y") %></td> 10 <td align="right"><%= link_to "Download", "/#{ oRssItem.filename}" %></td> 11 </tr> 12 </table> 13 14 <div id="player<%=oRssItem.id%>">This text will be replaced</div> 15 16 <script type="text/javascript"> 17 var so = new SWFObject('/mediaplayer.swf','mpl','470','20','8'); 18 so.addParam('allowscriptaccess','always'); 19 so.addParam('allowfullscreen','true'); 20 so.addVariable('width','470'); 21 so.addVariable('height','20'); 22 so.addVariable('file','/<%= oRssItem.filename%>'); 23 so.write('player<%=oRssItem.id%>'); 24 </script> 25 <% end %>
This generates a page full of podcast entries, each with a little media player thing so you can listen to them easily. This does mp3 files but it can handle video too.
I am aware that the swfobject.js would be better loaded in the html header.
Here's a demo: I don't know if this will work in the rss feed (UPDATE: no!) so bear with me and please be gentle on my bandwidth, it's quite a catchy tune:
The main reason I am blogging this is because it only needs a change to a view file and installation of two files in the /public directory (the player and a javascript file). Since view files are awkward to comment legibly I decided to document it all here so I can find it again.


Thanks for your post on embedding JW player. I can't seem to get it to work for my videos although I got another player to work for the same content. I just prefer JW's over the player I was using since 1. jw is free 2. the other player only plays and can't pause, rewind, or anything unless you pay.
I realize this would be a bit more work, but do you think you could do a video tutorial on how you did it.
Any help is appreciated.
Thanks