Nope, I had both in there. First I created the Page(url) and assigned it to the Visualroot (which was fine) and then assigned Visualroot a second time using the default constructor. VisualRoot = Page(); I was spending all my time debugging the Page's code and didn't look close enough at the App.xaml.cs file where the problem lay.
On Sun, Feb 1, 2009 at 2:44 PM, Jonathan Parker < [email protected]> wrote: > Surely debugging would have found that as the URL would have been empty. > > On Sun, Feb 1, 2009 at 1:17 PM, Stephen Price > <[email protected]>wrote: > >> Gah!! >> I found the problem and yes it was a stupid mistake. >> I forgot to remove the >> this.RootVisual = new Page(); >> at the end of my Application_Startup, the default one that's there. So >> essentially it was all working right except it was the loading the default >> page with no parameters. I'm using the paremeters to pass in the url so >> thats why it couldnt find the url. >> >> kicking myself for not finding it a bit sooner but now I can move on! >> *bangs head against wall as punishment* >> >> cheers, >> Stephen >> >> On Sun, Feb 1, 2009 at 11:56 AM, .net noobie <[email protected]>wrote: >> >>> yes in the example it does, I just did it as a test to make sure I >>> remembered correctly >>> I also the same issues along time ago >>> >>> On Sun, Feb 1, 2009 at 8:36 AM, Stephen Price <[email protected] >>> > wrote: >>> >>>> Wouldn't that download the whole video and then set the source on >>>> completion? >>>> I want to stream it from the web server. >>>> I'll have a look at set source, thanks. >>>> On Sat, Jan 31, 2009 at 8:59 PM, .net noobie <[email protected]>wrote: >>>> >>>>> this is just a sample to show how I did a test.... >>>>> you might want to look at the "SetSource" >>>>> >>>>> SetSource(MediaStreamSource) This sets the source of a MediaElement >>>>> to a subclass of MediaStreamSource. >>>>> >>>>> SetSource(Stream) Sets the Source property using the supplied stream. >>>>> >>>>> >>>>> public partial class Page : UserControl >>>>> >>>>> { >>>>> >>>>> private WebClient wc; >>>>> >>>>> >>>>> >>>>> public Page() >>>>> >>>>> { >>>>> >>>>> InitializeComponent(); >>>>> >>>>> >>>>> >>>>> set1.Click += set1_Click; >>>>> >>>>> set2.Click += set2_Click; >>>>> >>>>> } >>>>> >>>>> >>>>> >>>>> private void set1_Click(object sender, RoutedEventArgs e) >>>>> >>>>> { >>>>> >>>>> wc = new WebClient(); >>>>> >>>>> wc.OpenReadCompleted += wc_OpenReadCompleted; >>>>> >>>>> wc.OpenReadAsync(new Uri("media/one.wmv", UriKind.Relative)); >>>>> >>>>> } >>>>> >>>>> >>>>> >>>>> private void set2_Click(object sender, RoutedEventArgs e) >>>>> >>>>> { >>>>> >>>>> wc = new WebClient(); >>>>> >>>>> wc.OpenReadCompleted += wc_OpenReadCompleted; >>>>> >>>>> wc.OpenReadAsync(new Uri("media/two.wmv", UriKind.Relative)); >>>>> >>>>> } >>>>> >>>>> >>>>> >>>>> private void wc_OpenReadCompleted(object sender, >>>>> OpenReadCompletedEventArgs e) >>>>> >>>>> { >>>>> >>>>> this.MediaPlayer.SetSource(e.Result); >>>>> >>>>> } >>>>> >>>>> } >>>>> >>>>> >>>>> >>>>> On Fri, Jan 30, 2009 at 9:05 PM, Stephen Price < >>>>> [email protected]> wrote: >>>>> >>>>>> Hey all, >>>>>> I'm going spare here. I've got a simple mediaelement, and when I set >>>>>> the source in the xaml it works fine. If I set the source in the >>>>>> codebehind >>>>>> it doesn't work. It doesn't even seem to hit the url. (using Fiddler >>>>>> aimed >>>>>> at www.somesite.com) >>>>>> >>>>>> has something changed with Uri's? >>>>>> >>>>>> I've downloaded Tim Heuer's silverlight 2 media player which works. >>>>>> I've copied his code (doesn't work) and put my url into his code (works). >>>>>> >>>>>> >>>>>> Application startup has this; >>>>>> >>>>>> if (!string.IsNullOrEmpty(url)) { >>>>>> Uri mediaUri; >>>>>> >>>>>> if (url.Contains("://")) { >>>>>> mediaUri = new Uri(url, >>>>>> UriKind.RelativeOrAbsolute); >>>>>> } >>>>>> else { >>>>>> mediaUri = new Uri(url, UriKind.Relative); >>>>>> } >>>>>> >>>>>> this.Resources.Add("url", mediaUri); >>>>>> >>>>>> } >>>>>> >>>>>> >>>>>> and then I put this into page constructor >>>>>> >>>>>> videoClipPlayer.Source = App.Current.Resources["url"] as Uri; >>>>>> >>>>>> >>>>>> Am I missing something really obvious or obscure here? >>>>>> >>>>>> cheers, >>>>>> Stephen >>>>>> ------------------------------ >>>>>> Support procedure: https://www.codify.com/lists/support >>>>>> List address: [email protected] >>>>>> Subscribe: [email protected] >>>>>> Unsubscribe: [email protected] >>>>>> List FAQ: http://www.codify.com/lists/ozsilverlight >>>>>> Other lists you might want to join: http://www.codify.com/lists >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> .net noobie™ >>>>> >>>>> ========================= >>>>> >>>>> What is the 'Clean Feed'? >>>>> >>>>> No!!! Forced Australian Federal Government Internet Censorship >>>>> >>>>> http://nocleanfeed.com/ >>>>> ------------------------------ >>>>> Support procedure: https://www.codify.com/lists/support >>>>> List address: >>>>> [email protected] >>>>> Subscribe: [email protected] >>>>> Unsubscribe: [email protected] >>>>> List FAQ: http://www.codify.com/lists/ozsilverlight >>>>> Other lists you might want to join: http://www.codify.com/lists >>>>> >>>> >>>> ------------------------------ >>>> Support procedure: https://www.codify.com/lists/support >>>> List address: [email protected] >>>> Subscribe: [email protected] >>>> Unsubscribe: [email protected] >>>> List FAQ: http://www.codify.com/lists/ozsilverlight >>>> Other lists you might want to join: http://www.codify.com/lists >>>> >>> >>> >>> >>> -- >>> .net noobie™ >>> >>> ========================= >>> >>> What is the 'Clean Feed'? >>> >>> No!!! Forced Australian Federal Government Internet Censorship >>> >>> http://nocleanfeed.com/ >>> ------------------------------ >>> Support procedure: https://www.codify.com/lists/support >>> List address: [email protected] >>> Subscribe: [email protected] >>> Unsubscribe: [email protected] >>> List FAQ: http://www.codify.com/lists/ozsilverlight >>> Other lists you might want to join: http://www.codify.com/lists >>> >> >> ------------------------------ >> Support procedure: https://www.codify.com/lists/support >> List address: [email protected] >> Subscribe: [email protected] >> Unsubscribe: [email protected] >> List FAQ: http://www.codify.com/lists/ozsilverlight >> Other lists you might want to join: http://www.codify.com/lists >> > > ------------------------------ > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > -------------------------------------------------------------------------------- Support procedure: https://www.codify.com/lists/support List address: [email protected] Subscribe: [email protected] Unsubscribe: [email protected] List FAQ: http://www.codify.com/lists/ozsilverlight Other lists you might want to join: http://www.codify.com/lists
