套件 | org.osmf.traits |
類別 | public class DRMTrait |
繼承 | DRMTrait MediaTraitBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10.1, AIR 1.5 |
Both anonymous and credential-based authentication are supported.
The workflow for media which has a DRMTrait is that the media undergoes some type of authentication, after which it is valid (i.e. able to be played) for a specific time window.
Use the MediaElement.hasTrait(MediaTraitType.DRM)
method to query
whether a media element has this trait.
If hasTrait(MediaTraitType.DRM)
returns true
,
use the MediaElement.getTrait(MediaTraitType.DRM)
method
to get an object of this type.
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
drmState : String [唯讀]
The current state of the DRM for this media. | DRMTrait | ||
endDate : Date [唯讀]
The end date for the playback window. | DRMTrait | ||
period : Number [唯讀]
The length of the playback window, in seconds. | DRMTrait | ||
startDate : Date [唯讀]
The start date for the playback window. | DRMTrait | ||
traitType : String [唯讀]
The MediaTraitType for this trait. | MediaTraitBase |
方法 | 定義自 | ||
---|---|---|---|
DRMTrait()
Constructor. | DRMTrait | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
Authenticates the media. | DRMTrait | ||
Authenticates the media using an object which serves as a token. | DRMTrait | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
Disposes of any resources used by this trait. | MediaTraitBase | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
Updates the drm state. | DRMTrait | ||
Updates the end date. | DRMTrait | ||
Updates the period. | DRMTrait | ||
Updates the start date. | DRMTrait |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when either anonymous or credential-based authentication is needed in order to playback the media. | DRMTrait |
drmState | 屬性 |
endDate | 屬性 |
period | 屬性 |
period:Number
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10.1, AIR 1.5 |
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).
實作
public function get period():Number
startDate | 屬性 |
DRMTrait | () | 建構函式 |
public function DRMTrait()
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10.1, AIR 1.5 |
Constructor.
authenticate | () | 方法 |
public function authenticate(username:String = null, password:String = null):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10.1, AIR 1.5 |
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.
參數
username:String (default = null ) — The username. Should be null for anonymous authentication.
| |
password:String (default = null ) — The password. Should be null for anonymous authentication.
|
擲回值
IllegalOperationError — If the media is not initialized yet.
|
authenticateWithToken | () | 方法 |
public function authenticateWithToken(token:Object):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10.1, AIR 1.5 |
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.
參數
token:Object — The token to use for authentication.
|
setDrmState | () | 方法 |
setEndDate | () | 方法 |
setPeriod | () | 方法 |
setStartDate | () | 方法 |
drmStateChange | 事件 |
org.osmf.events.DRMEvent
屬性 DRMEvent.type =
org.osmf.events.DRMEvent.DRM_STATE_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10.1, AIR 1.5 |
Dispatched when either anonymous or credential-based authentication is needed in order to playback the media.
The DRMEvent.DRM_STATE_CHANGE constant defines the value of the type property of the event object for a change to the drmState of a DRMTrait.Tue Jun 12 2018, 03:47 PM Z