Set initParams for RadMediaPlayer

2 posts, 0 answers
  1. Dako -
    Dako - avatar
    9 posts
    Member since:
    Nov 2009

    Posted 20 Nov 2009 Link to this post


    At the moment I'm setting up a website which supports streaming. My streaming services are provided by Windows Media Services, which is installed on a windows server 2003. In Windows Media Services I set up a publishing points which generates a mms address, I'm able to use this mms address as video source. In several free Silverlight players I did this with success, by just setting up params in an HTML document which includes my mms address as source.
    Since I'm so satisfied about Telerik's RadUpload wich I already have in use for my site, I've decided to use the RadMediaPlayer as wel. Although I have a (little) problem.

    First my code:
    <object data="data:application/x-silverlight," type="application/x-silverlight-2" width="625" height="457"
        <param name="source" value="ClientBin/Mediaplayer.xap"/> 
        <param name="onerror" value="onSilverlightError" /> 
        <param name="windowless" value="true" /> 
        <param name="background" value="transparent" /> 
        <param name="initParams" value="VideoSource=bigbuckbunny.wmv,AutoPlay=enable,EnableScrubbing=true,InitialVolume=1" /> 
        <param name="autoUpgrade" value="true" /> 
        <href="" style="text-decoration: none;"
            <img src="" alt="Get Microsoft Silverlight" style="border-style: none"/> 
    <iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe> 

    For some reason my HTML document does not work for the RadMediaPlayer. When my site loads Mediaplayer.xap, I do see the RadMediaPlayer and the Silverlight plug-in uses all the param names except for initParams. This code worked for the other players I used. For the moment I'm just trying to open the VideoSource locally instead of from the server, so VideoSource=bigbuckbunny.wmv for this example.

    Is it possible with the RadMediaPlayer to define the source of the video this way, or am I missing something? I need to define the source this way, because I will put a database query behind the VideoSource in the present.

    Any help would be greatly appreciated.

    With kind regards,


  2. Dako -
    Dako - avatar
    9 posts
    Member since:
    Nov 2009

    Posted 24 Nov 2009 Link to this post

    Hi all, I have found the solution for my own problem:

    In the app.xaml.cs set e.initParams. See example:
    private void Application_Startup(object sender, 
        StartupEventArgs e) 
      this.RootVisual = new Page(e.InitParams); 

    In the mainpage.xaml.cs use the initParams as variable:

    public partial class Page : UserControl 
      public Page(IDictionary<stringstring> initParams) 
        _TextField.Text = "My Favorite Color is: " + initParams["favColor"]; 
        _TextField2.Text = ""
        foreach (string key in initParams.Keys) 
          _TextField2.Text += key + ": " + initParams[key] + "\n"

    This solved it for me, although I used MediaElement.Source = new System.Uri(initParams["VideoSource"]) for my problem.

  3. DevCraft R3 2016 release webinar banner
Back to Top