VLC for Unity Android Plugin integration issues
Summary
We loaded the "VLC 3D example" scene and we run it with no issues on Windows Platform. When it comes to Android, the app opens correctly on our Samsung devices (S9, A53, S22+), the room is showed but the screen shows the VLC logo on black background only. The video doesn't start.
Minimal project and steps to reproduce
- Download this package: https://videolabs.io/solutions/vlc-unity-trial.unitypackage
- Create a new Unity 3D project (we are using Unity 2020.3.17f1).
- Import the package (downloaded in step 1) simply double clicking on it.
- From Project Tab -> Assets -> VLCUnity -> Demos -> Scenes load "VLC 3D example.unity".
- From File -> Build Settings -> Platform -> Select Android -> Build and run -> Type .apk name -> Wait for execution in the Android Device.
- The room is shown but the screen shows the VLC logo on black background only. The video doesn't start at all.
What is the current bug behavior?
On Android Device, the room is shown but the screen shows the VLC logo on black background only. The video doesn't start at all. Sometimes the console shows these two errors:
Autoconnected Player DllNotFoundException: libVLCUnityPlugin at (wrapper managed-to-native) LibVLCSharp.OnLoad.SetColorSpace(LibVLCSharp.OnLoad/UnityColorSpace) at LibVLCSharp.OnLoad.OnBeforeSceneLoadRuntimeMethod () [0x00001] in E:\LAVORO\Progetto VR360\streamingrtspvisore\vlcandrea\Assets\VLCUnity\Internal\OnLoad.cs:30
Autoconnected Player DllNotFoundException: libvlc at (wrapper managed-to-native) LibVLCSharp.Core+Native.LibVLCVersion() at LibVLCSharp.Core.EnsureVersionsMatch () [0x00000] in /builds/videolan/vlc-unity/tmp/lvs/src/LibVLCSharp/Core/Core.cs:39 at LibVLCSharp.Core.Initialize (System.String libvlcDirectoryPath) [0x0000b] in /builds/videolan/vlc-unity/tmp/lvs/src/LibVLCSharp/Core/Core.Desktop.cs:55 at VLCPlayerExample.CreateLibVLC () [0x0002f] in E:\LAVORO\Progetto VR360\streamingrtspvisore\vlcandrea\Assets\VLCUnity\Demos\Scripts\VLCPlayerExample.cs:254 at VLCPlayerExample.Awake () [0x00010] in E:\LAVORO\Progetto VR360\streamingrtspvisore\vlcandrea\Assets\VLCUnity\Demos\Scripts\VLCPlayerExample.cs:46
but sometimes not... but the behavior is the same, it doesn't show the video on Android Devices. We also selected the correct architecture in libvlc.so (path: VLCUnity/Plugins/Android) but unsuccessful.
What is the expected correct behavior?
Showing the RTSP video correctly on Android Devices.
Does it work on other plaforms? Does it work with the official VLC apps?
It works selecting from File -> Build Settings -> Platform -> Select Android -> Build and run -> PC, Mac & Linux -> Platform "Windows".
Environment
- OS: Windows 10
- Version 21H2
- Device: HP Gaming 15-ak002nl Notebook - Intel Core i7-6700HQ CPU - 16GB RAM - GTX950M GPU
- Device: Samsung A53, Samsung S9, Samsung S22+
- LibVLC version and architecture: 4.0.0-dev-20419-g490c04ad03
- LibVLCSharp version: 4.0.0.0
- VLC Unity plugin version: downloaded here -> https://videolabs.io/solutions/vlc-unity-trial.unitypackage
- Scripting backend used: Visual Studio 2019
Possible fixes
All the other scenes have the same problem. They work on Windows, but not on Android Devices. So the problem may be in the VLC plugin itself, not single scene related.