ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
org.osmf.media 

MediaFactoryItem  - AS3 OSMF

Packageorg.osmf.media
Classpublic class MediaFactoryItem
InheritanceMediaFactoryItem Inheritance Object

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

MediaFactoryItem is the encapsulation of all information needed to dynamically create and initialize a MediaElement from a MediaFactory.

MediaFactoryItem objects are exposed by plugins (on the PluginInfo class), and used by the framework to create the MediaElement(s) specified by the plugin.

Related API Elements



Public Properties
 PropertyDefined By
  canHandleResourceFunction : Function
[read-only] Function which is used to determine whether this MediaFactoryItem can handle a particular resource.
MediaFactoryItem
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  id : String
[read-only] An identifier that represents this MediaFactoryItem.
MediaFactoryItem
  mediaElementCreationFunction : Function
[read-only] Function which creates a new instance of the desired MediaElement.
MediaFactoryItem
  type : String
[read-only] The MediaFactoryItemType for this MediaFactoryItem.
MediaFactoryItem
Public Methods
 MethodDefined By
  
MediaFactoryItem(id:String, canHandleResourceFunction:Function, mediaElementCreationFunction:Function, type:String = null)
Constructor.
MediaFactoryItem
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

canHandleResourceFunction

property
canHandleResourceFunction:Function  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Function which is used to determine whether this MediaFactoryItem can handle a particular resource. The function must take a single parameter of type MediaResourceBase, and return a Boolean.



Implementation
    public function get canHandleResourceFunction():Function

id

property 
id:String  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

An identifier that represents this MediaFactoryItem.



Implementation
    public function get id():String

mediaElementCreationFunction

property 
mediaElementCreationFunction:Function  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Function which creates a new instance of the desired MediaElement. The function must take no params, and return a MediaElement.



Implementation
    public function get mediaElementCreationFunction():Function

type

property 
type:String  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

The MediaFactoryItemType for this MediaFactoryItem.



Implementation
    public function get type():String
Constructor Detail

MediaFactoryItem

()Constructor
public function MediaFactoryItem(id:String, canHandleResourceFunction:Function, mediaElementCreationFunction:Function, type:String = null)

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Parameters
id:String — An identifier that represents this MediaFactoryItem. Identifiers should reflect the plugin makers name, and the specific name of the element it generates. The convention is to use the package namespace scheme. Two examples: com.example.MyAdPlugin com.example.MyAnalyticsPlugin Note: org.osmf should be avoided since the MediaFactory gives precedence to non-osmf plugins.
 
canHandleResourceFunction:Function — Function which is used to determine whether this MediaFactoryItem can handle a particular resource. The function must take a single parameter of type MediaResourceBase, and return a Boolean.
 
mediaElementCreationFunction:Function — Function which creates a new instance of the desired MediaElement. The function must take no params, and return a MediaElement.
 
type:String (default = null) — The type of this MediaFactoryItem. If null, the default is MediaFactoryItemType.STANDARD.

Throws
ArgumentError — If any argument (except type) is null.