Adding a feature like playing a video when clicking over its name is something nice to add to your upcoming video webPart
All you have to do is:
All you have to do is:
Add a container div with an ID (we need to use the ID later)<div id='videoContainer'></div>
- Add a hyperlink inside the div which its 'href' links to the video you want to player on the silverlight player
- Add reference to the (mediaplayer.js) file, which can be found /_layout/mediaplayer.js
e.g.:<script type="text/javascript" src="/_layouts/mediaplayer.js"></script>
Note: Make sure the script block placed after the div section - Add the following script block
<script type="text/javascript"> _spBodyOnLoadFunctionNames.push('mediaPlayer.createOverlayPlayer'); mediaplayer.attachToMediaLinks ( (document.getElementById('videoContainer')), ['wmv','avi','mp3'] ); </script>
This will be executed after the whole page finishes loading, plus it will replace eachtag's onClick to trigger the silverlight player