This article was written in reference to:
How to add a movie player to MOSS - Posted November 17, 2008 - 03:32 AM
How to Achieve Video streaming in SharePoint - Posted February 11, 2009 - 05:41 AM
Guest Author: Ken Cronin
I work for a large company with a very strict authentication based network environment. We have multiple SharePoint portals and no access to the Administration Panel. You could say I am a true end-user administrator in the environment. If you are like me you need to meet your users’ needs by adapting many of the “Standard” SharePoint pieces.
Recorded meetings and video based training programs are being used more than ever in business environments. Clicking on a .WMV file in a document library is one solution but this requires my users to re-authenticate when their Windows Media Player opens. My user base now exceeds 11,000 people so this leads to a whole new host of problems.
My challenge was simple. Create a simple to use, easy to administer, user friendly interface that will not prompt for authentication. Although posting to YouTube and using their embedded link is an option for some, business related materials must be kept “in House” so the sound and video files must be stored and run from SharePoint.
In the end it took some outside the box thinking, some HTML style code and a Content Editor Web Part (CEWP). I have used this player for .WMV, .AVI and MP3 files but it will play the file types associated in each individual Computer. With my company’s desktop image all 3 work fine.
To embed a single file player
- Upload the media file into a Document Library on your SharePoint site. (Files can be stored at another location as long as your users have access.)
- Add a Content Editor Web Part where you want the player to appear.
- Open the tool pane (Edit – Modify Shared Web Part)
- Click Source Editor
- Paste the following code into the Source Editor Box
<object id="MediaPlayer1" height=230 width=230 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="FileName" value="filename.wmv">
<param name="AutoStart" value="0">
<param name="ShowStatusBar" value="True">
<embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"showstatusbar=true>
- Modify the code to point to your file. Find the line of code that begins with “param name="FileName" value=” and enter the path to your file between the quotes after value=. You can get this by opening the Document library that contains the file, right click the file name and choose “Copy Shortcut”.
- To adjust the size of the player window modify the height and width settings at the beginning of the code. This player is set for height=230 width=230 with the numbers representing pixels. The height and width of a video can be found by looking at the properties of the file. To prevent distorting your video be sure to match the height and width (or percentage of the height and width). For example if your video is 600 X 400 and you want your player to be 300 pixels wide (50%), set your width to 300 and your height to 200 pixels. If you want to play an audio only file I find that setting the height to 75 is sufficient to remove the playback window.
- Click OK and modify the Content Editor Web Part options as normal.
- Click OK
The player will appear but will not start until you click the play button.
That’s it. It is possible to embed multiple players within a single page either using a single web part or multiple web parts.
Piece of Cake!
In my next installment I will show you how to add a dropdown selection menu that will allow you to view multiple files with a single player.
Guest Author: Ken Cronin
Ken is a Business Analyst on a Learning Technology and Architecture team. His specialties include collaboration, interactive/virtual desktop environment design and the global distribution of information in a corporate environment.
Ken has been involved with technology and training for more than 20 years. Want to cause him sleepless nights? Tell him something can't be done. Ken is a consultant for many groups because he understands how different applications and programming languages work together and how to expand/leverage existing applications without increasing costs.
Originally from Massachusetts, Ken now lives in the mountains of Tennessee with his wife Chris and 2 children.