开发者

How can I set the position of a paused video

开发者 https://www.devze.com 2023-03-19 18:00 出处:网络
I am 开发者_C百科using WPF\'s MediaElement. If the MediaElement is playing, setting the Position works as expected.

I am 开发者_C百科using WPF's MediaElement. If the MediaElement is playing, setting the Position works as expected.

However, if the MediaElement is paused, setting the Position has no effect.

How can I set the position of a paused video?


To update frames for seek operations while paused you need to set the ScrubbingEnabled property of the media element to true. Ie (xaml):

<MediaElement x:Name="Player"
              LoadedBehavior="Manual"
              UnloadedBehavior="Manual"
              ScrubbingEnabled="True" />

MSDN Reference

0

精彩评论

暂无评论...
验证码 换一张
取 消