Windows Media Rights Manager SDK banner art

WMRMRights.Playcount

The Playcount property specifies and retrieves the number of times that the license permits the content to be played.

Syntax

WMRMRights.Playcount = DWORD
DWORD = WMRMRights.Playcount

Parameters

This property takes no parameters.

Return Values

If the property succeeds, it returns a DWORD containing the number of times the content can be played. If it fails, it returns a number in the error object.

Return code Description
0x80004005 An unspecified error occurred.
0x80070057 The specified parameter is not valid.

Remarks

By default, this property is not set and the license permits unlimited play. If the Playcount property is set, then the AllowBackupRestore property defaults to False. The Playcount property must be greater than zero.

Example Code

' Before you can issue a license, you must specify the consumer's
' rights and set them in the WMRMLicGen object.

' Declare objects.
    Dim sRights
    Dim RightsObj
    Dim LicGenObj
' Create objects.
    Set RightsObj = Server.CreateObject("Wmrmobjs.WMRMRights")
    Set LicGenObj = Server.CreateObject("Wmrmobjs.WMRMLicGen")

' Reset the WMRMRights object.
    RightsObj.Reset()

' Specify the rights that will be granted to the consumer.
    RightsObj.AllowBackupRestore = False
    RightsObj.AllowPlay = True
    RightsObj.Playcount = 20

' Retrieve the string containing the rights.
    sRights = RightsObj.GetAllRights()

' Set the rights in the license generator.
    LicGenObj.Rights = sRights

' Continue the license issuing process.

Requirements

Version: Windows Media Rights Manager 7 SDK or later

Reference: wmrmobjs 1.0 Type Library

Library: wmrmobjs.dll

Platform: Windows Server 2003

See Also