2

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.

jv42
  • 8,521
  • 5
  • 40
  • 64
Eloar
  • 464
  • 1
  • 8
  • 21

4 Answers4

2

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

Nitro
  • 624
  • 8
  • 21
  • Beware though that their supposed 'fixes' to OCP really broke DRM protected files playback on many client PCs (error 6030). – jv42 May 21 '12 at 12:33
  • I think this error can be fixed in PlayReady SDK 2.1, without being 100% sure. – Nitro May 21 '12 at 12:56
  • 1
    Yes, it is, but you have to deploy an update to the PlayReady server, which not everybody can do. – jv42 May 21 '12 at 12:57
2

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.

BartekR
  • 3,827
  • 3
  • 24
  • 33
  • Ok, so it looks like I have to manually acquire license if user is SL5 and his license expired. I'm trying to do so, but this code: `acq.AcquireLicenseAsync(_mediaSource.Buffer.DrmHeader.DrmHeaderBin);` (DrmHeader is PlayReady Header from parsed file, and acq is my custom license acquirer) is not working properly :/. – Eloar Jan 17 '12 at 15:55
  • @fxEloar Have you solved the issue? Or could you explain what your exact problem is? – jv42 Mar 06 '12 at 11:31
  • 1
    @jv42 I did solved it. Code `acq.AcquireLicenseAsync(_mediaSource.Buffer.DrmHeader.DrmHeaderBin);` is working properly, but had to be invoked on new CustomLicenseAcquirer, because the old one is holding its state. I created handler for event LicenseAsquisitionDone to start playback after getting new license for my content, or to show error message on exception. – Eloar Mar 06 '12 at 15:28
1

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();    
    }
}
0

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.

Sander
  • 25,685
  • 3
  • 53
  • 85
  • It might be hard and useless to ask your service clients to remove persistent licenses from their machines. Only few simple changes in my player code and no action from users are needed. – Eloar Jan 05 '15 at 08:21