Xamarin.Andorid doesn't work
Summary
I'm starting build a demo app for android , I tried Xamarin.Form, and Xamarin.Andorid , but it jut doesn't play the url.
after more debug , I find that a native error is being report.
Minimal project and steps to reproduce
private LibVLC libVLC = new LibVLC();
protected override void OnAppearing()
{
base.OnAppearing();
var palyer = new MediaPlayer(libVLC) { EnableHardwareDecoding = false };
this.videoView.MediaPlayer = palyer;
// videoView is the VideoView in xaml file
}
public void PlayButton_Clicked(object sender,EventArgs re)
{
var meida = new Media(libVLC, "https://vjs.zencdn.net/v/oceans.mp4", FromType.FromLocation);
videoView.MediaPlayer.Play(meida);
videoView.MediaPlayer.EncounteredError += (s, e) =>
{
Debug.WriteLine(e.ToString());
};
videoView.MediaPlayer.Playing += (s, e) =>
{
Debug.WriteLine(e.ToString() + "playing");
};
videoView.MediaPlayer.Stopped += (s, e) =>
{
Debug.WriteLine(e.ToString() + "stopped");
};
}
What is the current bug behavior?
not play and there is an error in debug log
03-17 09:51:16.673 D/Mono ( 4802): DllImport searching in: '__Internal' ('(null)').
03-17 09:51:16.673 D/Mono ( 4802): Searching for 'java_interop_jnienv_call_float_method_a'.
03-17 09:51:16.673 D/Mono ( 4802): Probing 'java_interop_jnienv_call_float_method_a'.
03-17 09:51:16.673 D/Mono ( 4802): Found as 'java_interop_jnienv_call_float_method_a'.
03-17 09:51:16.789 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.790 D/Mono ( 4802): Searching for 'libvlc_media_new_location'.
03-17 09:51:16.790 D/Mono ( 4802): Probing 'libvlc_media_new_location'.
03-17 09:51:16.790 D/Mono ( 4802): Found as 'libvlc_media_new_location'.
03-17 09:51:16.790 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.790 D/Mono ( 4802): Searching for 'libvlc_media_new_path'.
03-17 09:51:16.790 D/Mono ( 4802): Probing 'libvlc_media_new_path'.
03-17 09:51:16.790 D/Mono ( 4802): Found as 'libvlc_media_new_path'.
03-17 09:51:16.790 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.790 D/Mono ( 4802): Searching for 'libvlc_media_new_as_node'.
03-17 09:51:16.790 D/Mono ( 4802): Probing 'libvlc_media_new_as_node'.
03-17 09:51:16.790 D/Mono ( 4802): Found as 'libvlc_media_new_as_node'.
03-17 09:51:16.813 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.813 D/Mono ( 4802): Searching for 'libvlc_media_player_set_media'.
03-17 09:51:16.813 D/Mono ( 4802): Probing 'libvlc_media_player_set_media'.
03-17 09:51:16.813 D/Mono ( 4802): Found as 'libvlc_media_player_set_media'.
03-17 09:51:16.815 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.816 D/Mono ( 4802): Searching for 'libvlc_media_player_play'.
03-17 09:51:16.816 D/Mono ( 4802): Probing 'libvlc_media_player_play'.
03-17 09:51:16.816 D/Mono ( 4802): Found as 'libvlc_media_player_play'.
03-17 09:51:16.818 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.819 D/Mono ( 4802): Searching for 'libvlc_media_player_get_media'.
03-17 09:51:16.819 D/Mono ( 4802): Probing 'libvlc_media_player_get_media'.
03-17 09:51:16.819 D/Mono ( 4802): Found as 'libvlc_media_player_get_media'.
03-17 09:51:16.825 D/Mono ( 4802): Requesting loading reference 3 (of 5) of /storage/emulated/0/Android/data/com.companyname.androidsyncclient/files/.__override__/LibVLCSharp.dll
03-17 09:51:16.825 D/Mono ( 4802): Loading reference 3 of /storage/emulated/0/Android/data/com.companyname.androidsyncclient/files/.__override__/LibVLCSharp.dll asmctx DEFAULT, looking for System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
03-17 09:51:16.825 D/Mono ( 4802): Assembly Ref addref LibVLCSharp[0xdf4fa1e0] -> System.Core[0xcc4f0360]: 6
03-17 09:51:16.847 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.847 D/Mono ( 4802): Searching for 'libvlc_media_player_event_manager'.
03-17 09:51:16.847 D/Mono ( 4802): Probing 'libvlc_media_player_event_manager'.
03-17 09:51:16.847 D/Mono ( 4802): Found as 'libvlc_media_player_event_manager'.
03-17 09:51:16.864 D/Mono ( 4802): DllImport searching in: 'libvlc' ('libvlc.so').
03-17 09:51:16.864 D/Mono ( 4802): Searching for 'libvlc_event_attach'.
03-17 09:51:16.864 D/Mono ( 4802): Probing 'libvlc_event_attach'.
03-17 09:51:16.864 D/Mono ( 4802): Found as 'libvlc_event_attach'.
=================================================================
Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
No native Android stacktrace (see debuggerd output).
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0xc2e521c0):0xc2e521b0 24 28 c7 44 24 14 00 00 00 00 8b 83 c4 02 04 00 $(.D$...........
0xc2e521c0 8b 08 83 ec 04 8d 7c 24 28 68 02 00 01 00 57 50 ......|$(h....WP
0xc2e521d0 ff 51 18 83 c4 10 31 f6 85 c0 74 49 c7 44 24 18 .Q....1...tI.D$.
0xc2e521e0 02 00 01 00 8d 83 29 91 7a ff 89 44 24 1c c7 44 ......).z..D$..D03-17 09:51:16.909 F/libc ( 4802): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 4911 (droidsyncclient), pid 4802 (droidsyncclient)
03-17 09:51:17.581 I/OpenGLRenderer( 4802): Davey! duration=788ms; Flags=2, IntendedVsync=780527960641, Vsync=780527960641, OldestInputEvent=0, NewestInputEvent=0, HandleInputStart=780527960641, AnimationStart=780527960641, PerformTraversalsStart=780527960641, DrawStart=780527960641, SyncQueued=780535814900, SyncStart=780535828900, IssueDrawCommandsStart=780535871400, SwapBuffers=780537436000, FrameCompleted=781316512800, DequeueBufferDuration=12601000, QueueBufferDuration=2831000,
03-17 09:51:17.592 I/Choreographer( 4802): Skipped 42 frames! The application may be doing too much work on its main thread.
What is the expected correct behavior?
play the view
Does it work on other plaforms? Does it work with the official VLC apps?
not tried, but a few month ago , a wpf app worked
Environment
- OS: Android 9
- Version
- Device: G6 (customized table, real device) and pixel_2_pie_9 api 28 (simulated x86)
- LibVLC version and architecture : VideoLAN.LibVLC.Android 3.2.0
- LibVLCSharp version : tested both LibVLCShapr.Forms 3.4.3 and 3.2.0
Possible fixes
no