我可以把視頻放在我的窗體中。c#使用Microsoft.DirectX.AudioVideoPlayback如何播放下一個視頻完成後
我的問題是我如何使它完成播放視頻時,它開始播放另一個視頻?意思就像一個序列。完成後,播放另一個視頻。
到目前爲止,我已經設法播放視頻,它只是循環播放視頻。
有什麼想法?
這是我到目前爲止的代碼:
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;
}
視口是什麼類型的控件? – MPelletier 2011-04-12 09:51:50