Playback crash in v1.1 when using media keys or WMC remote control

Topics: Windows 8 Xaml
Mar 2, 2013 at 6:08 AM
The crash occurs hitting skip or stop (and probably other keys) while playing back video.

The crash I'm seeing is in the anonymous delegate inside MediaControlPlugin.MediaControl_StopPressed.

Not too thrilled about this since we just shipped an update with the PF v1.1 update. :-(

Anyway, setting AutoLoadPlugins to false and adding all the other plugins by hand is a valid workaround.
Mar 4, 2013 at 4:37 PM
I am unable to duplicate this using the media buttons on my keyboard. Can you either provide a repro or give this a try in our sample app along with more information about the hardware buttons you are using to invoke stop & skip?

Thanks, Tim
Mar 4, 2013 at 6:57 PM

Sorry for the post and run the other day. It was a busy day. :-\

Anyway, I played with your sample app and I understand the issue better now. I think part of it is our bug and part of it is is a PF bug.

Our app registers for the MediaControl.StopPressed event, and goes back to the previous page when this is fired. It also disposes the MediaPlayer instance in OnNavigatedFrom, just like the samples do.

So when the user presses stop (via remote control or keyboard media keys), we go back and dispose the MP. The MP's MediaControl plugin then receives it own event callback for MediaControl.StopPressed, and tries to do stuff. Unfortunately, because the MP instance is disposed, you hit a NullReferenceException on the interactive view model member (I think).

So... We shouldn't use this plugin when handling MediaControl events our way (that's our bug). The MediaControl plugin needs to be more careful about handling events when the MediaPlayer is already disposed, since the MediaControl seems to have a fairly free-threaded threading model (that's the PF bug).
Mar 4, 2013 at 11:09 PM
Good find. I'll make sure our part in this issue is fixed in the next update. DM me if this is blocking you from release.

Regards, Tim