C# Vlc Forms volume stabilization problem

This forum is about all development around libVLC.
brokolililer
New Cone
New Cone
Posts: 2
Joined: 03 Apr 2020 14:02

C# Vlc Forms volume stabilization problem

Postby brokolililer » 03 Apr 2020 14:08

I am using Vlc.DotNet.Forms package in my project. I open one video on form. Everything okay. But If I want to open a video again. When I change the volume, the volume of both videos changes.

My Code Example:

Code: Select all

public VlcControl control; public void Player(string url,int volume){ this.control = new VlcControl(); var currentAssembly = Assembly.GetEntryAssembly(); var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName; var libDirectory = new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64")); control.BeginInit(); control.VlcLibDirectory = libDirectory; control.Dock = DockStyle.Fill; control.EndInit(); this.Controls.Add(control); control.SetMedia(new Uri(@"" + url + "")); control.Audio.Volume=volume; control.Play(); }
For example,

Code: Select all

Player("C:\\test\video1.mp4",50); Player("C:\\test\video2.mp4",75);

The first video opens and the volume becomes 50. Then when I open the second video, the volume of both videos is 75.

I use these packages,

  • VideoLAN.LibVLC.Windows (Version 3.0.0) https://www.nuget.org/packages/VideoLAN.LibVLC.Windows
  • Vlc.DotNet.Forms (Version 3.0.0) https://github.com/ZeBobo5

brokolililer
New Cone
New Cone
Posts: 2
Joined: 03 Apr 2020 14:02

Re: C# Vlc Forms volume stabilization problem

Postby brokolililer » 06 Apr 2020 13:34

Solved. https://stackoverflow.com/questions/60966365/c-sharp-vlc-forms-volume-stabilization-problem


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 13 guests