I have tested the WPF minimal VLC sample on code.videolan website, and it works fine.
I then prepare (and package) the app for the Windows store following Microsoft documentation here, and basically it no longer works with the failed to load libs message.
Setting the .package project as startup project creates the issue. Theses are the packages I have, although UWP has just been added and is not referenced anywhere.
Within the VLC sample, it fails directly on Core.Initialize();
void VideoView_Loaded(object sender, RoutedEventArgs e)
{
Core.Initialize();
_libVLC = new LibVLC();
_mediaPlayer = new MediaPlayer(_libVLC);
VideoView.Media
_mediaPlayer.Play(new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")));
}
If I put:
var url = typeof(LibVLC).Assembly.Location;
before the Core.ini line to check where it's looking, I get: "C:\Users\franc\Documents\Visual Studio 2019\Projects\VLCTest\VLC.Package\bin\x64\Debug\AppX\VLCTest\LibVLCSharp.dll"
Which looks ok to me.. Any suggestions?
Edit 1
The libvlc folder is not being created under AppX folder:
{"Failed to load required native libraries. \r\nHave you installed the latest LibVLC package from nuget for your target platform?\r\nSearch paths include
...Projects\VLCTest\VLC.Package\bin\x64\Debug\AppX\VLCTest\libvlc\win-x64\libvlc.dll, ...Projects\VLCTest\VLC.Package\bin\x64\Debug\AppX\VLCTest\libvlc\win-x64\libvlccore.dll; ...Projects\VLCTest\VLC.Package\bin\x64\Debug\AppX\VLCTest\libvlc\win-x64\libvlc.dll, ...Projects\VLCTest\VLC.Package\bin\x64\Debug\AppX\VLCTest\libvlc\win-x64\libvlccore.dll; ...Projects\VLCTest\VLC.Package\bin\x64\Debug\AppX\VLCTest\libvlc.dll,"}
So I manually copied the folder from the WPF project (no longer the startup project) to the new .package startup project AppX ... folder and it worked.
What would be the clean solution for this?
Packaging with MSIX has never been tested as far as I know.
Does your libvlc.dll, libvlccore.dll files and plugins folder get copied properly next to your app's DLL?
If you're not using UWP, don't reference LVS.UWP.