Executing VLC for unity

1k views Asked by At

I am facing similar issue like this mentioned in the post:

Triying to run VLC for unity plugin demo

Build platform is WIN 10 x64 (build 2004).

I am using LibVLC from the nightly build: https://artifacts.videolan.org/vlc/nightly-win64-llvm/20200914-0434/

LibVLCSharp gets built successfully (https://code.videolan.org/videolan/LibVLCSharp/-/tree/master/).

I was trying to build "VLCUnityPlugin.dll" but failing (have installed https://github.com/mstorsjo/llvm-mingw/tree/20200325 (LLVM MinGW)), using MSYS64 to run ./build.sh and it was coming up with this error:

MSYS error while building VLCUnity plugin dll

I thought maybe since "VLCUnityPlugin.dll" is NOT present, Unity x64 (v 2019.4.8f1) keeps on complaining with the following errors:

UNITY errors

But after, I hacked "common" make file as shown below:

make file changes to build VLCUnityPlugin.dll I successfully built VLCUnityPlugin.dll and my plugin file structure looks like this now: Plugin directory structure

Still, I do see UNITY Errors: "Assets\VLCUnity\Demos\Scripts\MinimalPlayback.cs(99,39): error CS1061: 'MediaPlayer' does not contain a definition for 'GetTexture' and no accessible extension method 'GetTexture' accepting a first argument of type 'MediaPlayer' could be found (are you missing a using directive or an assembly reference?)"

1

There are 1 answers

3
mfkl On BEST ANSWER

The free trial version is available for download here https://videolabs.io/vlc-unity/vlc-unity-windows-trial.unitypackage.

That being said, if you want to build it yourself, you should follow what the CI does https://code.videolan.org/videolan/vlc-unity/-/blob/master/.gitlab-ci.yml

The libvlcsharp build is a special one, you need to define UNITY when you build it. It has the added GetTexture method.

For VLCPlugin.dll, you should crosscompile from Linux, where you install llvm-mingw and run it from bash (for example). MSYS not needed.