MMPPF Generic Plugin and setting Custom License Acquirer

Jul 2, 2012 at 9:57 PM

I have written a plugin that goes through a flow to establish a DRM key which is then passed in as Custom Data on a license request. 

 [ExportGenericPluginAttribute(PluginName = "DRMPlugin", 
        PluginDescription="A plug-in to acquire required DRM tokens to playback content",
        PluginVersion="0.1")]

In the plugin I wish to do the follwoing which is usally done on MediaPluginLoaded if there was no plugin

 ManualLicenseAcquirer manualLicenseAcquirer = new ManualLicenseAcquirer();
                                                manualLicenseAcquirer.ChallengeCustomData = "<xcal-custom-data>" + drmKey + "</xcal-custom-data>";
                                                manualLicenseAcquirer.LicenseServerUriOverride = UriHelper.GetLicenseServierUri();

                                                player.ActiveMediaPlugin.LicenseAcquirer = manualLicenseAcquirer;

What is the best way to do it. If I set it on player I never see the request go out.

Thank you.

Coordinator
Jul 2, 2012 at 10:08 PM

rustamk, I haven't tested this but I believe you can trap for the PlaylistItemChanged event and set e.Value.LicenseAcquirer to your custom object.

Jul 2, 2012 at 10:21 PM
Tim,

Thanks for the quick reply. Unfortunately playlistitemchanged is not exposed only content changed event is, which does not have an API to set a LS.

Any other suggestions?

Rus

On Jul 2, 2012, at 4:08 PM, "timgreenfield" <notifications@codeplex.com> wrote:

From: timgreenfield

rustamk, I haven't tested this but I believe you can trap for the PlaylistItemChanged event and set e.Value.LicenseAcquirer to your custom object.

Coordinator
Jul 2, 2012 at 11:04 PM

rustamk, you can cast the player object to SMFPlayer to have access to the event...

((SMFPlayer)player).PlaylistItemChanged += handler;

Jul 2, 2012 at 11:27 PM

That worked thank you. Good to know that can be casted :)

Jul 10, 2012 at 6:01 PM

Tim,

One more question for you. Is there a recommended way for sending in values in to the plugin at initialization time. 

 

Thank you.

 

Rus

Coordinator
Jul 10, 2012 at 6:10 PM

Hi Rus, yes: there is a dictionary of values you can set via

SMFPlayer.GlobalConfigMetadata (for data scoped to the player)

or

PlaylistItem.CustomMetadata (for data scoped ot the playlistitem)

You can then retreive these values from the plugin.

Regards, Tim

Oct 28, 2013 at 10:50 AM
Hi rustamk,

Are you able to send customdata from windows phone 7 device?
If yes, could you please share your player source code?

Many many thans in advance.

regards,
Dharmendra