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

Jul 11, 2010 at 5: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 = "http://video3.smoothhd.com.edgesuite.net/ondemand/Big%20Buck%20Bunny%20Adaptive.ism/Manifest";

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

li.DeliveryMethod = DeliveryMethods.AdaptiveStreaming;
mediaPlayer.Playlist.Add(li);

mediaPlayer.AutoPlay = true;
//mediaPlayer.Play();

Jul 12, 2010 at 1:49 PM
Anyone? Is it just me who is getting this behavior?
Coordinator
Jul 12, 2010 at 4: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.

Kevin.

Jul 12, 2010 at 6: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.

http://smf.codeplex.com/workitem/18194

Coordinator
Jul 13, 2010 at 5:27 PM

For resolution see Issue Tracker item: http://smf.codeplex.com/workitem/18194