org.osmf.net

# StreamingURLResource - AS3 OSMF

Package | org.osmf.net
Class | public class StreamingURLResource
Inheritance | StreamingURLResource URLResource MediaResourceBase Object
Subclasses | DynamicStreamingResource, MulticastResource

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

StreamingURLResource is a URLResource which is capable of being streamed. It exposes some additional properties which are specific to streaming media.

Note that it is possible for live and recorded streams to have identical URLs. In such a case, the streamType property should be used to disambiguate live and recorded streams.

View the examples

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | alternativeAudioStreamItems : Vector.<StreamingItem> Vector containing all alternative audio items associated with the current streaming resource. | StreamingURLResource
|  | clipEndTime : Number Optional end time of the streaming resource. | StreamingURLResource
|  | clipStartTime : Number Optional start time of the streaming resource. | StreamingURLResource
|  | connectionArguments : Vector.<Object> Optional set of arguments that will be supplied when making a connection to the source of the stream. | StreamingURLResource
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | drmContentData : ByteArray Content metadata for DRM-encrypted content. | StreamingURLResource
|  | mediaType : String The MediaType, if any, of this resource. | MediaResourceBase
|  | metadataNamespaceURLs : Vector.<String> [read-only] A Vector containing the namespace URLs for all Metadata objects within this resource. | MediaResourceBase
|  | mimeType : String The MIME type, if any, of this resource. | MediaResourceBase
|  | streamType : String The StreamType for this resource. | StreamingURLResource
|  | url : String [read-only] The URL of the resource. | URLResource
|  | urlIncludesFMSApplicationInstance : Boolean Indicates, for RTMP streaming URLs, whether the URL includes the FMS application instance or not. | StreamingURLResource

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | StreamingURLResource(url:String, streamType:String = null, clipStartTime:Number = NaN, clipEndTime:Number = NaN, connectionArguments:Vector.<Object> = null, urlIncludesFMSApplicationInstance:Boolean = false, drmContentData:ByteArray = null) Constructor. | StreamingURLResource
|  | addMetadataValue(namespaceURL:String, value:Object):void Adds a metadata value to this resource. | MediaResourceBase
|  | getMetadataValue(namespaceURL:String):Object Retrieves a metadata value from this resource. | MediaResourceBase
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | removeMetadataValue(namespaceURL:String):Object Removes a metadata value from this resource. | MediaResourceBase
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Property Detail

### alternativeAudioStreamItems

property

`alternativeAudioStreamItems:Vector.<StreamingItem>`

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.6

Runtime Versions: | Flash Player 10, AIR 1.5

Vector containing all alternative audio items associated with the current streaming resource.

Implementation
`public function get alternativeAudioStreamItems():Vector.<StreamingItem>`
`public function set alternativeAudioStreamItems(value:Vector.<StreamingItem>):void`

### clipEndTime

property

`clipEndTime:Number`

Optional end time of the streaming resource. When specified, the stream will be presented as a subclip, with playback ending at the specified end time. Note that clipEndTime is not currently supported for progressive videos. The default is NaN, which is to play to the end.

Implementation
`public function get clipEndTime():Number`
`public function set clipEndTime(value:Number):void`

### clipStartTime

property

`clipStartTime:Number`

Optional start time of the streaming resource. When specified, the stream will be presented as a subclip, with playback beginning at the specified start time. Note that clipStartTime is not currently supported for progressive videos. The default is NaN, which is to start at the beginning.

Implementation
`public function get clipStartTime():Number`
`public function set clipStartTime(value:Number):void`

### connectionArguments

property

`connectionArguments:Vector.<Object>`

Optional set of arguments that will be supplied when making a connection to the source of the stream.

Implementation
`public function get connectionArguments():Vector.<Object>`
`public function set connectionArguments(value:Vector.<Object>):void`

### drmContentData

property

`drmContentData:ByteArray`

Content metadata for DRM-encrypted content.

Implementation
`public function get drmContentData():ByteArray`
`public function set drmContentData(value:ByteArray):void`

### streamType

property

`streamType:String`

Language Version: | ActionScript 3.0

Product Version: | OSMF 1.0

Runtime Versions: | Flash Player 10, AIR 1.5

The StreamType for this resource. The default value is `StreamType.RECORDED`. The StreamType class enumerates the valid stream types.

This property may return the following string values:

String value | Description
--- | ---
`StreamType.LIVE_OR_RECORDED` | The StreamingURLResource represents either a live or a recorded stream.
`StreamType.LIVE` | The StreamingURLResource represents a live stream.
`StreamType.RECORDED` | The StreamingURLResource represents a recorded stream.
`StreamType.DVR` | The StreamingURLResource represents a DVR stream.

Implementation
`public function get streamType():String`
`public function set streamType(value:String):void`

Related API Elements

StreamType

### urlIncludesFMSApplicationInstance

property

`urlIncludesFMSApplicationInstance:Boolean`

Indicates, for RTMP streaming URLs, whether the URL includes the FMS application instance or not. If true, then the second part of the URL path is considered the instance name, such as `rtmp://host/app/foo/bar/stream`. In this case the instance name would be 'foo' and the stream would be 'bar/stream'. If false, then the second part of the URL path is considered to be the stream name, such as `rtmp://host/app/foo/bar/stream`. In this case there is no instance name and the stream would be 'foo/bar/stream'. The default is false.

Implementation
`public function get urlIncludesFMSApplicationInstance():Boolean`
`public function set urlIncludesFMSApplicationInstance(value:Boolean):void`
Constructor Detail

### StreamingURLResource

()
Constructor

`public function StreamingURLResource(url:String, streamType:String = null, clipStartTime:Number = NaN, clipEndTime:Number = NaN, connectionArguments:Vector.<Object> = null, urlIncludesFMSApplicationInstance:Boolean = false, drmContentData:ByteArray = null)`

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. For details about how to format this URL for flv, mp4, and other file formats, see the Adobe® Flash® Media Server documentation link below.
| `streamType:String` (default = `null`)`` — The type of the stream. If null, defaults to StreamType.RECORDED.
| `clipStartTime:Number` (default = `NaN`)`` — Optional start time of the streaming resource. When specified, the stream will be presented as a subclip, with playback beginning at the specified start time.
| `clipEndTime:Number` (default = `NaN`)`` — Optional end time of the streaming resource. When specified, the stream will be presented as a subclip, with playback ending at the specified end time.
| `connectionArguments:Vector.<Object>` (default = `null`)`` — Optional set of arguments that will be supplied to NetConnection.connect when establishing a connection to the source of the stream.
| `urlIncludesFMSApplicationInstance:Boolean` (default = `false`)`` — Indicates, for RTMP streaming URLs, whether the URL includes the FMS application instance or not. If true, then the second part of the URL path is considered the instance name, such as `rtmp://host/app/foo/bar/stream`. In this case the instance name would be 'foo' and the stream would be 'bar/stream'. If false, then the second part of the URL path is considered to be the stream name, such as `rtmp://host/app/foo/bar/stream`. In this case there is no instance name and the stream would be 'foo/bar/stream'. The default is false.
| `drmContentData:ByteArray` (default = `null`)`` — Content metadata for DRM-encrypted content.

Learn more

http://www.adobe.com/go/learn_OSMF_fms_url_format_en
Examples How to use this example
StreamingURLResourceExample.as
Copy

    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.net.StreamType;
        import org.osmf.net.StreamingURLResource;

        public class StreamingURLResourceExample extends Sprite
        {
            public function StreamingURLResourceExample()
            {
                super();

                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;

                var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
                var videoElement:VideoElement = new VideoElement();

                videoElement.resource = new StreamingURLResource("rtmp://cp34973.live.edgefcs.net/live/Flash_Live_Benchmark@632", StreamType.LIVE);

                addChild(mediaPlayerSprite);
                mediaPlayerSprite.media = videoElement;
            }
        }
    }

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00