Here is my code:
Code: Select all
namespace VlcTest
{
public partial class Form1 : Form
{
Timer timer;
bool sizingNeeded;
public Form1()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.sizingNeeded = true;
this.timer = new Timer();
this.timer.Interval = 500;
this.timer.Tick += timer_Tick;
this.timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
if (this.sizingNeeded && (this.vlc.State == VLanControl.PlayerState.Playing))
{
this.ClientSize = this.vlc.VideoSize;
this.sizingNeeded = false;
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
this.vlc.ClearPlayList();
this.vlc.AddAndPlay(@"C:\test.avi", String.Empty);
this.vlc.Play();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void vlc_Load(object sender, EventArgs e)
{
}
}
}
I read all related posts on the forum but didn't find solution. Is there any full example on C#?
Thanks,
Serhiy.