OOB silverlight app fails to load the plugin for a local .mp4 file

Aug 10, 2011 at 6:04 AM
Edited Aug 10, 2011 at 6:05 AM

Hello All,

I am working on upgrading an existing OOB silverlight app to the new  MMP player framework (using SMFPlayer etc.).

Please have a look at the code below, and suggest what I might be doing wrong here.


public class CustomPlayer : SMFPlayer


// Here, the filename can point to a URI(smooth-stream manifest) or a local file name. The files can be .mp4/.wmv

    public void setPlaylistItem(string filename, bool isAdaptive) 

        PlaylistItem item = new PlaylistItem();
        item.MediaSource = new Uri(filename);
        item.DeliveryMethod = isAdaptive ? DeliveryMethods.AdaptiveStreaming | DeliveryMethods.NotSpecified;
        this.GoToPlaylistItem(this.Playlist[0]);  // this line sets up the SMFPlayer.CurrentPlaylistItem.




SMFPlayer.CurrentPlaylistItem is getting set properly to the new playlist item. However, the SelectMediaPlugin is returning null. As a result, the player doesn't play the item selected. I tried changing the DeliveryMethod, but the result is same.

My project includes references to the SmoothStreaming and Progressive plugin dlls.

Thanks in Advance.

Aug 10, 2011 at 2:24 PM

karthik18, make sure you also have a Microsoft.Web.Media.SmoothStreaming.dll reference in your project. If that doesn't work, trying turning on logging: LogLevel="All" LoggingConsolveVisibility="Visible" to help gather more info about what might be going wrong.


Aug 10, 2011 at 5:03 PM

Tim, thanks for the quick reply.

Yes, i do have the reference to Microsoft.Web.Media.SmoothStreaming.dll in my project. I am trying the method to enable the log as you have suggested. The person who implemented this player chose to create the player instance dynamically, so I have added the following code in during the construction of the CustomPlayer object.

                base.LoggingConsoleVisibility = FeatureVisibility.Visible;
                base.LogLevel = LogLevel.All;

Will report back soon what I find out.

Aug 10, 2011 at 5:13 PM

I am getting the following error message in the log.


Unable to Locate A Media Plugin To Play This Media Severity: "Warning" Sender: "Player" Type: "UnableLocateMediaPlugin" Message: "Unable To Locate A Media Plugin To Play This Media"

Maximum Bitrate Changed: 1500000 Severity: "Information" Sender: "Player" type: "MaximumPlaybackBitrateChanged" Message ...


Looks like the log is from this line(hightlighed in red below) of from the file SMFPlayer.cs.

                    ActiveMediaPlugin = SelectMediaPlugin(CurrentPlaylistItem);
                    if (ActiveMediaPlugin != null)
                        SendLogEntry(KnownLogEntryTypes.PlaylistItemChanged, message: SilverlightMediaFrameworkResources.PlaylistItemChangedLogMessage);
                        PlaylistItemChanged.IfNotNull(i => i(this, new CustomEventArgs<PlaylistItem>(CurrentPlaylistItem)));
                        SendLogEntry(KnownLogEntryTypes.UnableToLocateMediaPlugin, LogLevel.Warning, SilverlightMediaFrameworkResources.UnableToLocateMediaPluginLogMessage);
                        PlaylistItemChanged.IfNotNull(i => i(this, new CustomEventArgs<PlaylistItem>(CurrentPlaylistItem)));





Aug 10, 2011 at 5:50 PM

OK, this means MEF is unable to find or load a plugin for the given deliverymethod. If you're using adaptive deliverymethod, you just need to have:






A few more things to check:

Make sure all of these assemblies are in your main Silverlight project. Do not rely on dependency project refereneces to include these assemblies in your xap

Make sure Copy Local = true for all project references (not sure if this is necessary)

Make sure that the assemblies are "unblocked". This can happen if you download a zip file from the web and don't unblock it before extracting. Right click on each dll in Windows Explorer and check for an unblock button.

Make sure Microsoft.Web.Media.SmoothStreaming is from the v1.5 Update 1. The dll should be version 1.5.938.92. There is a link to the setup on our download page.

Last resort: Clean your solution, reload Visual Studio and rebuild your solution.

Aug 10, 2011 at 10:45 PM

I have all these references in the project.  Thanks for pointing out the version of the SmoothStreaming dll, I was about to ask that question, 'cause I found two versions of this .dll on my PC, and the current project is referencing to a different version.

Will post later after try out the other things you have suggested.

Aug 11, 2011 at 3:08 PM

Tim, Thank you so much. This did the trick. 

You said:
Make sure all of these assemblies are in your main Silverlight project. Do not rely on dependency project refereneces to include these assemblies in your xap


I am able to play the media in the OOB player now.


One side question:

Which is an efficient DeliveryMethod of a .wmv/.mp4 files while playing the content within Browser ?  Is it "ProgressiveDownload" or "Streaming" or just leave it as "NotSpecified" ? Currently I have it as "ProgressiveDownload".

Nov 9, 2011 at 7:41 AM

I had this error and lost a couple of days of work due to it. In my case the problem was different, I write here the solution for anyone to see.

I needed to add a reference to System.Windows.Controls.Toolkit.Internals.dll to my project.

Happy bug hunting.


Nov 9, 2011 at 3:06 PM

karthik18, ProgressiveDownload is the correct DeliveryMethod for .wmv & .mp4 files.

Sergi, System.Windows.Controls.Toolkit.Internals.dll is not used by the player framework. However, do use MEF to find the plugins in your app so maybe this dll was missing from your app and it caused MEF to fail. This is the only explanation I can come up with for why it would be involved. Glad to hear it is working for you now.