Online Training On SharePoint
                      

Tuesday, 17 June 2008

Playing Audio/Video files within SharePoint Application

To play the Audio/Video files in SharePoint follow these steps:

1. Upload the file into a document library.
2. Add a content Editor Web Part to your site.
3. Add the code in the HTML:

<OBJECT id="VIDEO" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
<PARAM NAME="URL" VALUE="fileurl">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="none">
<PARAM name="PlayCount" value="1">
</OBJECT>

Notes:
1. CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" is the class id for Windows Media player.
2. URL will point to the location of the file. Upload this file to document library and put the URL for that file.
3. autoStart specifies value indicating whether the current media item begins playing automatically.
4. uiMode specifies which controls are shown in the user interface.
Possible values: invisible, none, mini, full.
5. PlayCount specifies the number of times a media item will play. Minimum value of one.

Get the code here:


You may find interesting to read: Showing PDF documnet in SharePoint Pages

Attempt a question on Web Parts: Question on Web Parts

16 comments:

Anonymous said...

Hi, I'm trying to link an MP3 (stored in DocLib) from a field in a (RTF multiple lines) list field. Your code doesn't seem to work because it is being removed whilst saving the entered text. Have you got any suggestions how to solve this.

Unknown said...

Hi
Hey I did not get you. what has been removed? Can you please explain the scenario with little more details.

Anonymous said...

Hi - nice article, and I tried it on my sharepoint page and it works great but just for me. Other person cannot see the video - he just sees a wmplayer black frame and it says "ready" and when he is clicking "play" - nothing happens. Is it any permission restricts to play video and another person should have edit access to the site ?

Anonymous said...

actually - I fixed my problem. Seems like only wmv files format should be linked to that web part in order to play properly. Thank you very much again, nice tech solution !

Anonymous said...

HI im trying to do this but it doesnt seem to be working for me, im not the best at coding so could you please send me what i need to put in the html parts

Unknown said...

Hi..

You just need to copy the code given in the content editor web part. Let me know if you want this piece of code and i can mail it to you as blogger does not allow to put this.

vinay said...

HJi manish, Great work. Its working good for me. But the scenario here us there a way ti disable auto start? i tried to give AutoStart="False" but it is not working. When i am opening the page it is playing automatically. But the users want to have a control on that.Any ideas

Thanks
Vins

WeeRock said...

Hello, thanks for sharing this info, it works for well. Is there any other parameters which we can further customised this object?

Thanks

Anonymous said...

I an trying to find out what audio and video file types work best with SharePoibf mp3 audio don't work and I need a small file

rizlablue said...

Hi,

This works well for me. One question, though - I'm playing audio only, so would like to disable the black box. Is that captured in the params?

cheers

Riz

Anonymous said...

how i want to get file url for my video in document library?

I'm new in sharepoint.

Example:

javascript:SmtEcbNavigateUrl('\u002fVideo\u002fVideo Library\u002f[22Dec2010] Basic Google.wmv')

is it that url?

Anonymous said...

If you're looking to Play MP3 files from a Document Library or List, check out this post:

https://sharepoint2020.wordpress.com/2011/06/08/sharepoint-2007-embed-an-mp3-player-for-a-list-or-document-library/

Reuben Cook said...

For some reason, my files aren't playing the audio--just the video. Any ideas why?

Reuben Cook said...

For some reason it only plays the video. The audio doesn't come through. Any thougths?

Prem said...

Hi Manish could you please email me the code. thanks! Can you also confirm if Mp4 players can also be streamed in this way.

Brown David said...

Hi, I try it, but the sound cant sync to the video, what is wrong?

Related Posts with Thumbnails