SMF player not playing adaptive streaming when playlistitem is added from codebehind

Nov 30, 2012 at 7:16 PM

This problem is driving me nuts: I can get ExpressionPlayer to work with playlistitems added from codebehind and the SMF player also works, when playlistitems is added in XAML. But not when I add playlistitems from codebehind. I use the following code:

smfPlayer.Playlist.Add(new Microsoft.SilverlightMediaFramework.Core.Media.PlaylistItem   {                

MediaSource = new Uri(@"http://<server>/<file>.ism/Manifest",UriKind.Absolute),                

ThumbSource = new Uri(@"http://<server>/<file>_thumb.jpg",UriKind.Absolute),                

DeliveryMethod = Microsoft.SilverlightMediaFramework.Plugins.Primitives.DeliveryMethods.AdaptiveStreaming   });

smfPlayer.Play();

I get no error and when I hit the playlist is says "now playing" - however nothing happens. I use Win8, VS2012, Silverlight 5, SMF 2.7, MicrosoftSmoothStreamingClient 2.0.

Does anyone know what's going on?

Dec 1, 2012 at 4:55 PM

Solved it:

Had the code in Mainpage after InitializeComponent(). When I instead created a Method (CreatePlayListItem() ) and called that Method from Mainpage it worked. Rather strange.