패키지 | org.osmf.net |
클래스 | public class NetLoader |
상속 | NetLoader LoaderBase EventDispatcher Object |
하위 클래스 | HTTPStreamingNetLoader, MulticastNetLoader, RTMPDynamicStreamingNetLoader |
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Supports both streaming and progressive media resources.
If the resource URL is RTMP, connects to an RTMP server by invoking a NetConnectionFactoryBase.
NetConnections may be shared between LoadTrait instances.
If the resource URL is HTTP, performs a connect(null)
for progressive downloads.
속성 | 정의 주체 | ||
---|---|---|---|
constructor : Object
지정된 객체 인스턴스의 클래스 객체 또는 생성자 함수에 대한 참조입니다. | Object | ||
reconnectTimeout : Number
The stream reconnect timeout in milliseconds. | NetLoader |
메서드 | 정의 주체 | ||
---|---|---|---|
NetLoader(factory:NetConnectionFactoryBase = null)
Constructor. | NetLoader | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
리스너에서 이벤트 알림을 받을 수 있도록 EventDispatcher 객체에 이벤트 리스너 객체를 등록합니다. | EventDispatcher | ||
Indicates whether this loader is capable of handling (loading)
the given MediaResourceBase. | LoaderBase | ||
이벤트를 이벤트 흐름으로 전달합니다. | EventDispatcher | ||
EventDispatcher 객체에 특정 유형의 이벤트에 대한 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
Loads the specified LoadTrait. | LoaderBase | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
EventDispatcher 객체에서 리스너를 제거합니다. | EventDispatcher | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
Unloads the specified LoadTrait. | LoaderBase | ||
지정된 객체의 프리미티브 값을 반환합니다. | Object | ||
이 EventDispatcher 객체 또는 조상 객체에 지정한 이벤트 유형에 대한 이벤트 리스너가 등록되어 있는지 여부를 확인합니다. | EventDispatcher |
메서드 | 정의 주체 | ||
---|---|---|---|
The factory function for creating a NetStream. | NetLoader | ||
createNetStreamSwitchManager(connection:NetConnection, netStream:NetStream, dsResource:DynamicStreamingResource):NetStreamSwitchManagerBase
The factory function for creating a NetStreamSwitchManagerBase. | NetLoader | ||
Executes the load of the given LoadTrait. | LoaderBase | ||
Executes the unload of the given LoadTrait. | LoaderBase | ||
Attempts to reconnect the specified NetConnection to the specified
URL. | NetLoader | ||
Updates the given LoadTrait with the given info, and dispatches the
state change event if necessary. | LoaderBase |
reconnectTimeout | 속성 |
reconnectTimeout:Number
The stream reconnect timeout in milliseconds.
The NetLoader will give up trying to reconnect the stream if a successful reconnect does not occur within this time period. The default is 120 seconds. For unpaused streams, the timeout period begins when the buffer empties and therefore a value of zero seconds is valid, meaning after the buffer empties, don't try to reconnect. For paused streams, the timeout period begins immediately.
구현
public function get reconnectTimeout():Number
public function set reconnectTimeout(value:Number):void
오류
ArgumentError — If value param is less than zero.
|
NetLoader | () | 생성자 |
public function NetLoader(factory:NetConnectionFactoryBase = null)
언어 버전: | ActionScript 3.0 |
제품 버전: | OSMF 1.0 |
런타임 버전: | Flash Player 10, AIR 1.5 |
Constructor.
매개 변수factory:NetConnectionFactoryBase (default = null ) — The NetConnectionFactoryBase instance to use for managing NetConnections.
If factory is null, a NetConnectionFactory will be created and used. Since the
NetConnectionFactory class facilitates connection sharing, this is an easy way of
enabling global sharing, by creating a single NetConnectionFactory instance within
the player and then handing it to all NetLoader instances.
|
createNetStream | () | 메서드 |
protected function createNetStream(connection:NetConnection, resource:URLResource):NetStream
The factory function for creating a NetStream.
매개 변수
connection:NetConnection — The NetConnection to associate with the new NetStream.
| |
resource:URLResource — The resource whose content will be played in the NetStream.
|
NetStream — A new NetStream associated with the NetConnection.
|
createNetStreamSwitchManager | () | 메서드 |
protected function createNetStreamSwitchManager(connection:NetConnection, netStream:NetStream, dsResource:DynamicStreamingResource):NetStreamSwitchManagerBase
The factory function for creating a NetStreamSwitchManagerBase.
매개 변수
connection:NetConnection — The NetConnection that's associated with the NetStreamSwitchManagerBase.
| |
netStream:NetStream — The NetStream upon which the NetStreamSwitchManagerBase will operate.
| |
dsResource:DynamicStreamingResource — The resource upon which the NetStreamSwitchManagerBase will operate.
|
NetStreamSwitchManagerBase — The NetStreamSwitchManagerBase for the NetStream, null if multi-bitrate switching
is not enabled for the NetStream.
|
reconnect | () | 메서드 |
protected function reconnect(netConnection:NetConnection, resource:URLResource):void
Attempts to reconnect the specified NetConnection to the specified URL.
Clients can override this method to provide custom NetConnection
behavior when using the stream reconnect feature. For example, if you
wanted to provide client-side load balancing in your player, you could create
a custom NetLoader
class and override this method to use an
alternate URI.
매개 변수
netConnection:NetConnection — The new NetConnection created by the stream reconnect logic.
| |
resource:URLResource — The URLResource that was originally used to play the media.
|
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; import org.osmf.net.NetLoader; public class NetLoaderExample extends Sprite { public function NetLoaderExample() { super(); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite(); var netLoader:NetLoader = new NetLoader(); var urlResource:URLResource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short"); var videoElement:VideoElement = new VideoElement(urlResource, netLoader); addChild(mediaPlayerSprite); mediaPlayerSprite.media = videoElement; } } }
Tue Jun 12 2018, 03:17 PM Z