Skip to main content

Microsoft Silverlight

Answered Question [HELP] Silverlight hangs browser for 28 seconds when first setting the source URIRSS Feed

(0)

jimbo1969
jimbo1969

Member

Member

27 points

12 Posts

[HELP] Silverlight hangs browser for 28 seconds when first setting the source URI

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);
        }

 

jimbo1969
jimbo1969

Member

Member

27 points

12 Posts

Re: [HELP] Silverlight hangs browser for 28 seconds when first setting the source URI

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
gillesk

Member

Member

302 points

66 Posts

Answered Question

Re: [HELP] Silverlight hangs browser for 28 seconds when first setting the source URI

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.

Development Lead | Microsoft

leon_meijer@hotmail.com
leon_mei...

Member

Member

2 points

1 Posts

Re: Re: [HELP] Silverlight hangs browser for 28 seconds when first setting the source URI

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

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities