Reputation: 2750
In my Xamarin.Forms.Android app I'm trying to playback a HLS video encoded with azure media services.
This works in debug mode. But when I run in release mode I see the following problem:
I tried to fix release mode by setting my android project linker settings from "Sdk Assemblies Only" to "none" and this seemed to do the trick, playback worked in release mode when pushing it to an attached device.
To reproduce the problem in debug mode I had to both
I then saw the following output:
[VLC] [00000074f8240e90/4256] libvlc window: AndroidNativeWindow jni init failed [VLC] [00000074f8240e90/4256] libvlc window: InitJNIFields failed [VLC] [00000075175fdc90/4258] libvlc vout display: parent window not available [VLC] [00000074f385e990/4256] libvlc video output: video output creation failed [VLC] [00000074edff459003-04 13:35:46.832 E/VLC (15716): [00000075001e6890/4256] libvlc decoder: failed to create video output [VLC] [00000075001e6890/4256] libvlc decoder: Opaque Vout request failed [VLC] [00000074f8241750/4259] libvlc window: AndroidNativeWindow jni init failed [VLC] [00000074f8241750/4259] libvlc window: InitJNIFields failed [VLC] [000000751fe4ba90/4260] libvlc vout display: parent window not available [VLC] [0000007517212f90/4259] libvlc video output: video output creation failed [VLC] [00000075001e6890/4259] libvlc decoder: failed to create video output [VLC] [00000074fcef7590/425a] libvlc window: AndroidNativeWindow jni init failed [VLC] [00000074fcef7590/425a] libvlc window: InitJNIFields failed [VLC] [00000075175fe890/4261] libvlc vout display: parent window not available
This leads me to the conclusion that there is code that is stripped out by the linker that the vlc media player needs in order to playback my stream. However the the documentation does not state anything is needed to fix the linker.
I am using
when searching for the error codes I came across this issue https://code.videolan.org/videolan/LibVLCSharp/-/issues/255 which seems to address the problem. Will post an update if this fixes the problem
Upvotes: 0
Views: 469
Reputation: 2750
yes, the solution was as mentioned in the issue to:
- Add a file to your Xamarin.Android app root named "r8.cfg"
- in the properties set Build Action to "ProguardConfiguration".
- In this file add lines:
-keep class org.videolan.** { *; }
-dontwarn org.videolan.**
Upvotes: 1