13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Using digital rights managem<strong>en</strong>t<br />

Using the DRMStatusEv<strong>en</strong>t class<br />

Flash Player 10.1, Adobe AIR 1.0 and later<br />

A NetStream object dispatches a DRMStatusEv<strong>en</strong>t object wh<strong>en</strong> the cont<strong>en</strong>t protected by Flash Access begins playing<br />

successfully. (Success implies that the lic<strong>en</strong>se is verified and that the user is auth<strong>en</strong>ticated and authorized to view the<br />

cont<strong>en</strong>t). The DRMStatusEv<strong>en</strong>t is also dispatched for anonymous users if they are permitted access. The lic<strong>en</strong>se is<br />

checked to verify whether anonymous users, who do not require auth<strong>en</strong>tication, are allowed access to play the cont<strong>en</strong>t.<br />

Anonymous users maybe d<strong>en</strong>ied access for various reasons. For example, an anonymous user does not have access to<br />

the cont<strong>en</strong>t wh<strong>en</strong> the lic<strong>en</strong>se has expired.<br />

The DRMStatusEv<strong>en</strong>t object contains information related to the lic<strong>en</strong>se. Such information includes whether the<br />

lic<strong>en</strong>se can be made available offline or wh<strong>en</strong> the voucher expires and the cont<strong>en</strong>t can no longer be viewed. The<br />

application can use this data to convey the user’s policy status and its permissions.<br />

DRMStatusEv<strong>en</strong>t properties<br />

Flash Player 10.1, Adobe AIR 1.0 and later<br />

The DRMStatusEv<strong>en</strong>t class includes the following properties. Some properties became available in versions of AIR<br />

later than 1.0. For complete version information, see the ActionScript 3.0 Refer<strong>en</strong>ce.<br />

For properties that ar<strong>en</strong>’t supported in Flash Player 10.1, the DRMVoucher class provides similar properties for Flash<br />

Player.<br />

Property Description<br />

cont<strong>en</strong>tData A DRMCont<strong>en</strong>tData object containing the DRM metadata embedded in the cont<strong>en</strong>t.<br />

detail (AIR only) A string explaining the context of the status ev<strong>en</strong>t. In DRM 1.0, the only valid value is DRM.voucherObtained.<br />

isAnonymous (AIR only) Indicates whether the cont<strong>en</strong>t, protected with Flash Access, is available without requiring a user to provide<br />

auth<strong>en</strong>tication cred<strong>en</strong>tials (true) or not (false). A false value means that the user must provide a user name and<br />

password that matches the one known and expected by the cont<strong>en</strong>t provider.<br />

isAvailableOffline (AIR<br />

only)<br />

Creating a DRMStatusEv<strong>en</strong>t handler<br />

Flash Player 10.1, Adobe AIR 1.0 and later<br />

Indicates whether the cont<strong>en</strong>t, protected with Flash Access, can be made available offline (true) or not (false).<br />

In order for digitally protected cont<strong>en</strong>t to be available offline, its voucher must be cached to the user's local<br />

machine.<br />

isLocal Indicates whether the voucher that is required to play the cont<strong>en</strong>t is cached locally.<br />

offlineLeasePeriod (AIR<br />

only)<br />

The remaining number of days that cont<strong>en</strong>t can be viewed offline.<br />

policies (AIR only) A custom object that can contain custom DRM properties.<br />

voucher The DRMVoucher.<br />

voucherEndDate (AIR only) The absolute date on which the voucher expires and the cont<strong>en</strong>t is no longer viewable.<br />

The following example creates an ev<strong>en</strong>t handler that outputs the DRM cont<strong>en</strong>t status information for the NetStream<br />

object that originated the ev<strong>en</strong>t. Add this ev<strong>en</strong>t handler to a NetStream object that points to protected cont<strong>en</strong>t.<br />

Last updated 6/6/2012<br />

536

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!