Dynamic source media player

4 posts, 0 answers
  1. Anand
    Anand avatar
    2 posts
    Member since:
    Jul 2010

    Posted 19 Jan 2011 Link to this post

    Hi ,

    Am created a silver light project and set the source like follows

    <telerik:RadMediaPlayer>
    <telerik:RadMediaItem IsStreamingSource="True"  Header="Big Buck Bunny" Source="http://video3.smoothhd.com.edgesuite.net/ondemand/BigBuck%20Bunny%20Adaptive.ism/Manifest" StreamAttached="RadMediaItem_StreamAttached">         
     </
    telerik:RadMediaItem>
    </
    telerik:RadMediaPlayer>

    then am using the .xap file in client web application like follows
      
    <asp:Silverlight ID="Xaml1" Width="500" Windowless="true" Height ="300" runat="server" Source="~/ClientBIN/RADMediaPlayer.xap" MinimumVersion="2.0.31005"/>

    its working fine and displaying the video.but i want to set the video source dynamically from client application like


    For example
    xaml.soure="http://video3.smoothhd.com.edgesuite.net/ondemand/BigBuck%20Bunny%20Adaptive.ism/Manifest"

    is that possible ?

    Thanks
    Anand
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 Jan 2011 Link to this post

    Hello Anand,

    Supposing your MediaItem is x-named: firstMediaItem, you can set its source from code behind like so:
    public MainPage()
           {
               InitializeComponent();
               this.firstMediaItem.Source = new Uri("http://ecn.channel9.msdn.com/o9/pdc09/wmv/CL16.wmv");
           }
    Hope this is what you had in mind. Feel free to ask if you need further assistance.

    Greetings,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Anand
    Anand avatar
    2 posts
    Member since:
    Jul 2010

    Posted 24 Jan 2011 Link to this post

    Hi Petar,

    yeah i can do like you said if its a silver light project.but am using the control in non-silver light project.i can't directly access the control in this.what i want is to create a videoplayer in using silverlight project and then have to use it as a control in asp.net appliction  by setting the xap file as a source using asp.net silver light control like follows

    <asp:Silverlight ID="Xaml1" Width="500" Windowless="true" Height ="300" runat="server" Source="~/ClientBIN/RADMediaPlayer.xap" MinimumVersion="2.0.31005"/>

    its working but i want to set the source from asp.net application to the video player.Is that Possible?


  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 Jan 2011 Link to this post

    Hi Anand,

    A possible way to change dynamically the source of the MediaPlayer in asp web application is to use the media player along with other Silverlight controls. For example a buttons, that will change the videos when clicked. Please examine the described approach and let us know if it works for you.
    Please also note that in ASP 4 , the <asp:Silverlight> is no more used and it is replaced by the <object> tag. Feel free to ask if you need further assistance.

    All the best,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top