How to take opened video to a new VideoView after surface gets destroyed in VideoView (eg between Activities Xamarin.Android)?
The problem can be narrowed down to transfering a playing MediaPlayer from VideoView which get surface destroyed to another a new VideoView. Maybe this is wrong approach and better would be remove VideoView from layout and Add it again to another layout? I've tried it and it doesn't work either.
Minimal project and steps to reproduce
Modified LibVLC example.
There is one big button which destroys VideoView and tries transfer MediaPlayer to a new VideoView. It either stop playing video from stream or when uncommented Stop/Play it's opening the stream again.
What is the current bug behavior?
After setting MediaPlayer to a new VideoView, without calling Stop()/Play() it won't get video output again.
What is the expected correct behavior?
I would expect that this is the way how I transfer opened stream to a new VideoView.
Does it work on other plaforms? Does it work with the official VLC apps?
I think it worked with some older versions on iOS but I'm not sure and don't have a mac now to try it.
Relevant logs and/or screenshots
After assigning MediaPlayer to a new VideoView, log:
04-14 17:16:10.504 E/EGL_emulation( 4527): tid 4573: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE) 04-14 17:16:10.537 D/EGL_emulation( 4527): eglMakeCurrent: 0x8804f800: ver 2 0 (tinfo 0x847ad330) 04-14 17:16:10.545 D/EGL_emulation( 4527): eglMakeCurrent: 0x8804f800: ver 2 0 (tinfo 0x847ad330) 04-14 17:16:10.546 E/EGL_emulation( 4527): egl_window_surface_t::swapBuffers called with NULL buffer 04-14 17:16:10.546 E/EGL_emulation( 4527): tid 4573: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
OS: Android Version: 7.1.1 Device: Google Emulator LibVLC version and architecture: 3.1.2 LibVLCSharp version: 3.4.3
I honestly don't know