This project is read-only.

How to install the Media Player Web Part

  1. Log into your SharePoint Server.
  2. Click Start
  3. Click Run
  4. Type in "%windir%\assembly" (without quotes)
  5. Drag drop the MediaPlayerWebpart.dll file onto the just opened folder
  6. Open notepad
  7. Click File
  8. Click Open
  9. Type in "%SystemDrive%\inetpub\wwwroot\wss\VirtualDirectories\" and hit ENTER
  10. Double-click on the folder that contains your web application [ identifiable by port number and hostname(if present) ]
  11. Double-click on web.config
  12. Find the line that contains "<SafeControls>"
  13. Copy & Paste the following code after that line: <SafeControl Assembly="MediaPlayerWebpart, Version=, Culture=neutral, PublicKeyToken=7e91954d53dba15b" Namespace="KhaledWebparts" TypeName="*" Safe="True" />
  14. Save the file and close notepad
  15. Open up your browser to SharePoint
  16. Go to any site within the site collection where you wish to install the web part
  17. Click Site Actions -> Create
  18. Under "Custom Lists", click Custom List
  19. Give the list any name you like (e.g. "MediaPlayerWebPartHTML") (this list will store the HTML code template to be used by the web part
  20. Choose 'No' for "Display this list on the Quick Launch?" and click on Create
  21. On the list, click on Settings->List Settings
  22. Click on Create column
  23. Name: "Value" (without quotes), Multiple lines of text, Plain text
  24. Click on OK
  25. Go back to the list and click on New
  26. For the title: type in the identifier for a HTML code template for the web part (e.g. JWPlayer)
  27. For the value: type in the HTML code, by using the following placeholders: $Title$, $Desc$, $Width$=300, $Height$=200, $File$, $Autoplay$ (The = sign represents a default value for the placeholder). Example code can be found at the bottom of this documentation.
  28. Click on OK
  29. Go to the root of the site collection where you wish to install the web part
  30. Click Site Actions -> Site Settings
  31. Under "Galleries", click on "Web Parts"
  32. Click on New
  33. Find "KhaledWebparts.MediaPlayerWebpart" and tick the checkbox next to it
  34. Click on Populate Gallery
  35. Navigate to any site within the site collection and click on Site Actions->Edit
  36. Click on "Add Web Part"
  37. Tick the checkbox next to MediaPlayerWebpart and click on "Add"
  38. On the just added web part click on edit->Export web part
  39. Save the file somewhere and open with notepad
  40. Look for "<property name="Listurl" type="string" />" and change into "<property name="Listurl" type="string">http://server/sitecollection/Lists/MediaPlayerWebPartHTML</property>" (change url to the one of your just created list, make sure you replace any %20 with a space)
  41. Look for "<property name="Query" type="string">&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='listnamefield' /&gt;&lt;Value Type='Text'&gt;listnamefieldval&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;</property>" and change listnamefield to Title and listnamefieldval to JWPlayer . (see screenshot)
  42. Look for "<property name="Listnamevalfield" type="string" />" and change to "<property name="Listnamevalfield" type="string">Value</property>" (Step 26) (see screenshot)
  43. Save the file and reupload back into the Web Part Gallery
Example HTML code for step 27
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{{$Width$=300}}" height="{{$Height$=200}}">
<param name="movie" value="/Shared%20Documents/player.swf" />
<param name="flashvars" value="file={{$File$}}&autostart={{$Autoplay$}}" />
<param name="allowfullscreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="/Shared%20Documents/player.swf" width="{{$Width$=300}}" height="{{$Height$=200}}">
<param name="flashvars" value="file={{$File$}}&autostart={{$Autoplay$}}" />
<a href="">
<img src="" alt="Get Adobe Flash player" />
<!--[if !IE]>-->

If anything is missing or unclear, please comment and I will do my best to respond as soon as possible!

Last edited Oct 29, 2010 at 10:08 PM by khaledelmansoury, version 3


EGlasheen May 6, 2011 at 6:11 PM 

I have everything working until the very last step.

Based on your HTML example in step 27, what video codec do I use and point to?

Currently I am using a small external .mp4 file pointed using an absolute url and the video will not upload into the player. The upload process stalls... no errors yet?