My code is:
public Form1()
{
InitializeComponent();
Core.Initialize();
this.KeyPreview = true;
this.KeyDown += new KeyEventHandler(ShortcutEvent);
oldVideoSize = videoView1.Size;
oldFormSize = this.Size;
oldVideoLocation = videoView1.Location;
//VLC stuff
_libVLC = new LibVLC();
_mp = new MediaPlayer(_libVLC);
videoView1.MediaPlayer = _mp;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
TimeSpan Percent = TimeSpan.FromSeconds(_mp.Position);
label1.Text = Percent.ToString(@"hh\:mm\:ss");
TimeSpan time = TimeSpan.FromSeconds(_mp.Time);
label2.Text = time.ToString(@"hh\:mm\:ss");
TimeSpan length = TimeSpan.FromSeconds(_mp.Length);
label3.Text = length.ToString(@"hh\:mm\:ss");
}
The percentage part doesn't work at all, and the current time part doesn't run correctly and doesn't tick in a real clock but according to an illogical division, and the return of the total time of the video doesn't make sense in its conversion to the clock string.
It seems that the conversion doesn't fit here, or there is another code or an alternative, so I'm asking someone who has something that returns what I'm looking for, that is, how long the video actually is, and where it is now, in a way that looks like a clock, that is: .ToString(@"hh\ :mm:ss").
Thank you!