I’ve today made good progress in the project I’m dedicated to. I amongst other things included a small video clip as a part of the application. As many of you know, video clips are fairly easy to handle in Silverlight. In XAML, it can be as easy as this:
<MediaElement Source="/Videos/MyVideo.wmv" AutoPlay="False"/>
When debugging though, the damned thing refused to work for me. I soon found out this was because of the method of debugging I was using. Here are the tree primary ways of debugging a WP7 application:
1. No phone, debug in emulator.
2. Phone tethered, debug in phone connected to visual studio.
3. Phone disconnected, code pre-deployed running on phone.
It turns out Media Elements will only display when in debug mode 3. Otherwise you’ll just see black or the first frame. This is also true for any camera functionality. If you have issues with your CameraCaptureTasks, try using debug mode 3.
Developer tip #23