Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
The ContentProtectableTrait class provides a base IContentProtectable
implementation. It can be used as the base class for a more specific
ContentProtectableTrait subclass or as is by a media element that listens
for and handles its change events.
authenticationMethod:String
[read-only]
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
The required method of authentication. Possible values are "anonymous"
and "usernameAndPassword".
Implementation public function get authenticationMethod():String
endDate:Date
[read-only]
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Returns the end date for the playback window. Returns null if authentication
hasn't taken place.
Implementation public function get endDate():Date
period:Number
[read-only]
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Returns the length of the playback window, in seconds. Returns NaN if
authentication hasn't taken place.
Note that this property will generally be the difference between startDate
and endDate, but is included as a property because there may be times where
the duration is known up front, but the start or end dates are not (e.g. a
one week rental).
Implementation public function get period():Number
startDate:Date
[read-only]
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Returns the start date for the playback window. Returns null if authentication
hasn't taken place.
Implementation public function get startDate():Date
public function ContentProtectableTrait()
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Constructor.
public function authenticate(username:String, password:String):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Authenticates the media. Can be used for both anonymous and credential-based
authentication. If the media has already been authenticated, this is a no-op.
Parameters
| username:String — The username. Should be null for anonymous authentication.
|
|
| password:String — The password. Should be null for anonymous authentication.
|
public function authenticateWithToken(token:Object):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Authenticates the media using an object which serves as a token. Can be used
for both anonymous and credential-based authentication. If the media has
already been authenticated, this is a no-op.
Parameters
| token:Object — The token to use for authentication.
|
protected function canProcessAuthenticate():Boolean
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Called before the processAuthenticate
method is called.
Returns | Boolean — Returns true by default. Subclasses that override
this method can return false to abort processing.
|
protected function canProcessAuthenticateWithToken():Boolean
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Called before the processAuthenticateWithToken
method is called.
Returns | Boolean — Returns true by default. Subclasses that override
this method can return false to abort processing.
|
protected function processAuthenticate(username:String, password:String):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Called immediately before the authenticationState
property is changed
in response to a call to authenticate.
Subclasses implement this method to communicate the change to the media.
Parameters
| username:String — The username for the authentication request.
|
|
| password:String — The password for the authentication request.
|
public final function processAuthenticateCompletion(success:Boolean, token:Object, error:MediaError):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Must be called by the implementing media on completing authentication. Dispatches
the change event.
Parameters
protected function processAuthenticateWithToken(token:Object):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Called immediately before the authenticationState
property is changed
in response to a call to authenticateWithToken.
Subclasses implement this method to communicate the change to the media.
Parameters
| token:Object — The username for the authentication request.
|
Event Object Type: org.osmf.events.ContentProtectionEvent
property ContentProtectionEvent.type = org.osmf.events.ContentProtectionEvent.AUTHENTICATION_COMPLETE
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Dispatched when an authentication attempt succeeds.
Event Object Type: org.osmf.events.ContentProtectionEvent
property ContentProtectionEvent.type = org.osmf.events.ContentProtectionEvent.AUTHENTICATION_FAILED
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 4.0 |
Runtime Versions: | Flash Player 10, AIR 1.0 |
Dispatches when an authentication attempt fails.
Event Object Type: org.osmf.events.ContentProtectionEvent
property ContentProtectionEvent.type = org.osmf.events.ContentProtectionEvent.AUTHENTICATION_NEEDED
Dispatched when either anonymous or credential-based authentication is needed in order
to playback the media.