我从COM组件中添加了VLC插件,将其拖到我的表单中,在表单中添加了两个按钮("播放"和"停止"),并编写了以下代码:
private void Form1_Load(object sender, EventArgs e)
{
axVLC.AutoPlay = false;
axVLC.playlist.add(@"C:\Users\Hanif\Documents\Visual Studio 2010\Projects\Education Visualization\Vlc\Resources\Video1.wmv");
}
private void btnPlay_Click(object sender, EventArgs e)
{
axVLC.playlist.play();
}
private void btnStop_Click(object sender, EventArgs e)
{
axVLC.playlist.stop();
}
Run Code Online (Sandbox Code Playgroud)
但是当我点击"播放"时,没有任何反应.
我究竟做错了什么?
Bha*_*kar 13
是VLC插件的类型AxAXVLC.AxVLCPlugin2?如果是,那么试试这些:
1)尝试播放其他格式的视频,例如.avi,.mkv等.
2)尝试file:///在URI的开头添加:
@"file:///C:\Users\Hanif\Documents\Visual Studio 2010\Projects\Education Visualization\Vlc\Resources\Video1.wmv"
Run Code Online (Sandbox Code Playgroud)
3)尝试在add命令中再添加2个参数:
axVLC.playlist.add(@"C:\Users\Hanif\Documents\Visual Studio 2010\Projects\Education Visualization\Vlc\Resources\Video1.wmv", null, null);
Run Code Online (Sandbox Code Playgroud)
小智 0
尝试这个:
private void btnPlay_Click(object sender, EventArgs e)
{
axVLC.playlist.playNext();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4584 次 |
| 最近记录: |