MediaElement Set position in Pause mode

2019-08-25 18:16发布

问题:

I use this method to seek new position in my MediaElement :

TimeSpan t = TimeSpan.FromSeconds(newSecond);
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() =>
{
    mediaElement1.Position = TimeSpan.FromSeconds(newSecond);
});

When the user play video and then pause it and seek to new position the video frame stay in the previous frame.

And i want to know if it possible that when i seek to new position and the video is in pause mode so the frame will move to the new position and won't wait until i press play again.

回答1:

You need to set the MediaElements ScrubbingEnabled property to true