(Beta)
Package | org.osmf.media |
Class | public class DefaultMediaFactory |
Inheritance | DefaultMediaFactory MediaFactory EventDispatcher Object |
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The default media factory can construct media elements of the following types:
-
VideoElement, using either:
- NetLoader (streaming or progressive)
- RTMPDynamicStreamingNetLoader (MBR streaming)
- HTTPStreamingNetLoader (HTTP streaming), if the CONFIG::FLASH_10_1 compiler flag is set to true
- F4MLoader (Flash Media Manifest files)
- DVRCastNetLoader (DVRCast)
-
SoundElement, using either:
- SoundLoader (progressive)
- NetLoader (streaming)
- ImageElement
- SWFElement
Public Properties
Public Methods
Method | Defined By | ||
---|---|---|---|
Constructor. | DefaultMediaFactory | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Adds the specified MediaFactoryItem to the factory. | MediaFactory | ||
Returns a MediaElement that can be created based on the specified
MediaResourceBase. | MediaFactory | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Gets the MediaFactoryItem at the specified index. | MediaFactory | ||
Returns the MediaFactoryItem with the specified ID or null if the
specified MediaFactoryItem does not exist in this factory. | MediaFactory | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Load a plugin identified by the specified resource. | MediaFactory | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Removes the specified MediaFactoryItem from the factory. | MediaFactory | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Protected Methods
Constructor Detail
DefaultMediaFactory | () | Constructor |
public function DefaultMediaFactory()
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Constructor.
Examples How to use this example
DefaultMediaFactoryExample.as
This example demonstrates how to manually use the DefaultMediaFactory
class to instantiate a video element.
package org.osmf.media { import flash.display.Sprite; import org.osmf.containers.MediaContainer; public class DefaultMediaFactoryExample extends Sprite { public function DefaultMediaFactoryExample() { // Construct a default media factory: var factory:DefaultMediaFactory = new DefaultMediaFactory(); // Request the factory to create a media element that matches the passed URL: var media:MediaElement = factory.createMediaElement(new URLResource("http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv")); // Add a media container, and player to have the constructed VideoElement // play back: var mediaContainer:MediaContainer = new MediaContainer(); addChild(mediaContainer); mediaContainer.width = 640; mediaContainer.height = 500; mediaContainer.addMediaElement(media); new MediaPlayer(media); } } }
Wed Nov 21 2018, 06:34 AM -08:00