WPF MediaElement Resume jumps video backwards

Discussion in 'Microsoft C# .NET' started by Petra, Nov 10, 2008.

  1. Petra

    Petra Guest

    Hello,

    I have a strange problem with Pause and Resume using a
    MediaElement.Clock.

    I implemented a MediaElement to display a video and implemented a GUI
    around it to make the typical Start/Stop/Pause/Resume functionality
    available.

    For one particular video I work with the clock.Controller.Resume()
    function causes the clock to jump back several seconds (or frames?)
    first and then starting to play the video from that position. This is
    quite a nuisance because I am trying to keep the video synchronized
    with another video that I restart at the same time (and which doesn't
    jump backwards first). Is there anything that could explain this
    behaviour?

    My pause/resume code is quite trivial. Here an excerpt:

    public void PauseResume()
    {
    MediaClock clock = mediaElement.Clock;

    if (clock != null)
    {
    if (clock.IsPaused)
    {
    clock.Controller.Resume();
    }
    else
    {
    clock.Controller.Pause();
    }
    }
    }

    If anyone has ideas as to why this could be happening, I'd be very
    interested!
    (Would it be possible that is has to do with the way the video is
    encoded? Keyframe? etc.?)

    Cheers,
    Petra
     
    Petra, Nov 10, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    919
    RobinS
    Apr 10, 2007
  2. Sai
    Replies:
    2
    Views:
    905
  3. Piotrekk

    MediaElement video quality worse than WMP

    Piotrekk, Sep 28, 2007, in forum: Microsoft C# .NET
    Replies:
    0
    Views:
    1,059
    Piotrekk
    Sep 28, 2007
  4. Piotrekk
    Replies:
    0
    Views:
    339
    Piotrekk
    Sep 28, 2007
  5. Piotrekk
    Replies:
    0
    Views:
    414
    Piotrekk
    Sep 28, 2007
  6. DNB
    Replies:
    1
    Views:
    1,247
    Radek Cerny
    Feb 8, 2008
  7. cbmeeks

    This is INSANE. MediaElement and .m4a files.

    cbmeeks, May 30, 2008, in forum: Microsoft C# .NET
    Replies:
    1
    Views:
    359
    cbmeeks
    May 31, 2008
  8. Howard Swope

    To WPF or not to WPF, that is the question

    Howard Swope, Apr 5, 2009, in forum: Microsoft C# .NET
    Replies:
    12
    Views:
    429
    invegat
    Apr 10, 2009
Loading...