VideoMosaic exception on iOS
Hello, you need to put the VideoView component in page in a navigation stack. While playing, if you tap the back button (to go to the previous page) you will have the following exception (only on iOS):
I try to add a OnDisappearing code, but it doesnt works
protected override void OnDisappearing()
{
VideoView0.MediaPlayer.Stop();
VideoView0.MediaPlayer.Dispose();
_libvlc.Dispose();
base.OnDisappearing();
}
Message: Object reference not set to an instance of an object
StackTrace
" at Xamarin.Forms.Platform.iOS.ViewRenderer2[TView,TNativeView].SetNativeControl (TNativeView uiview) [0x00041] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at LibVLCSharp.Forms.Platforms.iOS.VideoViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs
1[TElement] e) [0x00015] in <0b23094b6c3a414dbaec4ce44689c110>:0 \n at Xamarin.Forms.Platform.iOS.VisualElementRenderer1[TElement].SetElement (TElement element) [0x0012a] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at Xamarin.Forms.Platform.iOS.VisualElementRenderer
1[TElement].Dispose (System.Boolean disposing) [0x0008c] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at Xamarin.Forms.Platform.iOS.ViewRenderer2[TView,TNativeView].Dispose (System.Boolean disposing) [0x0005c] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.0/src/Xamarin.iOS/Foundation/NSObject2.cs:147 \n at Xamarin.Forms.Platform.iOS.DisposeHelpers.DisposeModalAndChildRenderers (Xamarin.Forms.Element view) [0x00041] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at Xamarin.Forms.Platform.iOS.Platform.HandleChildRemoved (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000a] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at Xamarin.Forms.Element.OnDescendantRemoved (Xamarin.Forms.Element child) [0x00000] in D:\\a\\1\\s\\Xamarin.Forms.Core\\Element.cs:600 \n at Xamarin.Forms.Element.OnDescendantRemoved (Xamarin.Forms.Element child) [0x00018] in D:\\a\\1\\s\\Xamarin.Forms.Core\\Element.cs:601 \n at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x0001f] in D:\\a\\1\\s\\Xamarin.Forms.Core\\Element.cs:325 \n at Xamarin.Forms.VisualElement.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in D:\\a\\1\\s\\Xamarin.Forms.Core\\VisualElement.cs:750 \n at Xamarin.Forms.Page.OnInternalRemoved (Xamarin.Forms.VisualElement view) [0x00013] in D:\\a\\1\\s\\Xamarin.Forms.Core\\Page.cs:393 \n at Xamarin.Forms.Page.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002c] in D:\\a\\1\\s\\Xamarin.Forms.Core\\Page.cs:363 \n at System.Collections.ObjectModel.ObservableCollection
1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in <1f9da90787fa4aaeae29e27725405a37>:0 \n at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <1f9da90787fa4aaeae29e27725405a37>:0 \n at System.Collections.ObjectModel.ObservableCollection
1[T].RemoveItem (System.Int32 index) [0x00021] in <1f9da90787fa4aaeae29e27725405a37>:0 \n at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x00027] in <50aa8c853ba54c99b7836ba4b45a5828>:0 \n at Xamarin.Forms.NavigationPage.Xamarin.Forms.INavigationPageController.RemoveAsyncInner (Xamarin.Forms.Page page, System.Boolean animated, System.Boolean fast) [0x000e7] in D:\a\1\s\Xamarin.Forms.Core\NavigationPage.cs:316 \n at Xamarin.Forms.Platform.iOS.NavigationRenderer.UpdateFormsInnerNavigation (Xamarin.Forms.Page pageBeingRemoved) [0x000b7] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at Xamarin.Forms.Platform.iOS.NavigationRenderer+ParentingViewController.DidMoveToParentViewController (UIKit.UIViewController parent) [0x0007f] in <7ebe39ff6b6a406098d4f53a5ff873cb>:0 \n at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.0/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1023 \n at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.0/src/Xamarin.iOS/Foundation/NSAction.cs:178 \n at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)\n at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:79 \n at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.8.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:63 \n at UserApp.iOS.Application.Main (System.String[] args) [0x00001] in /