Share via


Windows Media Rights Manager SDK banner art

Complex License Generation

In this scenario, you can issues different combinations of licenses :

  • Version 10 license only

  • Version 10 license and a version 1 license

    Note   The version 1 license allows unlimited play, but you can specify different rights for the version 10 license.

  • Two version 10 licenses with different priorities

You can also select which rights are allowed.

When the Windows Media file is packaged, different attributes are added to the content header, depending on your selection. Then, Windows Media License Service issues licenses with certain rights according to these attributes.

  • When you select the license combination to issue, a content ID (CID) attribute is set. It is used by Windows Media License Service to determine which licenses to issue. However, in practice, it is strongly recommended that you use a globally unique identifier (GUID) for content IDs.

  • When you select the rights to allow, a rights ID (RID) attribute is set, using the rights string as the value. This value is used by Windows Media License Service to determine which rights to allow in the license. However, in practice, you should not specify the rights for Windows Media files this way unless you are only issuing version 10 licenses. For example, a player supporting version 1 would not be able to extract this rights string when requesting a license.

    A better way for Windows Media License Service to determine which rights to allow is to find the content ID for a packaged Windows Media file in a database, and then issue rights accordingly.

The following .asp files are included in the Complex License Generation sample:

  • Package.asp. This page enables you to specify a Windows Media file to be packaged, select the type of license to be issued (which scenario to test), and select the rights to allow in the license.
  • Complex.asp. This page parses the request, and sets the values for the RID and CID attributes. Then, checks whether the license is for silent or nonsilent delivery. If silent delivery is used, this page generates and delivers the license.
  • ComplexLicGen.asp. This page generates licenses. You can also set different rights for the version 1 license, which are hard-coded in this file.
  • ComplexRights.asp. This page generates the rights string for version 10 licenses.
  • Complex_NS.asp. If nonsilent delivery is used, this page delivers the license and confirms delivery.

To test this sample

  1. Open Package.asp, then fill out the form by specifying the Windows Media file to be packaged, the output path and file name for the packaged Windows Media file, select Complex for License acquisition URL, and specify the license to issue and the rights to allow. Click Package.

    Note   Make sure the output folder allows Change permission to Everyone. Otherwise, an "Access is denied" message appears when you try to package files.

  2. To test license delivery, play the packaged Windows Media file. If you use Windows Media Player 7 or later, you can change the preferred license delivery method (silent or nonsilent) by selecting Options on the Tools menu, clicking the Privacy tab, and then selecting or clearing the Acquire licenses automatically for protected content option.

See Also