如何使用 Blend/WPF 在特定时间停止视频
如何在 C# 中使用 Blend/WPF 在特定时间停止视频?
示例:
当我单击名为“MONDAY”的“TreeViewItem”时,视频将开始播放。但那个视频长达 10 秒,我希望它停止。 10 秒后,该视频将显示另一个名为“TUESDAY”的“TreeViewItem”的视频。那么它的编码是什么呢?
我的编码如下所示:
if (MONDAY.IsSelected == true)
{
Video.Source = new Uri(@".\weekday.wmv", UriKind.Relative);
Video.Play();
descriptionText.Text = "Monday Blues";
****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";
}
有人可以帮助我吗?谢谢。
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";
****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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
运行 计时器 10 秒,当计时器已调用停止
Run a timer for 10 seconds, when timer elapsed call Stop