RendererDiscovererEventManager.OnItemAdded exception on Android (Xamarin.Forms)
When using the MediaPlayerElement in a Xamarin.Forms app running on android, we have occasionally getting the following error when navigating to the page containing the MediaPlayerElement.
RendererDiscovererEventManager.OnItemAdded (System.IntPtr args) System.NullReferenceException: Object reference not set to an instance of an object
We assume this is related to the casting functionality, when it is searching for available casting devices. This error does not happen consistently and we have only been able to reproduce on a Samsung Galaxy S6 and Pixel 1 device. Our video implementation is based on the example project, where the only difference is we dispose of the MediaPlayer and LibVLC objects in the viewmodel when navigating away from the page.
Xamarin.Forms 4.3.0.947036 LibVlc.Forms 3.3.0 VideoLAN.LibVlc.Android 3.1.2.1