开发者

How do I stop a video at a specific time using Blend/WPF

How do I stop a video at a specific time using Blend/WPF in C#?

Example:

When I clicked on a "TreeViewItem" called "MONDAY", the video will start to play. But up to 10sec of that video, I want it to stop. As after 10sec, that video will be showing video of another "TreeViewItem" called "TUESDAY". So what is the coding for it?

My coding is shown below:

        if (MONDAY.IsSelected == true)
        {
            Video.Source = new Uri(@".\weekday.wmv", UriKind.Relative);
            Video.Play();
            descriptionText.Text = "Monday Blues";

 开发者_如何学Python          ****When video play until 10sec, it will auto stop it****
        }

        else if (TUESDAY.IsSelected == true)
        {
            TimeSpan t = TimeSpan.FromSeconds(VideoTime.Value = 10);
            Video.Position = t;
            descriptionText.Text = "Tuesday is here";
        }

Can someone help me? Thanks.


Run a timer for 10 seconds, when timer elapsed call Stop

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜