Video Seeking locked intermittently. Cannot jump through the video. SOLVED!

Feb 5, 2013 at 9:46 AM
Intermittently the seek bar is locked to the current position of the video, moving the seek bar has no effect and the bar jumps back to the current play position. Seeking in code also fails to work.

The video needs to be stopped and restarted to get it working. This happens very often - probably 20% or 30% of the time.

Is the DirectShow seeking interface failing to initialize? Anyone know of a fix?

I'm using the source code from about 2 weeks ago.
Oct 16, 2013 at 10:48 AM
Any one else experiencing a locked seek slider?

Here is my code:
                m.Source = sFullFileName;
                // Seek
                m.MediaPosition = lSeekTo; // FAILS INTERMITTENTLY
Oct 21, 2013 at 1:17 PM
Edited Oct 21, 2013 at 1:23 PM

Finally I found a solution.

In MediaSeekingElement.cs I changed PlayerSetMediaPosition() to:
        private void PlayerSetMediaPosition()
            var position = MediaPosition;
//            if (MediaPlayerBase.Dispatcher.Shutdown || 
//                MediaPlayerBase.Dispatcher.ShuttingDown)
//            {
//                return;
//            }

                MediaPlayerBase.Dispatcher.BeginInvoke((Action) (() => MediaSeekingPlayer.MediaPosition = position));
            catch(Exception ex)
                System.Diagnostics.Debug.WriteLine("WMK PlayerSetMediaPosition EXCEPTION: "+ex.Message);
Not sure if it is because I'm using .NET4 but either way it works perfectly now.

Why the dispatcher is shutting down at that point I have no idea. My app certainly isn't shutting down at that point.

... the try..catch() may not catch the Delegate code but anyway I've had no problems.