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 

URLResource  - AS3 OSMF

Packageorg.osmf.media
Classpublic class URLResource
InheritanceURLResource Inheritance MediaResourceBase Inheritance Object
Subclasses StreamingURLResource

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

URLResource is a media resource that has a URL. It serves as an input object for MediaElements that can process and present media represented by URLs.

View the examples



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedmediaType : String
The MediaType, if any, of this resource.
MediaResourceBase
 InheritedmetadataNamespaceURLs : Vector.<String>
[read-only] A Vector containing the namespace URLs for all Metadata objects within this resource.
MediaResourceBase
 InheritedmimeType : String
The MIME type, if any, of this resource.
MediaResourceBase
  url : String
[read-only] The URL of the resource.
URLResource
Public Methods
 MethodDefined By
  
Constructor.
URLResource
 Inherited
addMetadataValue(namespaceURL:String, value:Object):void
Adds a metadata value to this resource.
MediaResourceBase
 Inherited
Retrieves a metadata value from this resource.
MediaResourceBase
 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
Removes a metadata value from this resource.
MediaResourceBase
 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

url

property
url:String  [read-only]

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

The URL of the resource.



Implementation
    public function get url():String
Constructor Detail

URLResource

()Constructor
public function URLResource(url:String)

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

Constructor.

Parameters
url:String — The URL of the resource.
URLResourceExample.as

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    
    import org.osmf.elements.VideoElement;
    import org.osmf.media.MediaPlayerSprite;
    import org.osmf.media.URLResource;
    
    public class URLResourceExample extends Sprite
    {
        public function URLResourceExample()
        {
            super();
            
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            
            var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
            var videoElement:VideoElement = new VideoElement();

            videoElement.resource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short");
            
            addChild(mediaPlayerSprite);
            mediaPlayerSprite.media = videoElement;    
        }    
    }
}