Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException at VlcPlayer.LoadMedia(Uri uri) #253

Open
nadouamanda opened this issue Dec 6, 2017 · 3 comments
Open

NullReferenceException at VlcPlayer.LoadMedia(Uri uri) #253

nadouamanda opened this issue Dec 6, 2017 · 3 comments

Comments

@nadouamanda
Copy link

nadouamanda commented Dec 6, 2017

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
Copy link
Author

nadouamanda commented Dec 6, 2017

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

@devkanro
Copy link
Owner

devkanro commented Dec 7, 2017

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

@nadouamanda
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants