Thursday, 23 June 2011

Sliverlight SMF smooth stream player

Can't get your silverlight player to play smooth stream ? Driving you mad ? Yup me too, and this aint the first smoooth stream player I've written ... but not having access to the code for the previous ones, it was driving me crazy.

I kept getting the dreaded AG_E_NETWORK_ERROR 4001 - very helpful.

Anyway, all is not lost. If you're using the SMF (Silverlight Media framework) player as the base player, check you have the following references :
Microsoft.SilverlightMediaFramework.Plugins.SmoothStreaming.dll
Microsoft.Web.Media.SmoothStreaming.dll

And also, make sure you have this magic setting when setting up the PlaylistItem :

DeliveryMethod = DeliveryMethods.AdaptiveStreaming
MyPlayer.Playlist = new ObservableCollection {
new PlaylistItem
{
DeliveryMethod = DeliveryMethods.AdaptiveStreaming,
MediaSource = new Uri(url)
}
};

No comments:

Post a Comment