Meta.Vlc icon indicating copy to clipboard operation
Meta.Vlc copied to clipboard

NullReferenceException at VlcPlayer.LoadMedia(Uri uri)

Open nadouamanda opened this issue 6 years ago • 3 comments

Can't be reproduced constantly. Wondering what can cause this issue. WPF project. Below is the stack trace:

System.NullReferenceException: Object reference not set to an instance of an object. at Meta.Vlc.Wpf.VlcPlayer.LoadMedia(Uri uri) at Meta.Vlc.Wpf.VlcPlayer.LoadMedia(String path) at App.Pages.Shared.LoginPopupPageBase.OnLoaded(Object sender, RoutedEventArgs routedEventArgs) in C:\Users\Amanda\Documents\repos\MyProject.App\Pages\Shared\LoginPopupPageBase.cs:line 80 at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent) at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root) at MS.Internal.LoadedOrUnloadedOperation.DoWork() at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

nadouamanda avatar Dec 06 '17 19:12 nadouamanda

I'm initializing the player and loading the media inside the Page.Onloaded event, could this be the reason why?

nadouamanda avatar Dec 06 '17 20:12 nadouamanda

I think you should load media after VlcPlay control be ready, you can try control media with a button...

devkanro avatar Dec 07 '17 15:12 devkanro

Is there an event I could subscribe to, to know that the vlcPlayer is ready?

nadouamanda avatar Dec 07 '17 19:12 nadouamanda