gpt4 book ai didi

WPF MediaElement - 视频暂停和位置重置时图像不会更新

转载 作者:行者123 更新时间:2023-12-04 21:21:27 26 4
gpt4 key购买 nike

我正在使用 WPF MediaElement 播放视频。当 MediaElement 暂停时,我将位置设置为视频中的另一个点。我希望 MediaElement 中的视频图像刷新以反射(reflect)新位置。但它不会更新图像,直到我再次按下播放按钮。有没有办法在不调用其 Play 方法的情况下强制刷新 MediaElement 图像?

代码示例

TimeSpan tsPosition = new TimeSpan(0,0,30);   // set to 30 seconds
MediaElementObj.Position = tsPosition;
if (PlayStatus == PAUSED) // ignore if not paused
{
// image refresh method call here if there is a way to do it
}

最佳答案

设置 ScrubbingEnabled MediaElement 上的属性为 true。

关于WPF MediaElement - 视频暂停和位置重置时图像不会更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13351403/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com