Question

After upgrade from Silverlight 4 to Silverlight 5 I get System.Exception 6028 when MediaElement in my own player tries to play DRM h264 video. It happens when I already have license stored on my computer.

This happens on Silverlight 5.0.61118.0.

I would appreciate any help on identifying cause of that exception, and finding solution other than deleting licenses and acquiring them again.

EDIT: I deleted all PlayReady licenses on my PC, but after some time I did get that system exception again. One good thing about it is I could copy this exception message:

System.Exception: 6028 No valid simple or leaf license is available to create the decryptor

I did checked one more thing. DRM server which my app is asking for licence is 1.5.2 version.

Was it helpful?

Solution

Check http://blogs.msdn.com/b/playready4/archive/2011/12/08/playready-license-acquisition-fails-after-upgrading-to-silverlight-5.aspx

To fix this issue (in the case of expired persistent license), we need to use MediaFailed event handler. In the handler, if the error code is 6028, we just need to use LicenseAcquirer to acquire license. The LicenseAcquirer could be a custom LicenseAcquirer or the default LicenseAcquirer of SSME.

OTHER TIPS

Just an update, for new readers, this have been solved in Silverlight 5.1.10411.0.

Release notes from Microsoft:

Fixes an issue where persistent license acquisition would fail when a customer upgrades from Silverlight 4 to Silverlight 5.

From: http://www.microsoft.com/getsilverlight/locale/en-us/html/Microsoft%20Silverlight%20Release%20History.htm

As mentioned in one of the previous answer you should check for 6028 error code

To fix this issue (in the case of expired persistent license), we need to use MediaFailed >event handler. In the handler, if the error code is 6028, we just need to use LicenseAcquirer >to acquire license. The LicenseAcquirer could be a custom LicenseAcquirer or the default >LicenseAcquirer of SSME.

As showned in the example below we have used custom license acquirer.

protected void OnMediaFailed(object sender, CustomEventArgs<Exception> e)
{
    if (e.Value.Message.StartsWith("6028"))
    {
        //Get Manifest Info Somehow
         ........
        //our custom acquirer initialization
        var acquirer = new ManualLicenseAcquirer(); 
        if (manifestInfo != null 
        && manifestInfo.ProtectionInfo != null
        && manifestInfo.ProtectionInfo.ProtectionHeader != null)
    {
        acquirer.AcquireLicenseCompleted += this.OnLAcquirerCompleted;
        acquirer.AcquireLicenseAsync(manifestInfo.ProtectionInfo.ProtectionHeader.ProtectionData);
    }
    else
    {
        this.ShowCustomError("Manifest info is null or protection header is null", true, true);
    }
}

private void OnLAcquirerCompleted(object sender, AcquireLicenseCompletedEventArgs e)
{
    if (e.Error != null)
    {
        this.ShowCustomError(string.Format("Server response error: {0}", e.Error), true, true);
    }
    else if (e.Cancelled)
    {
        this.ShowCustomError(string.Format("Manual license acquier request was cancelled"), true, true, true);
    }
    else
    {
        this.Play();    
    }
}

I have found that upgrading to Silverlight 5 often breaks the PlayReady installation used by Silverlight, with nonsensical errors being raised when you attempt playback.

The fix that has worked for me is:

  1. Uninstall Silverlight 5
  2. Delete %ProgramData%\Microsoft\PlayReady (note that this will also delete all persistent licenses)
  3. Restart.
  4. Reinstall Silverlight 5

On some machines, I have needed to repeat this process multiple times to get PlayReady working again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top