Mark Miller answered a question over at End User SharePoint on how to manage media files in SharePoint. The gist of the answer is "Don't use SharePoint to store them, just to present them and manage their metadata" – something I agree with as SharePoint isn't a complete replacement for a fileserver (yet).
This got me thinking and I decided to see if I could come up with a way to present the end user with media that:
-
Didn't require any administrative intervention
-
Didn't require any editing of pages
-
Allowed the viewer easy access to the content
As with pretty much anything you do with SharePoint there's always more than one solution to a problem so this is not the way of doing it, just one way of doing it.
I'd also like to point out that this isn't a tutorial or a how-to, just a description of a proof of concept. If anyone needs a more in-depth explanation I'll do my best to write one.
Servers
As mentioned above I don't believe in using SharePoint for bigger files (where "bigger" is 100-200 Mb and upwards) so we need to store the actual content somewhere. I'd also like to give the user a proper streaming "experience" – not just opening media files from a file share and for this I installed Windows Media Services 2008. I'm using Windows Server 2008 and IIS 7 but it should be fine on Windows 2003 and IIS 6 as well.
This leaves management, the presentation and the metadata to SharePoint – something it does really well. I'm using WSS 3.0 but the only real difference to MOSS is that you can get smarter filters and search functionality with MOSS.
The setup
So, Windows Media Services (WMS) and the content go on the same server. I set up WMS so that the default distribution point can serve up any file from a directory. I also share this directory so that users can upload content to it, thus making it available via WMS.
In WSS I create two lists; one document library where I store annotations to the media (could also be slideshows, course material or any sort of additional documentation) and one list to manage, and display, the media.
The Media library list is the interesting one and is set up like this:

Besides Annotations, which is a lookup based on the Annotations document library, there's only one really interesting column here and that's the Media column. This is where it all comes together and the magic that turns the pumkin into a chariot is Christophe's code for "HTML calculated columns". It's a very clever idea and I recommend you all to read his posts on the subject if you already haven't.
What the column does, in short, is that it uses the following code snippet to create the HTML needed to embed the media:
=<DIV><OBJECT id='WMP7' CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'><PARAM NAME='URL' VALUE='mms://media.spirex.se/" & [Filename] & "'><PARAM NAME='AutoStart' VALUE='False'></OBJECT></DIV>
The script from Christophe then makes sure that the above gets rendered properly instead of displayed as you see it above (which SharePoint would do by default).
I also created a view that displays the Media, Annotation and Tags columns, grouping on Media type and then on Title with the groups initially collapsed. This way the media player will only be visible when the users expands the file she wishes to access.
The end result
With the above setup all the user needs to do in order to serve up streaming media via the SharePoint list/site is:
-
Upload the media to the media server library
-
Create a new entry in the media library list in SharePoint, using the proper information (filename, tags, annotations, etc):

This fulfills the requirements I set up and lets the various technologies (WMS and WSS respectively) do what they do best.
I have set up a small demonstration site for this but be aware that it runs on my virtual test rig in my closet so if performance goes AWOL, just come back later.
Thanks for reading and please share your thoughts in the comments.
– Martin Edelius