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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

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

Understanding the protected cont<strong>en</strong>t workflow<br />

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

The following high-level workflow shows that how an application can retrieve and play protected cont<strong>en</strong>t. The<br />

workflow assumes that the application is designed specifically to play cont<strong>en</strong>t protected by Flash Access:<br />

1 Get the cont<strong>en</strong>t metadata.<br />

2 Handle updates to Flash Player, if needed.<br />

3 Check if a lic<strong>en</strong>se is available locally. If so, load it and go to step 7. If not, go to step 4.<br />

4 Check if auth<strong>en</strong>tication is required. If not, you can go to step 7.<br />

5 If auth<strong>en</strong>tication is required, get the auth<strong>en</strong>tication cred<strong>en</strong>tials from the user and pass them to the lic<strong>en</strong>se server.<br />

6 If domain registration is required, join the domain (AIR 3.0 and higher).<br />

7 Once auth<strong>en</strong>tication succeeds, download the lic<strong>en</strong>se from the server.<br />

8 Play the cont<strong>en</strong>t.<br />

If an error has not occurred and the user was successfully authorized to view the cont<strong>en</strong>t, the NetStream object<br />

dispatches a DRMStatusEv<strong>en</strong>t object. The application th<strong>en</strong> begins playback. The DRMStatusEv<strong>en</strong>t object holds the<br />

related voucher information, which id<strong>en</strong>tifies the user’s policy and permissions. For example, it holds information<br />

regarding whether the cont<strong>en</strong>t can be made available offline or wh<strong>en</strong> the lic<strong>en</strong>se expires. The application can use this<br />

data to inform the user of the status of their policy. For example, the application can display the number of remaining<br />

days the user has for viewing the cont<strong>en</strong>t in a status bar.<br />

If the user is allowed offline access, the voucher is cached, and the <strong>en</strong>crypted cont<strong>en</strong>t is downloaded to the user’s<br />

machine. The cont<strong>en</strong>t is made accessible for the duration defined in the lic<strong>en</strong>se caching duration. The detail property<br />

in the ev<strong>en</strong>t contains "DRM.voucherObtained". The application decides where to store the cont<strong>en</strong>t locally in order<br />

for it to be available offline. You can also preload vouchers using the DRMManager class.<br />

Note: Caching and pre-loading of vouchers is supported in both AIR and Flash Player. However, downloading and storing<br />

<strong>en</strong>crypted cont<strong>en</strong>t is supported only in AIR.<br />

It is the application’s responsibility to explicitly handle the error ev<strong>en</strong>ts. These ev<strong>en</strong>ts include cases where the user<br />

inputs valid cred<strong>en</strong>tials, but the voucher protecting the <strong>en</strong>crypted cont<strong>en</strong>t restricts the access to the cont<strong>en</strong>t. For<br />

example, an auth<strong>en</strong>ticated user cannot access cont<strong>en</strong>t if the rights have not be<strong>en</strong> paid for. This case can also occur wh<strong>en</strong><br />

two registered members of the same publisher attempt to share cont<strong>en</strong>t that only one of them has paid for. The<br />

application must inform the user of the error and provide an alternative suggestion. A typical alternative suggestion is<br />

instructions in how to register and pay for viewing rights.<br />

Detailed API workflow<br />

Flash Player 10.1 and later, AIR 2.0 and later<br />

This workflow provides a more detailed view of the protected-cont<strong>en</strong>t workflow. This workflow describes the specific<br />

APIs used to play cont<strong>en</strong>t protected by Flash Access.<br />

1 Using a URLLoader object, load the bytes of the protected cont<strong>en</strong>t’s metadata file. Set this object to a variable, such<br />

as metadata_bytes.<br />

All cont<strong>en</strong>t controlled by Flash Access has Flash Access metadata. Wh<strong>en</strong> the cont<strong>en</strong>t is packaged, this metadata can<br />

be saved as a separate metadata file (.metadata) alongside the cont<strong>en</strong>t. For more information, see the Flash Access<br />

docum<strong>en</strong>tation.<br />

Last updated 6/6/2012<br />

528

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

Saved successfully!

Ooh no, something went wrong!