- This page is going to detail how to set up a simple website which enables you to upload a WMA or WMV file wo a Windows Streaming Media Services server, and also create a link in a SharePoint list with descriptions.
The purpose of doing this is to allow ordinary users to upload content to a streaming server, whilst utilising the search and accessibility features of SharePoint.
In this example, we are using a single server, which is running:
- Microsoft Windows Server 2008 R2
- Microsoft SharePoint Server Standard 2010
I am assuming that you already have a fully functioning SharePoint site that you can access.
For the purposes of this demonstration:
- The media server is accessible through: media.mydomain.com
- The SharePoint site is at: sharepoint.mydomain.com
- Media Content is being saved on the server in the D:\Media_Content folder
Installing Streaming Media Services 2008
Not going to dwell on this too much. Plenty of information can be found on Technet (http://technet.microsoft.com/en-us/windowsserver/dd448620).
Windows Media Services 2008 for Windows Server 2008 R2 can be downloaded from here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=B2CDB043-D611-41C9-91B7-CDDF6E5FDF6B
An installation guide can be found here: http://support.microsoft.com/kb/963697
Streaming Media Services is a role and is added through the Add Roles wizard after installing the MSU file.
Once you have installed the role, you can test that your Streaming Media Server is working by saving a file your content directory, and then creating an announcement.
Setting Up a Links List in SharePoint
The site creates URL’s on the SharePoint site in URL Lists. The site also shows you all of the available lists in the site that you can use for the media. In our scenario this allows us to separate all of the different categories of movies into different lists.
- In SharePoint, navigate to your homepage at http://sharepoint.mydomain.com.
- Create a new subsite called Media, using the Blank Site template – this reduces unneccessary clutter. Use a url name of ‘media’. (You can of course choose your own site and URL name)
- Browse to your new site and create a new list using the Links template. In this example we will call the list ‘My Cool Videos’. You can add a description to the list if you would like, and choose whether or not to show on the Quick Launch bar.
Done. You should now have a new URL list, inside a new site ready to accept your content.
You can customise the homepage and provide information to your users. For example, on our page we have information on how the content has been categorised, and also contact details for support. At the bottom we have information on how to upload content, and a link to the content upload page.
Setting Up the Upload Website
The actual upload website is separate from SharePoint.
- In IIS browse to Sites, right click and choose Add Web Site.
- Give the site a name, in this case I chose Media.
- Choose a physical path. This can be wherever you want according to your policies. In this case it is C:\Inetpub\Media
- Specify a binding. I have chosen to explicitly set the host name as Media, which allows me to ensure that it doesn’t affect my other sites. (Note, you will also have to create a CNAME record in DNS)
- Download the Upload Site Package from here:
- Delete the contents of the C:\Inetpub\Media folder on the server and replace it with the contents of the extracted files.
- Open up the c:\inetpub\media\upload\upload.aspx.cs file in notepad.
- You need to change the variables at the top. There are 6 in total
- SharePointURL – this needs to be the root of your SharePoint site. In this example it is http://sharepoint.mydomain.com
- MediaSite – the URL name given to the sub-site which is going to contain your media links. You need to put forward slashes around the name. In this example it is /media/
- ASXFileLocation – this is the location on the server where the ASX files will be saved. This needs to be a subfolder of the media website, so in this case it is c:\\inetpub\\media\\asx. The double backslashes are important as the act as escape characters.
- MediaContentLocation – this is where the uploaded media content will be saved. It can be anywhere on the server. In this example I have set it to D:\\Media_Content\\
- MMSServer – the address of the Windows Streaming Media Server. This must be prefixed with mms:// and end with the name of the distribution point that you set up in Windows Streaming Media Services earlier. In this example it is mms://media.mydomain.com/Media/
- UploadSiteURL – the web address that you use to access the upload site. In this example it is http://media.mydomain.com
- You are now set up.
In case you missed it above, here is the download link again.
All of the actions performed by the site run in the context of the currently logged on user. You will therefore need to check the following permissions for the users who you intend on using this function.
- C:\inetpub\media\asx – Assign the Modify permission to the users
- D:\Media_Content – Assign the Modify permission to the users
- SharePoint URL list – Assign the Contribute rights
I beleive that is everything, but will test again from a fresh install and update.
Let’s start simple. If you browse to http://media.mydomain.com you should be presented with a holding page. This just informs you that media cannot be accessed from here and to use the SharePoint site. It includes a link. You can customise this page by editing the index.htm file.
Next, if you browse to http://media.mydomain.com/upload you should be presented with the actual upload page. If you receive errors then you need to check that the variables set in step 8 above are correct.
The SharePoint list field should show the names of all of the SharePoint lists that you have created. In this instance, only 1 will show, called ‘My Cool Videos’.
If you have got this far with no errors, then great! Time to test adding some content.
Adding content is easy.
- Select the file to add by either typing in the path to the file or by selecting Browse and selecting the file.
- Fill in the details about the file, including Title, Author, Copyright Holder and any additional information. Only the title is compulsory, but other information is displayed in Windows Media Player when the file is playing. The Information field is used to populate the description of the URL in the SharePoint list.
- Choose a SharePoint list to add the link to.
- Click Upload
Once the content is uploaded you will have two information lines at the top of the page. One saying ‘The file has been uploaded’, and the second saying ‘Saved the New Item’.
If you get a ‘Server Error in ‘/’ Application’ as soon as you try to browse to the site, then it is most likely a problem with your variables, or the SharePoint site is unavailable.
To get some more information, open up the web.config file in the root of the website and uncomment the <customErrors mode=Off” /> line. Browse to the website again. This will give you a lot more information. Not useful for users (can be daunting) but great for you.
The Web Application at http://sharepoint.mydomain.com could not be found
Two options here: a) you have typed the address of the root of the SharePoint site incorrectly, or b) the SharePoint site is unavailable.
There is no Web named “/media”
The path that you have entered to the Media subsite does not exist. Check that you have entered the correct URL name. Be careful here, we are talking about the URL name, not the site name. If you are not sure, browse to the Media subsite and have a look at the address in the address bar.
Any other errors will only become apparent when you try to upload media. These will be shown at the top of the page and start “Error:”
Error: Could not find a part of the path ‘D:\Media_Services\Content1\System.String’.
The path you have specified to store the media content in is not accessible. Check it exists and update your variables.
Error: Could not find a part of the path ‘C:\inetpub\media\asx\filename.asx
The upload could not find the path specified. Check it exists on the web server and is set correctly in your variables.
Error: The type initializer for ” threw an exception
I have no idea why this happens. I have found that restarting the website on the server cures it. It seems to be more prevalent with SharePoint 2010 than with 2007.
Hopefully this is quite quick and simple to set up. I had it all up and running in a day, including writing the various web pages. I think providing you have a working SharePoint environment, there is no reason not to have this up and running within a couple of hours.
If you are experiencing headaches, please sent me a message from the Contact Me page and I will do my best to help.