What is simplest way to repeat a video in a MediaElement

后端 未结 4 1683
-上瘾入骨i
-上瘾入骨i 2020-12-16 21:46

I have a MediaElement where the source is bound to some data


What is the simplest way

4条回答
  •  别那么骄傲
    2020-12-16 22:21

    I made it work by setting the UnloadedBehavior to MediaState.Manual and the following code:

    private void mediaElement_OnMediaEnded(object sender, RoutedEventArgs e)
    {
        mediaElement.Position = new TimeSpan(0,0,1);
        mediaElement.Play();
    }
    

    Setting the position to Zero didnt work...

提交回复
热议问题