Skip to main content
Home Forums Silverlight Design Video and Media [HELP] Silverlight hangs browser for 28 seconds when first setting the source URI
3 replies. Latest Post by leon_meijer@hotmail.com on July 2, 2009.
(0)
jimbo1969
Member
27 points
12 Posts
04-29-2009 11:12 AM |
For some reason when I set the media source, the browser seems to hang until the media starts to play. If I change autoplay = false on the initial load it does not hang, but if I then change the uri to another video and set autoplay = true. It then hangs. So basically the first time I set the source and play the video it hangs for 28 seconds. The server is windows 2008 with windows media services. Any suggestions would be very welcome, I have been banging my head on this for a few days now. It hangs on this line of code when stepping through:
this.media.Source = this.mediaSourceUri;
here are the properties:
[System.ComponentModel.Category("Media Player Properties"), System.ComponentModel.Description("Sets the media source Uri.")] public Uri MediaSourceUri { set { this.mediaSourceUri = value; this.clickToPlayGrid.Opacity = 1; this.clickToPlayGrid.IsHitTestVisible = true; } }
/// <summary> /// Gets or sets the media source. /// </summary> [System.ComponentModel.Category("Media Player Properties"), System.ComponentModel.Description("Sets the media source.")] public string MediaSource { get { return (string)GetValue(MediaSourceProperty); } set { SetValue(MediaSourceProperty, value); } }
/// <summary> /// Updates the media source Uri. /// </summary> /// <param name="dependencyObject">The media player.</param> /// <param name="eventArgs">Dependency property changed event args.</param> private static void MediaSource_Changed(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs) { MediaPlayer mediaPlayer = (MediaPlayer)dependencyObject; mediaPlayer.MediaSourceUri = new Uri((string)eventArgs.NewValue, UriKind.RelativeOrAbsolute); }
04-30-2009 11:35 AM |
Let me also add that this happens not only when setting the source to our media server but even when I use Microsofts http streaming server.
gillesk
302 points
66 Posts
04-30-2009 1:24 PM |
Do you have your proxy settings as Automatically detect settings? This can sometimes happen when you try to detect an internet proxy and your network doesn't need one.
leon_mei...
2 points
1 Posts
07-02-2009 1:10 PM |
Thanks. I was having this issue for a long time and could'nt find the anwer till now. The solution works great for me in both Firefox as IE8