I am using LibVLCSharp and VideoLAN.LibVLC.UWP nuget packages in an UWP app that runs on XBOX. My app does video streaming and I have been using the default Windows Media controls and they work fine. I wanted to also support VLC to handle more codecs and I was able to integrate it in the app, however it seems like while the player is buffering it is making heavy use of the UI thread and the app gets unresponsive to user inputs. The UI thread is completely responsive once the buffering is done.
My understanding is that although the Play method is synchronous it simply signals the player and doesn't block the calling thread. I am sure this is how this works because the UI is not completely unresponsive but it does get stuck a lot.
I am calling the the play method within an async method code like this:
await vlcPlayerElement.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
vlcPlayerElement.MediaPlayer.Play(new VLCMedia(libVLC, url, FromType.FromLocation));
});
Is there anything I can do to ensure the UI thread is responsive at all times?
Thanks in advance for the any help.