none
Updating a MediaElement display after seek

    General discussion

  • I've got an OOB app playing a video loaded from disk in a MediaElement. I want to do two things:

    • When the video is closed, I want to stop it. When it opens again, I want it to be displaying the first frame.
    • When the video is over, I want to seek back to the first frame and display it.
    I can change the position of the video by setting the position to zero, and when I resume the video it starts from the beginning, but in the meantime the previous frame is still displayed.
    For example, when the video is closed in the UI, I do this:
                        _MediaElement.Position = TimeSpan.Zero;
                        _MediaElement.Stop();
    
    
    When I reopen the video in the UI, the MediaElement is displaying the frame that it was on when it closed. When I hit play again, it does start from the beginning.
    How can I force an update of the display after setting the Position property?
    Friday, April 13, 2012 3:11 PM