適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
org.osmf.net 

DynamicStreamingResource  - AS3 OSMF

套件org.osmf.net
類別public class DynamicStreamingResource
繼承DynamicStreamingResource Inheritance StreamingURLResource Inheritance URLResource Inheritance MediaResourceBase Inheritance Object

語言版本: ActionScript 3.0
產品版本: OSMF 1.0
執行階段版本: Flash Player 10, AIR 1.5

DynamicStreamingResource encapsulates multiple representations of a piece of media, such that the player application can dynamically switch from one representation to another. Typically (though not always), each representation is encoded at a different bitrate, and the player application switches between representations based on changes to the client's available bandwidth.

This class provides an object representation of a dynamic streaming resource without any knowledge or assumption of any file format, such as SMIL, Media RSS, F4M, etc.

檢視範例



公用屬性
 屬性定義自
 InheritedalternativeAudioStreamItems : Vector.<StreamingItem>
Vector containing all alternative audio items associated with the current streaming resource.
StreamingURLResource
 InheritedclipEndTime : Number
Optional end time of the streaming resource.
StreamingURLResource
 InheritedclipStartTime : Number
Optional start time of the streaming resource.
StreamingURLResource
 InheritedconnectionArguments : Vector.<Object>
Optional set of arguments that will be supplied when making a connection to the source of the stream.
StreamingURLResource
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
 InheriteddrmContentData : ByteArray
Content metadata for DRM-encrypted content.
StreamingURLResource
  host : String
[唯讀] A URL representing the host of the dynamic streaming resource.
DynamicStreamingResource
  initialIndex : int
The preferred starting index.
DynamicStreamingResource
 InheritedmediaType : String
The MediaType, if any, of this resource.
MediaResourceBase
 InheritedmetadataNamespaceURLs : Vector.<String>
[唯讀] 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
  streamItems : Vector.<DynamicStreamingItem>
Vector of DynamicStreamingItems.
DynamicStreamingResource
 InheritedstreamType : String
The StreamType for this resource.
StreamingURLResource
 Inheritedurl : String
[唯讀] The URL of the resource.
URLResource
 InheritedurlIncludesFMSApplicationInstance : Boolean
Indicates, for RTMP streaming URLs, whether the URL includes the FMS application instance or not.
StreamingURLResource
公用方法
 方法定義自
  
DynamicStreamingResource(host:String, streamType:String = null)
Constructor.
DynamicStreamingResource
 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
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
Removes a metadata value from this resource.
MediaResourceBase
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
屬性詳細資訊

host

屬性
host:String  [唯讀]

語言版本: ActionScript 3.0
產品版本: OSMF 1.0
執行階段版本: Flash Player 10, AIR 1.5

A URL representing the host of the dynamic streaming resource.



實作
    public function get host():String

initialIndex

屬性 
initialIndex:int

語言版本: ActionScript 3.0
產品版本: OSMF 1.0
執行階段版本: Flash Player 10, AIR 1.5

The preferred starting index.



實作
    public function get initialIndex():int
    public function set initialIndex(value:int):void

擲回值
RangeError — If the index is out of range. From OSMF 2.0 upwards you can set the initialIndex through a metadata as well, using the RESOURCE_INITIAL_INDEX key. This metadata can be added to any media resource, such as an URLResource, and it will be used to set the initial index when the DynamicStreamingResource is created. For example, having resource as a URLResource you can set the initialIndex in the following way: resource.addMetadata(MetadataNamespaces.RESOURCE_INITIAL_INDEX, 1); The RESOURCE_INITIAL_INDEX metadata accepts integers, and will adjust the value to fit into the streamItems range. This means that if the specified value is negative it will be adjusted to 0, and if it is larger than the available streamItems, then it will be adjusted to the greatest streamItem index.

streamItems

屬性 
streamItems:Vector.<DynamicStreamingItem>

語言版本: ActionScript 3.0
產品版本: OSMF 1.0
執行階段版本: Flash Player 10, AIR 1.5

Vector of DynamicStreamingItems. Each item represents a different bitrate stream.



實作
    public function get streamItems():Vector.<DynamicStreamingItem>
    public function set streamItems(value:Vector.<DynamicStreamingItem>):void
建構函式詳細資料

DynamicStreamingResource

()建構函式
public function DynamicStreamingResource(host:String, streamType:String = null)

語言版本: ActionScript 3.0
產品版本: OSMF 1.0
執行階段版本: Flash Player 10, AIR 1.5

Constructor.

參數
host:String — A URL representing the host of the dynamic streaming resource.
 
streamType:String (default = null) — The type of the stream. If null, defaults to StreamType.RECORDED.
DynamicStreamingResourceExample.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.net.DynamicStreamingItem;
    import org.osmf.net.DynamicStreamingResource;
    
    public class DynamicStreamingResourceExample extends Sprite
    {
        public function DynamicStreamingResourceExample()
        {
            super();
            
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            
            var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
            var videoElement:VideoElement = new VideoElement();
            var dynResource:DynamicStreamingResource = new DynamicStreamingResource("rtmp://cp67126.edgefcs.net/ondemand");
            
            dynResource.streamItems = Vector.<DynamicStreamingItem>(
                [     new DynamicStreamingItem("mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_768x428_24.0fps_408kbps.mp4", 408, 768, 428)
                    , new DynamicStreamingItem("mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_768x428_24.0fps_608kbps.mp4", 608, 768, 428)
                    , new DynamicStreamingItem("mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_1024x522_24.0fps_908kbps.mp4", 908, 1024, 522)
                    , new DynamicStreamingItem("mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_1024x522_24.0fps_1308kbps.mp4", 1308, 1024, 522)
                    , new DynamicStreamingItem("mp4:mediapm/ovp/content/demo/video/elephants_dream/elephants_dream_1280x720_24.0fps_1708kbps.mp4", 1708, 1280, 720)
                ]);
            
            videoElement.resource = dynResource;
            
            addChild(mediaPlayerSprite);
            mediaPlayerSprite.media = videoElement;    
        }    
    }
} 




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。