Windows Media Rights Manager SDK banner art

Creating Packaged Windows Media Files

Packaging involves generating a content header , signing the content header, and encrypting the Windows Media file with a key . However, before packaging Windows Media files, you must encode them into Windows Media Format with .asf, .wma, or .wmv file name extensions by using one of the following codecs:

  • Microsoft Windows Media Video codec version 1.0 or later
  • Microsoft Windows Media Audio codec version 1.0 or later
  • Microsoft Windows Media Screen codec version 7.0 or later
  • ISO MPEG-4 codec version 1.0

For a list of the most current authorized codecs, see the Authorized Codecs for Windows Media Rights Manager page at the Microsoft Web site.

Notes

  • Consumers cannot play packaged Windows Media files that are encoded with an ACM codec.
  • Protected content that is encoded using the Windows Media Audio 9 Professional codec cannot be played on portable devices.

To encode your files, you can use a tool such as Windows Media Encoder. As you encode your files, you should add any information about each file that you want to appear in the player , such as the name of the artist, title, copyright, or images. Then, you can package your files.

The following table lists the information you must specify or generate for packaging.

Value Description
License key seed A value that is used to generate the key for a Windows Media file. You generate a license key seed by using the GenerateSeed method of the WMRMKeys object. You can generate a new license key seed as often as you want to, so long as you know which value was used to package each file.
Key ID A value that is generated by the WMRMKeys object. This value is used with the license key seed to generate the key.
Key A value that is generated by the WMRMKeys object and is used to encrypt the Windows Media file.
License acquisition URL A URL that points to the first page in your license acquisition process.
Input file name The name of the Windows Media file to be packaged. The file must be in Windows Media Format, but the extension is not enforced.
Output path and file name The path and name of the final packaged file, which must be different than the input file. The result is a file in packaged Windows Media Format, but the extension you specify is not enforced.
Content ID A value that uniquely identifies each Windows Media file you package. You can generate this value by using the WMRMKeys object. Optional, but recommended.
Attributes One or more name-value pairs you specify so that you can include more information in the content header of the Windows Media file. Recommended.
Required individualization version The minimum individualization (security upgrade) version required for playing your Windows Media files. Optional.
Version 1 license acquisition URL A URL that points to the first page in the license acquisition process for players that support only version 1. The default value is https://www.microsoft.com/isapi/redir.dll?prd=wmdrm&pver=2&os=win&sbp=newclient, which points to a Web page where consumers can get a player that supports Windows Media Rights Manager SDK version 7 or later.
Version 1 key ID A value that you include if you issue version 1 licenses ; this value should be the same as that for the version 7 or later key ID. If you use the default version 1 license acquisition URL (you don't specify one), this value is optional.
Uplink ID For leaf licenses, a value that is generated by the WMRMKeys object and identifies the key ID of the root element in a license chain. Optional; used only for license chains.

The following diagram shows the flow of information that results in a packaged Windows Media file.

The process of packaging files

A Windows Media file is packaged by using the following procedure:

  1. Use the WMRMKeys object to generate a key ID and content ID.

  2. Use the WMRMKeys object with the license key seed and key ID to generate a key.

  3. Use the WMRMHeader object with the key ID, content ID, and license acquisition URL to create a content header. It is recommended that you add attributes and optionally specify a required individualization version number. Then, sign the content header.

    Note   A license header created with Windows Media Rights Manager 7 SDK or later is backward compatible with readers based on Windows Media Format 7.1 SDK. The additional signed material is ignored by players based on Windows Media Format 7.1 SDK, but is otherwise the same.

  4. Use the WMRMProtect object with the input file, key, and content header to produce a packaged Windows Media file. Then, add a version 1 key ID and license acquisition URL.

See Also