Adobe Flex 3 Help

Using the DRMStatusEvent class

The DRMStatusEvent object occurs twice before DRM-protected content can be viewed. The first instance allows the application to query whether the content is encrypted anonymously, using the isAnonymous property. If the content is anonymously encrypted, meaning it does not require user authentication for playback, then a second instance occurs and playback begins. If the content uses identity-based encryption, a DRMAuthenticateEvent object is thrown to retrieve the user's credentials. Once the credentials are validated, the second instance of the DRMStatusEvent object occurs and playback begins.

Contents

DRMStatusEvent properties

The DRMStatusEvent class includes the following properties:

Property

Description

isAnonymous

Specifies whether the content, protected with DRM encryption, is available without requiring a user to provide authentication credentials (true) or not (false, the default value).

isAvailableOffline

Specifies whether the content, protected with DRM encryption, is available offline (true) or not (false, the default value).

offlineLeasePeriod

The remaining number of days that content can be viewed offline. In this case, offline is considered to be any attempt to view the encrypted content when the voucher cannot communicate with FMRMS.

voucherEndDate

The absolute date, expressed as the number of seconds since the current epoch began on January 1st, 1970, on which the voucher for the encrypted content expires and the content can no longer be viewed by users.

Creating a DRMStatusEvent handler

The following example creates an event handler that outputs the DRM content status information for the NetStream object that originated the event. Add this event handler to a NetStream object that points to DRM-encrypted content.

ActionScript example:

private function drmStatusEventHandler(event:DRMStatusEvent):void 
{
    trace(event.toString());
}