in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Alex Pearce's SharePoint Blog

Alex Pearce

Media Player Web Part: Updated

Steve Sofian posted on his blog about the Media Player Webpart for MOSS.

I went to install it on another web application earlier today and found his blog has gone.

Steve, if your reading this I hope you don't mind me posting it again.  All the credit is yours.

This webpart allows you to play avi, mpg and wmv files with in your MOSS site.

Open the root folder of your site.  Default location is C:\inetpub\wwwroot. 

If you don't know your default root open IIS and right click on your website (default website), properties.  Click on the home directory tab and it will show you the location.

Always make a copy of a file before making changes to it

Open web.config in notepad

Find </SafeControls> within the text.

Above that text add the following.

<SafeControl Assembly="MediaPlayerWebPart, version=1.0.0.0, Culture=neutral, PublicKeyToken=4907dffeafb11512" Namespace="NFWebParts" TypeName="*" Safe="True" />

Save the file.

You will notice your site takes a while to load again.  If you edit web.config your site has to restart - which will happen automatically.

Copy mediaplayerwebpart.dll to the bin folder in the root of the your website.

On your top level site go to Site Settings. Under the heading of Gallery you will see Web Parts - When the list has appeared you will see all the webparts that are currently being used on your site.

Click on new - if you have added the code to web.config and the file to the bin folder you will see the web part listed at the bottom.  Check the box next to it and click on populate.  This will add the webpart call mediaplayerwebpart.

Download the file from here: http://www.sharepointblogs.com/files/folders/ajp/entry3059.aspx

Things to watch out for

  • You have to enter the size of the video. I would recommend 320 width and 240 height - like the picture above.
  • Remember when creating the video that the user from home or within your LAN needs to be able to stream the video. If the video bites for second are high than their download speed they will have trouble streaming and watching it.

Published Jul 18 2007, 04:30 PM by apearce
Filed under: ,

Comments

 

Links (7/18/2007) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (7/18/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

July 18, 2007 6:42 PM
 

Sharepoint 2007 link love 07-19-2007 at Virtual Generations said:

Pingback from  Sharepoint 2007 link love 07-19-2007 at  Virtual Generations

July 19, 2007 5:00 AM
 

Replicant said:

This looks great! Do you have one for WSSv3.0?

July 20, 2007 11:09 AM
 

apearce said:

It should work in WSS

July 20, 2007 4:42 PM
 

akkurt said:

didn't work, but then, what does in sharepoint?

July 24, 2007 10:12 PM
 

John said:

Can you elaborate on the following:  "populate the mediaplayerwebpart"  I would like to know how to do this.  Thanks!

July 25, 2007 5:32 PM
 

John said:

Can you elaborate on the following:  "populate the mediaplayerwebpart"  I would like to know how to do this.  Thanks!

July 25, 2007 5:32 PM
 

akkurt said:

Ok, i guess I should elaborate.

I installed everything as per the instructions. When I refresh my webparts list I do not see the media player web part in the list to add to a page. Any help would be great. I do have a couple other things working in sharepoint but do not have the experience yet to troubleshoot effectively. With a little more experience I will contribute back to this post as I build a couple sites I have planned to build.

Thanks again and sorry for the attitude of the last post.  ;)

July 25, 2007 7:40 PM
 

apearce said:

I'll edit it later on for you all with full instructions

Sorry!

July 26, 2007 11:13 AM
 

PaulE said:

How to "populate the mediaplayerwebpart"? For WSS 3.0 and MOSS 2007, you can follow these steps:

Open your browser and go to the SharePoint site you wish to add the webpart to. Under Site Actions, click Site Settings. If you're not at the top-level, "Go to top level site settings" will be shown under Site Collection Administration; click it. Once there, or if you are already at the top-level, the Galleries group will show "Web Parts"; click it (installed webparts will be shown). Click "New" and find "NFWebParts.MediaPlayerWebPart". Check it and click the Populate Gallery button at the top of the screen. A .webpart file will be created and the web part will be added to the Gallery thus making it available to be added to your web part zones in your site and it's sub-sites.

July 26, 2007 1:03 PM
 

apearce said:

thanks to paulE who has added the comment - i;ve updated the post too

July 26, 2007 1:23 PM
 

Todd Klindt said:

I've added it to my page but it doesn't seem to open.  I see the title bar and the settings drop down but regardless of what link I put to a WMV file I don't get the Windows Media Player interface.  Site is in my Local Intranet zone if that matters.

Second, I see that I have the setting to allow connections.  Will this web part allow me to provide a value to it, for instance from a list view web part?

Thanks,

tk

July 27, 2007 3:23 PM
 

apearce said:

Todd, have you put the size of the video

July 27, 2007 5:45 PM
 

John said:

is there a .dwp file that I need to import for the media player web part?

July 30, 2007 2:19 PM
 

apearce said:

Download the file from here: www.sharepointblogs.com/.../entry3059.aspx

Its in a zip file

July 31, 2007 3:38 AM
 

Joost said:

Hi,

does this only work for one file. I have several avi files which i all want to display in this webpart. Is this possible. When i look at the properties i can only add one video. kind regards, Joost

August 3, 2007 4:08 AM
 

Joost said:

I can't get it to work, i have the same issue as Todd. Can you help me out. How to reference the avi to be streamed in the site. tnx

August 3, 2007 9:25 AM
 

apearce said:

Joost,

you can only run one video is each webpart - you can of course add the webpart several times to your site.

Having added the webpart to your site you need to modify the webpart (Modify Shared Web Part) on the page you have video is going to play on.  Under  Miscellaneous you add the URL of the video and also the size of the video.

Alex

August 3, 2007 1:47 PM
 

Joost said:

thank you for replying. I have done all things you said..i see the media player webpart and i have configured it.

url looks like

/documents/createfaces.avi (is that correct)

i have set the width to 790 and the hight to 390. I have also tried lower values (like you said in your example)

When i click play nothing happens, when i click the avi windows media player fires up (which is the correct behaviour i guess)

do you have any tips where to find?

August 6, 2007 3:18 AM
 

apearce said:

I get the URL of the video by going to the documents area where the video is stored - if you left click it downloads the video - if you right click you get your normal internet explorer options and click on copy shortcut.  I use this copy for the URL in the web part.  

A.

August 6, 2007 7:49 AM
 

SteveS said:

I followed the instructions and it works fine however I'm now getting errors in my application event log like this:

Error: Failure in loading assembly: Microsoft.SharePointLearningKit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=abc4ed181d6d6a94

Doesn't appear to hurt anything but curious if there's a tie between the media player web part and the SLK?  I don't have the SLK installed nor do I have a need for it.

Thanks!

August 7, 2007 9:25 AM
 

apearce said:

this was a mistake on my part - i copied two lines from my web.config - i updated the blog about a week ago to delete it. - just delete the line from web.config

Thanks and sorry

August 7, 2007 9:57 AM
 

SteveS said:

No worries.  I should have looked at that.

Thanks!

August 7, 2007 3:55 PM
 

Blog del CIIN said:

Después de unas semanas de vacaciones (cortas :PPP), aqui estamos de nuevo en el CIIN al pie del cañón

August 16, 2007 1:47 AM
 

Sri said:

Hi

thanks for the webpart, this is really nice, i am able to view the video from my sharepoint site, but when i try to modify the webpart, that menu is hidden by the video, is there any way to view the modify webpart menu in from of the video.

thanks in advance

sri

August 16, 2007 3:57 AM
 

apearce said:

i;m not too sure what you mean - can you send me a screen dump please.

Thanks

August 16, 2007 4:20 PM
 

Leeuwenborgh Opleidingen said:

Mediaplayer Webpart

August 23, 2007 3:13 AM
 

Marc said:

Hi,

Is it possible to have the code source of the MediaPlayerWebPart web part ?

Thanks

September 3, 2007 4:37 AM
 

apearce said:

Would love to post it but I dont have it - the web part came from a blog that is nolonger there - i dont think Steve ever posted it on there either.

Sorry

September 5, 2007 6:36 AM
 

swvw said:

Hi

Great Web Part many thanks!!!

Is there any way to but it on repeat?

Thanks

September 12, 2007 4:53 PM
 

apearce said:

could you let me know what you mean by repeat?

Thanks

A.

September 13, 2007 2:17 PM
 

mbeattie said:

Great post ... really handy.. works well and is just what i was looking for.....instructions really clear

September 27, 2007 6:25 AM
 

Wayne said:

We just installed this on our farm and it works well for the main portal, but we have had to repeat the process of going through the populate webpart for each of the mysites. While some are able to follow the process, some users are like a deer in the headlights. So, is there an option to push to all mysites?

September 28, 2007 3:50 PM
 

apearce said:

Wayne,

I've not tried it in the my site area yet but will have a play and let ou know how i get on - alex

October 1, 2007 2:32 PM
 

esteban said:

hi, could you tellme if this component are available on sharepoint 2003?

October 4, 2007 3:31 PM
 

Ryanph said:

I have walked through these steps (copied the .dll to the _app_bin folder in netpub\wwwroot directory, and modified the web.config file, performed an IISReset and I don't see the NFWebParts.MediaPlayerWebPart WebPart displayed in the WebPart Gallery.

Can anyone tell me what else needs to be done, so I can get this webpart added to my MOSS 2007 environment?

October 7, 2007 2:20 AM
 

Life of a Sharepoint Developer » Sharepoint Webpart: Media Player said:

Pingback from  Life of a Sharepoint Developer &raquo; Sharepoint Webpart: Media Player

October 24, 2007 8:07 AM
 

Brian said:

I have the same issue than Ryanph. I don't see the webpart in the list.

November 7, 2007 11:47 AM
 

apearce said:

When i have seen this - the main issue is because th <safecontroller assemble> is in the wrong line - it needs to be able  above <SafeControl>

November 7, 2007 5:26 PM
 

Brian said:

apearce,

I've put the line you've said within the web.config file (in the place you told to), then i put the .dll in the bin directory, but it doesn't seem to work.

Am i missing something?

Do i have to have something installed?

I mean, like the DirectX 9 SDK, to use the avi playing feature, or i should see the webpart in the list any way.

November 8, 2007 7:08 AM
 

Steve Sofian said:

Alex,

I just saw your post and appreciate that you actually are able to post it back again....I have lost that post when this site goes down :(

I will be moving my blog to www.stevesofian.net.

I am working on a new silverlight media player and still have some minor issues to fix

cheers

November 26, 2007 1:32 PM
 

kIran said:

Great webpart Mr.A.

Can u share your experience with us, in developing the same

December 6, 2007 6:38 AM
 

JHenao said:

Is this requires windows media player on the client side? if the answer is yes, what version?.

Thanks!

December 7, 2007 5:36 PM
 

apearce said:

It depends on how the video is encoded.

Alex

December 8, 2007 11:24 AM
 

Rnunley said:

I opened the web.config file and there is no </SafeControls> text.

Thoughts????

December 13, 2007 7:03 PM
 

Bravo Computers UK said:

I have looked at all comments and noticed that everyone is asking how to play multiple files with one web part,  i am going to try and create a playlist and run that on my site to see if it will work.  if it does i will inform you all and even send the information of how to create a playlist(s).

back soon

January 3, 2008 4:30 PM
 

Stefan said:

Bravo,

Did you have it to work yet, I'm looking to integrate this Windows Media webpart to my central site and play from a list of video files instead of single or creating mulitple web parts.

Please share if you have the concept working.

January 8, 2008 12:48 PM
 

Ceba said:

where would the docs (url) referenced.  or do i need to create this..  any help and steps would be welcomed.

January 9, 2008 4:24 PM
 

Bernardo said:

Please, how i see video in full screen with double-click ???

Thanks

(sorry by my poor english)

January 11, 2008 12:28 PM
 

apearce said:

The webpart only allows videos to play with in that web part.

January 12, 2008 4:09 AM
 

Darrin Bishop said:

SharePoint and Videos

January 17, 2008 8:18 PM
 

Daniel A said:

Rather than going through this heart ache, just add a content editor web part and use the below HTML

<OBJECT id="VIDEO" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">

       <PARAM NAME="URL" VALUE="/Docs/[Your Document Library]/[folder]/[your file.wmv]">

       <PARAM NAME="animationatStart" VALUE="true">

       <PARAM NAME="transparentatStart" VALUE="true">

       <PARAM NAME="SendPlayStateChangeEvents" VALUE="True">

       <PARAM NAME="AutoStart" VALUE="false">

       <PARAM name="uiMode" value="full">

</OBJECT>

January 18, 2008 3:41 AM
 

Aubrey said:

Daniel A-Where in the code do you enter the object code you provided?

January 28, 2008 3:04 PM
 

apearce said:

you add it to a content editor webpart in the source code

January 29, 2008 3:41 AM
 

bravo computers said:

im in the process of working out options using the sharepoint document libaries

then i will upload a full how to on my site (link to follow)

January 31, 2008 9:16 AM
 

bravo computers said:

OK

if you need WMP to play more than one file can you please contact me @ bravo.computers.nospam@.removethis.btinternet.com

i will then send the template file to you and instructions on how to

this i untill i can get my blog up and running

in the mean time i will find a free sharepoint host and install this web part on with a how to

will post back here with links.

Regards,

Bravo Computers UK Sharepoint Design team

January 31, 2008 10:56 AM
 

bravo computers said:

in view of repeating a file you can also use my file which not only let you play multiple files but allow you to repeat the file(s) unlimited or a set number of times.

email me above to get the file

January 31, 2008 11:14 AM
 

tholland said:

I am receiving a blank screen but still getting the audio ofthe video when I deploy this web part - any ideas on what the problem might be?

No issues with seeing the video footage when playing it directly or when playing it using the Content Editor web part.

Thanks

February 4, 2008 11:51 AM
 

Mihow said:

Is it possible to get a steam from lets say a web camera and play in this web part?

if I'm streaming on different machine(http://ip:port)

Can i get somehow this stream and stream trought this webpart.

Sorry if i have missed if there was any similar questions.

February 8, 2008 7:21 AM
 

Oscar Boscalasco said:

This couldn't have been better explained and thusly could not have worked more flawlessy.  A big thanks to the original poster and to you Alex.

February 14, 2008 4:40 PM
 

Alex Pearce's SharePoint Blog said:

My team and I have been playing with Windows 2008 Server RTM and have been playing with the downloadable

February 21, 2008 5:21 AM
 

SHAREPOINTBlogs.com Mirror said:

My team and I have been playing with Windows 2008 Server RTM and have been playing with the downloadable

February 21, 2008 5:31 AM
 

Pavan Raj said:

Thanks a lot ...It worked out for me ...I just want to know is there any expirary date for .dll file .

Pavan Raj.

February 25, 2008 6:46 AM
 

John said:

This thing worked great for us to stream!  Thanks!

February 27, 2008 11:32 AM
 

Mark said:

The content editor approach from  Daniel A  works with IE but fails with Firefox.  Why would that be?

March 20, 2008 2:03 PM
 

bravo computers uk said:

ok the timescale is taking longer than expected however.

to pay multiple files you need to upload the files to an online directory (a free file host or a sharepoint document libary) then you create an ASX file (search the windows technet for how to make a windows media playlist) then upload the playlist file (asx) into a document libary and then modify the  <PARAM NAME="URL" VALUE="/Docs/[Your Document Library]/[folder]/[your file.wmv]">

to mach the direct link to the asx file (ie. <PARAM NAME="URL" VALUE="yourwebsite.com/.../playlist.asx"> or <PARAM NAME="URL"VALUE="/Docs/[document libary]/[yourplaylist file.asx]"> as i said before i am in the process of making a HOW TO in playing multiple files using WMP and sharepoint.  but due to very long work hours it is taking longer than expected.

any problems or if you want a basic playlist made in a hurry let me know and i can send a template, address is somewhere above.

Regards,

Bravo Computers UK

March 31, 2008 4:20 PM
 

Bravo Computers UK said:

Firefox is a toaly different browser.  best thing to do is search how embed windows media player to work in firefox. <a href="forums.mozillazine.org/viewtopic.php here</a>

March 31, 2008 4:24 PM
 

Satish said:

Hi I can see the window media player, and it shows ready but doesnt show the movie.

can anyone help me to sort out this probelm

April 9, 2008 6:41 AM
 

California geek said:

The instructions in Daniel A's post @ 18 Jan 2008 work just fine on MOSS 2007.  Here’s how I got them to work (apologies in advance if this comes off as pedantic – I’m just trying to help keep others from pulling their hair out like I did):

1.  Make sure your video is actually encoded in a format that the Windows Media Player (WMP) plays.  If it ends in .wmv you should be fine, unless some dope just changed the three character extension on a format that *won’t* play on WMP (such as MPEG-4).  For a list of supported formats, see support.microsoft.com/.../316992.

2.  If the video is *not* encoded as an .asf or .wmv file, make sure that the appropriate codec is installed on the computer that’s going to access the SharePoint page containing your video (let’s call this the “video page”).  I believe that WMP version 9 and later will try to download missing codecs, but I’m not certain of this.  (Another reason to try to keep everything Microsoft-flavored when your working in SharePoint.)

3.  Post your video to SharePoint FIRST, i.e., BEFORE adding the Content Editor Web Part.  I have found that there are fewer headaches if you upload the video to an “Images” document library instead of somewhere else.

4. Go to the video page.  Change to edit page mode, and click on one of the orange bars on the page that says “Add a Web Part”.  Scroll down and check the box marked “Content Editor Web Part” (on my system, this is the first web part listed under the “Default” heading”).  Click “Add”.  Follow the instructions and click on the link to “open the tool pane”.  

IMPORTANT:  Do *not* open the Rich Text Editor.  Instead, open the Source Editor (the button right below the Rich Text Editor button).  If you put the code in the Rich Text Editor, it will likely be ignored, and you’ll get nothing but blank content.  (Honestly, this only happened to me once, so if Microsoft has fixed this, I wouldn’t know.  I’m too busy to try.  You’re posting HTML code anyway, so why not post it where it’s intended to go?  But I digress...)  ALSO IMPORTANT:  Be sure you are actually adding this code to the "Content Editor Web Part", and not trying to stick it into something that *looks* like it takes code.  For example, some templates pre-populate the page with an editable area called “Page Content” or “Page Image”.  Don’t try to paste your code in these, or you’ll get the same result as using the Rich Text Editor: nothing.  Only use a web part that you’ve added to the page.

5.  Now, go to Daniel A's post above, select and copy the code, and then paste it into the now-open Source Editor.  Click Save.  DO NOT PANIC.  The WMP should appear on the screen in the web part, but IT WILL NOT WORK YET.  You need to add one more piece of information.

6.  Go to the Images document library where you uploaded your video.  It should appear as a listing on the library’s default view (which is the fancy way of saying it’s what you’re staring at when you visit the Image library for the very first time).  Locate the link with the name of your video, right click on the link and select “Copy Shortcut.”

7. Go back to the video page.  If you’re still in editing mode, click on the “edit” drop-down box for the Content Editor Web Part you added and select “Modify Shared Web Part.”  The tool pane will open on the right margin as before.  Click the “Source Editor” button.  The “Text Entry – Web Page Dialog” box will re-open, showing Daniel A’s fine code that you pasted in there a few moments ago. Locate the second line of code (it starts with a left angle bracket followed by PARAM NAME=”URL” and the rest of Daniel A’s code on that line).  Carefully place your mouse cursor to the right of the third double quote mark (i.e., immediately to the left of  /Docs) and delete everything up to (but not including) the next double quote mark.  You will now paste the shortcut (i.e., the path to your video on SharePoint) between these double quote marks by right clicking your mouse and selecting “Paste”.  The full line should now look something like this:

<PARAM NAME="URL" VALUE=”servername/.../YourVideo.wmv”>

Click Save, and Close.  Be sure to “Publish” your page by clicking the button at the top.

Microsoft still requires you to “activate” the WMP to make it work, but this just means you need to click anywhere on the surface (as you’ll be instructed to do).  Press play and your video should play.

April 13, 2008 12:37 AM
 

apearce said:

Thanks for this great post

Alex

April 14, 2008 3:02 PM
 

spurr82 said:

Where can you store the videos to play in the wp?

I see how the location is added, but i cannot put the files anywhere as i dont think it supports the storing of the file type (wmv)

May 9, 2008 6:30 AM
 

apearce said:

upload your video files into a document library and then link to them in there.

May 10, 2008 3:37 AM
 

P.Venkateswara Rao said:

Is it applicable for WSS 3.0?

I was applied this in WSS 3.0 but I'm getting a  "Server error" message.

Thanks

May 10, 2008 6:16 AM
 

apearce said:

It should work for both WSS and MOSS

May 12, 2008 2:28 AM
 

sab0900 said:

I am getting a runtime error when I try to open my WSS 3.0 site.

May 12, 2008 8:10 PM
 

Trackback « SharePoint Diva said:

Pingback from  Trackback &laquo; SharePoint Diva

May 23, 2008 3:11 PM
 

MikeP said:

As per Daniel A's post @ 18 Jan 2008, I have a question....

Is there a way to change the size of the video player once this code is posted?? Thanks.

June 12, 2008 4:53 PM
 

Chrysalis said:

Use the reflector tool to get the entire source code...

June 22, 2008 7:22 AM
 

Lipitor unusual side effect. said:

Generic for lipitor. Lipitor dosage morning or night. Side effects of lipitor drugs. Lipitor. Lipitor muscle nerve pain.

July 7, 2008 5:39 PM
 

How people abuse ultram er. said:

Ultram drugs. Ultram.

July 9, 2008 10:51 PM
 

Chris said:

Awsome web part. It works great. It took me a minute to edit the part and configure it to work with a video. I do have one question - Is there any permissions I have to get to use this control on a public web site?

August 12, 2008 1:20 PM
 

paul said:

sab0900 said:

I am getting a runtime error when I try to open my WSS 3.0 site.

Check the permissions on the web.config file if you made a copy. go to the permissions tab and advanced and make sure its inheriting permissions - that got me as I made a copy to desktop which stripped the correct permissions from the file.

August 13, 2008 8:33 AM
 

tavo said:

can we see the code ?

August 13, 2008 9:38 PM
 

PaulP said:

Can you pass a source file parameter from a link?