Calling Play() on mediaplayer causes video not to start and does not throw any error message

Jul 11, 2010 at 6:04 AM

Below is how I set media for player. If I set the media in code and then call Play(), nothing happens (video does not start and I dont get any error message).

If I set AutoPlay to true and DO NOT call Play(), video starts fine. If I keep AutoPlay to true and call Play() as well, again video does not start and I dont get any error message either.

I tried to catch event for  mediaPlayer_PlayStateChanged, mediaPlayer_MediaFailed but nothing happens.

string path = "";

PlaylistItem li = new PlaylistItem();li.MediaSource = new Uri(path, UriKind.RelativeOrAbsolute);

li.DeliveryMethod = DeliveryMethods.AdaptiveStreaming;

mediaPlayer.AutoPlay = true;

Jul 12, 2010 at 2:49 PM
Anyone? Is it just me who is getting this behavior?
Jul 12, 2010 at 5:34 PM

darwaish, I suspect you're making the call to Play() inside of the constructor of your view?  Try waiting until the Loaded event fires, that way the player can complete it's initialization.  If I'm making an incorrect assumption let me know, and if you have a bit of code you could post I'll take a look.


Jul 12, 2010 at 7:19 PM

Thanks for all your help Kevin. I uploaded zip file of solution to Issue Tracker because I dont see any option to attach file in discussion thread.

Jul 13, 2010 at 6:27 PM

For resolution see Issue Tracker item: