Q:

How to add silverlight player to browser and load our own video using PHP?

Im Implementing a video broadcasting website. For that I planned to use silverlight player to load videos. But I dont know how to integrate silverlight player into browser and load my own video in that player. Please Give me some code snippets or Some good references. Any help will be highly appreciated.

A:

First of all you need a Silverlight player just like you need a FLV player for Flash videos.
I recommend: http://www.codeplex.com/sl2videoplayer
All the installation instructions are explained in great detail at: http://sl2videoplayer.codeplex.com/Wiki/View.aspx?title=installation%20instructions
It is simply a matter of including a small HTML snippet in your document:
<div id="silverlightControlHost">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640" height="480">
        <param name="source" value="ClientBin/VideoPlayer.xap"/>
        <param name="background" value="white" />
        <param name="initParams" value="m=Bear.wmv" />
               <param name="minruntimeversion" value="2.0.31005.0" />
        <a href="http://go.microsoft.com/fwlink/?LinkId=124807" style="text-decoration: none;">
            <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
        </a>
    </object>
</div>

Assuming the silver light player is located in ClientBin/VideoPlayer.xap and the video you want to play is called 'Bear.wmv' located in the same directory as the .xap file (so that becomes ClientBin/Bear.wmv).

