This is a migrated thread and some comments may be shown as answers.

Dynamic source media player

3 Answers 106 Views
MediaPlayer
This is a migrated thread and some comments may be shown as answers.
Anand
Top achievements
Rank 1
Anand asked on 19 Jan 2011, 11:57 AM
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

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 24 Jan 2011, 10:35 AM
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>>
0
Anand
Top achievements
Rank 1
answered on 24 Jan 2011, 10:49 AM
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?


0
Petar Mladenov
Telerik team
answered on 27 Jan 2011, 10:33 AM
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>>
Tags
MediaPlayer
Asked by
Anand
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Anand
Top achievements
Rank 1
Share this question
or