Reputation: 147
I am looking to incorporate a video player in one of my C# WPF project and I am planning on using MPV.
I went ahead and took a look at the NuGet packages already available and I noticed two who caught my interest:
MPV.NET needs to use a compiled MPV library in the form of a .DLL and the mpv NuGet package does contain the required .DLL.
I can easily use "using MPV.NET" and then proceed with the player code:
using System.Windows;
using Mpv.NET.Player;
namespace Mpv.NET.WPFExample
{
public partial class MainWindow : Window
{
private MpvPlayer player;
public MainWindow()
{
InitializeComponent();
player = new MpvPlayer(PlayerHost.Handle, "path to the libmpv dll can be specified here")
{
Loop = true,
Volume = 50
};
player.Load("https://sample-videos.com/video321/mp4/240/big_buck_bunny_240p_30mb.mp4");
player.Resume();
}
private void WindowOnClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
player.Dispose();
}
}
}
But this require the previously mentioned .DLL in a folder to work correctly, for example, in "lib" in the build folder.
My question is:
How may I use the mpv NuGet package to create and/or copy said .DLL in the build folder automatically since I am not able to use it with "using" and then use the other player package to use that .DLL (probably by just proving a valid path) please?
The reason I am mainly interested with the mpv package, is that it would take care of updates more easily than me copying the .DLL every time in another folder for the player package.
In short, I need both packages to work with each other.
May you help me out with this please?
Thank you for your time and help, it is greatly appreciated!
Upvotes: 0
Views: 73