2012-11-12 72 views
2

我正在使用WPF MediaElement播放視頻。在MediaElement已暫停時,我將該位置設置爲視頻中的另一個點。我希望刷新MediaElement中的視頻圖像以反映新位置。但在我再次按下播放按鈕之前,它不會更新圖像。有沒有辦法在不調用Play方法的情況下強制MediaElement圖像刷新?WPF 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 
      } 
+0

您有任何可以向我們展示的xaml嗎? – TMan

回答

5

設置ScrubbingEnabled財產上的MediaElement爲true。

+0

設置ScrubbingEnabled屬性非常完美。謝謝!! –

相關問題