How to add search barrier to VLC dot net forms in windows windows forms application
I need to add a custom search bar / trackbar , as you can tell, in C # windows forms. But the problem is that there is almost no documentation on the vlc dot net forms library. I need to know how to add a custom search bar in a windows forms application.
remember i am not using vlc activeX * plugin. ** Rather, I am using the nuget package dot net library vlc and everything works fine. I added a toggle and pause button, a stop button, the ability to get the current time, the ability to get the total time, and everything else. But I have no idea how to add a search barrier so that when searching, the video moves to that position. Please help me with the complete code.
source to share
I finished successfully, thanks that it was good practice for me. I added media to the formdeneme () method
You have to make it a public object, which is in the VlcControl.cs class. (private VlcMediaPlayer myVlcMediaPlayer;) {Very important}
public int a = 0 ;`
public int c = 0;
public formdeneme()
{
InitializeComponent();
myVlcControl.Play("file:///C:/Users/1315k/Downloads/machine.mp4");
// You can add your media like above.
}
// This is the main function which you looking.
private void trackBar1_Scroll(object sender, EventArgs e)
{
myVlcControl.myVlcMediaPlayer.Time = trackBar1.Value * 1000;
int b = (int)myVlcControl.myVlcMediaPlayer.Time / 1000;
int d = b / 60;
b = b - d * 60;
label1.Text = d+":"+b + "/"+ c + ":" + a;
// The Time value is milisecond, you have divide 1000 for be second.
}
private void formdeneme_Load(object sender, EventArgs e)
{
a = (int)myVlcControl.myVlcMediaPlayer.Length / 1000;
trackBar1.Maximum = a;
c = a / 60;
a = a - c * 60;
label1.Text = 0 + "/" + c+":"+a;
}
You can add a button that can change media and trackbar. Maximum value.
source to share