2

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. enter image description here

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,"}

Folder View

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?

Franck E
  • 629
  • 8
  • 26

1 Answers1

4

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.

cube45
  • 3,429
  • 2
  • 24
  • 35
  • Thank you Jeremy for your prompt reply. I have removed UWP package from solution and added a new section to the initial question. The libvlc folder is not being looked at at the correct location. Can we add a manual path? Or a cleaner solution? – Franck E Apr 04 '21 at 08:38
  • 1
    libvlc should be copied properly if you're using the VideoLAN.LibVlc.Windows package. If it's not, please open an issue on the libvlc-nuget repository, and send us a minimal project that shows the issue. – cube45 Apr 04 '21 at 12:55
  • Thank you, issue 454 logged. – Franck E Apr 04 '21 at 14:58
  • If you don't mind, one last question. What is the difference between the mentioned packages (libvlcsharp) and the nuget vlc.dotnet packages? Only thing is see is the latest (dotnet) have not been updated for a year ++ and publisher is zebobo5, but you seem to be involved in both.. – Franck E Apr 05 '21 at 17:02
  • 1
    Answer is here : https://github.com/ZeBobo5/Vlc.DotNet . I'm the only maintainer left on the project and as VideoLAN was creating its own binding (LVS), the Vlc.DotNet project was put into maintenance mode and efforts are concentrated on LVS. – cube45 Apr 05 '21 at 22:15