none
Calling dynamic data to media source

    Question

  • I am trying to build a silverlight player and want the source of the mediaelement to be called from xml or a database. I am using c# as my code behind, can anyone give me some good ideas as how I would go about doing this?

    I have tried calling a php file that emmits xml, echo's a complete url and etc....

     

    Thanks for you help in advanced.

    Monday, July 25, 2011 6:20 PM

Answers

All replies

  • Hi Rsexton1980,

    Please have a look at below sample:

    http://silverlight30.codeplex.com/

    Media item data stored in XML document file. Please have a try.

    Best Regards,

    Wednesday, July 27, 2011 9:57 PM
  • Hi Haixia Xie,

     

     Thanks for the link, but that's not what I am looking for. It doesn’t help me with the Silverlight application aka mediaPlayer. I need to know how the mediaPlayer interacts with the defalut.aspx or default.aspx.cs file. I already understand the concept on opening and reading xml data, that's easy. I know how to use an array to get and make a list selection, list drop down menu and such... But I cannot get how to link it to the defalut.aspx or the default.aspx.cs

     

    Again Thanks for your help.

    Thursday, July 28, 2011 11:47 PM
  • Hi Rsexton1980,

    In above link, it is a custom Silverlight media player, if you just want create a Silverlight application with the source of the MediaElement to be called from xml, as you said above, reading data from xml that would not that complex.

    And if you want get MediaElement source from database, you can use WCF Services or WCF RIA Services, there are two links explain how to get datas from database using services:

    http://msdn.microsoft.com/en-us/gg710768

    http://msdn.microsoft.com/en-us/gg710774

    Hope it may help.

    Best Regards,

    Friday, July 29, 2011 7:03 AM
  • Thanks Haixia Xie,

     

    That didn't help, I dont want to embed the database or call from the application it's self. I want the default.aspx or default.aspx.cs to call it. I want the silverlight application to call the default.aspx or default.aspx.cs like below. If you look at brillvid.com you will see the player I found that does what I want it to do. But I have a custom built player that needs to do a lot of things...

     

    <div id="silverlightcontainer" class="auto-style1">
    		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="1010" height="400">
    			<param name="source" value="silverlight/mediaPlayer.xap"/>
    			<param name="background" value="white" />
    			<param name="minRuntimeVersion" value="2.0.31005.0" />
    			<param name="autoUpgrade" value="true" />
    			<param name="InitParams" value="selectedcaptionstream=textstream_eng,mediaurl=http://192.168.2.4/video/SawVI/SawVI.ism/manifest" />
    <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>
    		<iframe id="I1" style='visibility:hidden;height:0;width:0;border:0px;' name="I1">
    		</iframe></div>
    
     
    Thank you for your help.
     
    Friday, July 29, 2011 1:27 PM
  • I found what I was looking for. Here is the link that i needed. Cool

    So the way I am doing this is as follows...

    I use the code behind to open the xml. Then use DataBind() to a variable that is retrieved on the aspx page.

    I found everything I needed to complete the project...

    Here

    http://forums.silverlight.net/p/115304/259910.aspx

    and

    http://msdn.microsoft.com/en-us/library/cc838255(v=vs.95).aspx

     

    I will be uploading xap file once I finish the story board.

    Thank
    you for your help Haixia Xie, you had a vast amount of information.

    Robert

     

     

    Saturday, July 30, 2011 4:11 AM
  • i've the same problem,, do u solve the problem yet?

    cause ive project example,, but its using SL2 version + VS2008,,

    in that version they using internal file (abc.xaml + abc.xaml.js + silverlight.js) in 1 same folder with ur website..

    I can not implement it in the new version of silverlight T_T

    Wednesday, September 28, 2011 3:17 AM