Recently I had to provide our users a way to display a list of Flash video files (FLV) with the ability to play the selected one. I found a similar solution on CodePlex, however, I did not like the idea to install a custom web part just to fulfill this requirement, and implemented instead my custom lightweight solutions using the standard SharePoint web parts. In this post I show you the implementation based on the Content Editor Web Part (CEWP), in a later post I publish another version based on the Content Query Web Part (CQWP).
It’s common in the implementations that they utilize Flowplayer version 3.2.16. I created a folder called flowplayer on the SharePoint server at 14\TEMPLATE\LAYOUTS, and from the flowplayer folder in flowplayer-3.2.16.zip copied the following files into the new folder:
style.css (from the example subfolder)
The Flash video files are stored in this case in a document library called “VideoLib1”. I set the Title property of the files to provide a short description of the content beyond the file name (Name property).
I’ve created a new web part page, added a new CEWP to the page, and set the source code of the web part according to the sample below:
In this script we request the Name and Title properties of the .flv files from our document libraries through the REST API, and add the required links to the play list. Alternatively one could use the Client OM as well, but in this case I found REST to be simpler.
If you don’t like this hack, you can get the URL through the Client OM as well, through an extra asynchronous call.
The image below illustrates the end result rendered by the CEWP:
Clicking on the title of the movie will start the video playback.
You can read about a similar solution utilizing CQWP here.