【发布时间】:2011-04-05 08:20:19
【问题描述】:
我可以在我的 Windows 窗体中放一个视频。
我的问题是,当它播放完视频,它开始播放另一个视频时,我该怎么做?意思是像一个序列。完成后,播放另一个视频。
到目前为止,我已经设法播放视频,它只是循环播放视频。
有什么想法吗?
这是我目前的代码:
public partial class Form1 : Form
{
Video video;
public Form1()
{
InitializeComponent();
Initializevid1();
}
public void Initializevid1()
{
// store the original size of the panel
int width = viewport.Width;
int height = viewport.Height;
// load the selected video file
video = new Video("C:\\Users\\Dave\\Desktop\\WaterDay1.wmv");
// set the panel as the video object’s owner
video.Owner = viewport;
// stop the video
video.Play();
video.Ending +=new EventHandler(BackLoop);
// resize the video to the size original size of the panel
viewport.Size = new Size(width, height);
}
private void BackLoop(object sender, EventArgs e)
{
//video.CurrentPosition = 0;
}
【问题讨论】:
-
视口是什么类型的控件?
标签: c# winforms video directx audiovideoplayback