【问题标题】:WPF MediaElement - image won't update when video is Paused and Position is resetWPF MediaElement - 暂停视频并重置位置时图像不会更新
【发布时间】:2012-11-12 20:54:49
【问题描述】:

我正在使用 WPF MediaElement 播放视频。当 MediaElement 暂停时,我将位置设置为视频中的另一个点。我希望 MediaElement 中的视频图像刷新以反映新位置。但在我再次按下播放按钮之前,它不会更新图像。有没有办法在不调用 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
            }

【问题讨论】:

  • 你有什么 xaml 可以给我们看吗?

标签: wpf c#-4.0 mediaelement


【解决方案1】:

将 MediaElement 上的 ScrubbingEnabled 属性设置为 true。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-14
    • 2017-02-27
    相关资源
    最近更新 更多