Meta.Vlc
Meta.Vlc copied to clipboard
Recommended exception handling
Hi I noted in #95 you mentioned that "Yes, it is known issue for xZune.Vlc", I presume this means there will be no solution for using this control in Windows 7.
Since we have to make our applications compatible with all modern operating systems, and Windows 7 is still the most popular operating system, I need to implement robust error handling to deal with this situation where one video hangs after playing another. I can tolerate a video not playing but having the app hang is not an option.
Is there a recommended error trapping pattern that can be used? It looks like xZune is spinning up a separate thread to run the VLC control, so I am not clear how this error can be trapped. Any thoughts would be appreciated! Thanks
The one solution of this issue is when you want to play a new media release the old VlcMediaPlay and create a new.
The disadvantage is that the settings(like volume or others) of old player can not be applied to new.
Tried to create a new VlcMediaPlayer before opening new video file to avoid "AccessViolationException" on Windows7 and now each video is opening in separate window with title "VLC (Direc3D output)". I'm using latest sources. Any ideas hot can I avoid that?
After you create a new VlcMediaPlayer some callback and event need to be attached. Maybe I can add a method to VlcPlayer later. VlcPlayer.RebuildPlayer();
Check the new code, and use the VlcPlayer.RebuildPlayer(); method after stop to create a new VlcMediaPlayer.
Awesome, thanks for the change, it helps in some case. Now on Windows 7 there is no exception, but video is not shown after calling RebuildPlayer(). Looks like Vlc object (VlcPlayer.Vlc) should also be rebuilt. There is no such problem on Windows 8,10.
Thanks for your test. From your description... I think the problem about LibVlc in Win7 is VLC instance have been released after stop video.
I don't know is it a issue of xZune.Vlc, you can help me to test it, you can take a breakpointer in Vlc.Dispose(). I think xZune.Vlc maybe call the Vlc.Dispose() after stop video.
Did some tests. It's not about Vlc.Dispose(), but happens because Stop() call inside RebuildPlayer() function. VideoSource changes twice, first it sets BitmapSource correctly and then sets to null, because of asynchronous Stop() function. After removing this call, player works as expected.
Strange that it works ok on Win8 and 10.
Ummmm, I got it. Maybe some fix will be commit later.
FYI, I just wanted that this happens in Windows 10 as well. I haven't been able to pinpoint the cause or what's happening, unfortunately.