套件 | org.osmf.media |
類別 | public class MediaElement |
繼承 | MediaElement EventDispatcher Object |
子類別 | BeaconElement, CompositeElement, HTMLElement, LoadableElementBase, ProxyElement |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Programmatically, a media element encapsulates a set of media traits and a state space. The media traits represent the capabilities of the media element and are dynamic in nature. At one moment in time a media element might be seekable, at another moment it might not be. For example, this could occur if the media element is a video sequence containing unskippable ads.
A media element operates on a media resource. For example, if the media element represents a video player, the media resource might encapsulate a URL to a video stream. If the media element represents a complex media composition, the media resource URL might be a document that references the multiple resources used in the media composition.
相關 API 元素
MediaResourceBase
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
container : IMediaContainer [唯讀]
The media container that this element uses. | MediaElement | ||
metadataNamespaceURLs : Vector.<String> [唯讀]
A Vector containing the namespace URLs for all Metadata
objects stored within this MediaElement. | MediaElement | ||
resource : MediaResourceBase
The media resource that this media element operates on. | MediaElement | ||
traitTypes : Vector.<String> [唯讀]
A Vector of MediaTraitType values representing the trait types on this
media element. | MediaElement |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | MediaElement | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
Adds a Metadata object to this MediaElement under the specified namespace URL. | MediaElement | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
Returns the Metadata object that is stored under this MediaElement with
the specified namespace URL. | MediaElement | ||
Returns the media trait of the specified type. | MediaElement | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
Determines whether this media element has a media trait of the
specified type. | MediaElement | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
Removes the Metadata object that was stored under this MediaElement with
the specified namespace URL. | MediaElement | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
Adds a new media trait to this media element. | MediaElement | ||
Removes a media trait from this media element. | MediaElement | ||
Sets up the traits for this media element. | MediaElement |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
Dispatched when the element's container property changed. | MediaElement | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when an error which impacts the operation of the media element occurs. | MediaElement | |||
Dispatched when a info which impacts the operation of the media element is available. | MediaElement | |||
Dispatched when a Metadata object has been added to this media element. | MediaElement | |||
Dispatched when a Metadata object has been removed from this media element. | MediaElement | |||
Dispatched when a trait is added to the media element. | MediaElement | |||
Dispatched when a trait is removed from the media element. | MediaElement |
container | 屬性 |
container:IMediaContainer
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The media container that this element uses.
實作
public function get container():IMediaContainer
metadataNamespaceURLs | 屬性 |
resource | 屬性 |
resource:MediaResourceBase
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The media resource that this media element operates on.
實作
public function get resource():MediaResourceBase
public function set resource(value:MediaResourceBase):void
traitTypes | 屬性 |
MediaElement | () | 建構函式 |
public function MediaElement()
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
addMetadata | () | 方法 |
public function addMetadata(namespaceURL:String, metadata:Metadata):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Adds a Metadata object to this MediaElement under the specified namespace URL.
參數
namespaceURL:String — The namespace URL used to store the Metadata.
| |
metadata:Metadata — The Metadata to add.
|
擲回值
ArgumentError — if namespaceURL or metadata is null.
|
addTrait | () | 方法 |
protected function addTrait(type:String, instance:org.osmf.traits:MediaTraitBase):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Adds a new media trait to this media element. If successful, dispatches a MediaElementEvent.
參數
type:String — The MediaTraitType for the media trait to add.
| |
instance:org.osmf.traits:MediaTraitBase — The media trait to add.
|
擲回值
ArgumentError — If either parameter is null , or
if the specified type and the type of the media trait don't match,
or if a different instance of the specific trait class has already
been added.
|
getMetadata | () | 方法 |
public function getMetadata(namespaceURL:String):Metadata
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Returns the Metadata object that is stored under this MediaElement with the specified namespace URL.
參數
namespaceURL:String — The namespace URL of the Metadata object to retrieve.
|
Metadata |
擲回值
ArgumentError — If namespaceURL is null.
|
getTrait | () | 方法 |
public function getTrait(type:String):org.osmf.traits:MediaTraitBase
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Returns the media trait of the specified type.
參數
type:String — The MediaTraitType for the media trait to return.
|
org.osmf.traits:MediaTraitBase — The retrieved trait or null if no such trait exists on this
media element.
|
擲回值
ArgumentError — If the parameter is null .
|
hasTrait | () | 方法 |
public function hasTrait(type:String):Boolean
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Determines whether this media element has a media trait of the specified type.
參數
type:String — The MediaTraitType for the media trait to check for.
|
Boolean — true if this media element has a media
trait of the specified class, false otherwise.
|
擲回值
ArgumentError — If the parameter is null .
|
removeMetadata | () | 方法 |
public function removeMetadata(namespaceURL:String):Metadata
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Removes the Metadata object that was stored under this MediaElement with the specified namespace URL.
參數
namespaceURL:String — The namespace URL of the Metadata to remove.
|
Metadata |
擲回值
ArgumentError — If namespaceURL is null.
|
removeTrait | () | 方法 |
protected function removeTrait(type:String):org.osmf.traits:MediaTraitBase
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Removes a media trait from this media element. If successful, dispatches a MediaElementEvent.
參數
type:String — The MediaTraitType for the media trait to remove.
|
org.osmf.traits:MediaTraitBase — The removed trait or null if no trait was
removed.
|
擲回值
ArgumentError — If the parameter is null .
|
setupTraits | () | 方法 |
protected function setupTraits():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Sets up the traits for this media element. Occurs during construction. Subclasses should override this method and call addTrait for each trait of their own.
containerChange | 事件 |
org.osmf.events.ContainerChangeEvent
屬性 ContainerChangeEvent.type =
org.osmf.events.ContainerChangeEvent.CONTAINER_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the element's container property changed.
The ContainerChangeEvent.CONTAINER_CHANGE constant defines the value of the type property of the event object for a containerChange event.mediaError | 事件 |
org.osmf.events.MediaErrorEvent
屬性 MediaErrorEvent.type =
org.osmf.events.MediaErrorEvent.MEDIA_ERROR
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when an error which impacts the operation of the media element occurs.
The MediaErrorEvent.MEDIA_ERROR constant defines the value of the type property of the event object for a mediaError event.mediaInfo | 事件 |
org.osmf.events.MediaErrorEvent
屬性 MediaErrorEvent.type =
org.osmf.events.MediaErrorEvent.MEDIA_INFO
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when a info which impacts the operation of the media element is available. MEDIA_INFO events are non-fatal.
metadataAdd | 事件 |
org.osmf.events.MediaElementEvent
屬性 MediaElementEvent.type =
org.osmf.events.MediaElementEvent.METADATA_ADD
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when a Metadata object has been added to this media element.
The MediaElementEvent.METADATA_ADD constant defines the value of the type property of the event object for a metadataAdd event.metadataRemove | 事件 |
org.osmf.events.MediaElementEvent
屬性 MediaElementEvent.type =
org.osmf.events.MediaElementEvent.METADATA_REMOVE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when a Metadata object has been removed from this media element.
The MediaElementEvent.METADATA_REMOVE constant defines the value of the type property of the event object for a metadataRemove event.traitAdd | 事件 |
org.osmf.events.MediaElementEvent
屬性 MediaElementEvent.type =
org.osmf.events.MediaElementEvent.TRAIT_ADD
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when a trait is added to the media element.
The MediaElementEvent.TRAIT_ADD constant defines the value of the type property of the event object for a traitAdd event.traitRemove | 事件 |
org.osmf.events.MediaElementEvent
屬性 MediaElementEvent.type =
org.osmf.events.MediaElementEvent.TRAIT_REMOVE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when a trait is removed from the media element.
The MediaElementEvent.TRAIT_REMOVE constant defines the value of the type property of the event object for a traitRemove event.Tue Jun 12 2018, 03:47 PM Z