Packageorg.flowplayer.controller
Interfacepublic interface StreamProvider
ImplementorsNetStreamControllingStreamProvider

StreamProviders are used to load video content into the player. They are used to integrate to different streaming servers and Content Delivery Networks (CDNs). Usually in the Flash platform providers are implemented using http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html.



Public Properties
 PropertyDefined by
  allowRandomSeek : Boolean
[read-only] Does this provider support random seeking to unbuffered areas in the timeline?
StreamProvider
  bufferEnd : Number
[read-only] The point in timeline where the buffered data region ends, in seconds.
StreamProvider
  bufferStart : Number
[read-only] The point in timeline where the buffered data region begins, in seconds.
StreamProvider
  fileSize : Number
[read-only] File size in bytes.
StreamProvider
  netConnection : NetConnection
[read-only] Gets the underlying netConnection object.
StreamProvider
  netStream : NetStream
[read-only] Gets the underlying NetStream object.
StreamProvider
  playlist : Playlist
StreamProvider
  stopping : Boolean
[read-only] Is this provider in the process of stopping the stream? When stopped the provider should not dispatch any events resulting from events that might get triggered by the underlying streaming implementation.
StreamProvider
  streamCallbacks : Dictionary
[read-only] Get the current stream callbacks.
StreamProvider
  time : Number
[read-only] Current playhead time in seconds.
StreamProvider
  timeProvider : TimeProvider
[write-only] Sets a time provider to be used by this StreamProvider.
StreamProvider
  type : String
[read-only] Gets the type of StreamProvider either http, rtmp, psuedo.
StreamProvider
  volumeController : VolumeController
[write-only] Volume controller used to control the video volume.
StreamProvider
Public Methods
 MethodDefined by
  
addConnectionCallback(name:String, listener:Function):void
Adds a callback function to the NetConnection instance.
StreamProvider
  
addStreamCallback(name:String, listener:Function):void
Adds a callback function to the NetStream object.
StreamProvider
  
attachStream(video:DisplayObject):void
Attaches a stream to the specified display object.
StreamProvider
  
getVideo(clip:Clip):DisplayObject
Gets the Video object.
StreamProvider
  
load(event:ClipEvent, clip:Clip, pauseAfterStart:Boolean = true):void
Starts loading the specivied clip.
StreamProvider
  
pause(event:ClipEvent):void
Pauses playback.
StreamProvider
  
resume(event:ClipEvent):void
Resumes playback.
StreamProvider
  
seek(event:ClipEvent, seconds:Number):void
Seeks to the specified point in the timeline.
StreamProvider
  
stop(event:ClipEvent, closeStream:Boolean = false):void
Stops and rewinds to the beginning of current clip.
StreamProvider
  
Stops loading data into the buffer.
StreamProvider
  
switchStream(event:ClipEvent, clip:Clip, netStreamPlayOptions:Object = null):void
Switch the stream in realtime with / without dynamic stream switching support
StreamProvider
Property detail
allowRandomSeekproperty
allowRandomSeek:Boolean  [read-only]

Does this provider support random seeking to unbuffered areas in the timeline?

Implementation
    public function get allowRandomSeek():Boolean
bufferEndproperty 
bufferEnd:Number  [read-only]

The point in timeline where the buffered data region ends, in seconds.

Implementation
    public function get bufferEnd():Number
bufferStartproperty 
bufferStart:Number  [read-only]

The point in timeline where the buffered data region begins, in seconds.

Implementation
    public function get bufferStart():Number
fileSizeproperty 
fileSize:Number  [read-only]

File size in bytes.

Implementation
    public function get fileSize():Number
netConnectionproperty 
netConnection:NetConnection  [read-only]

Gets the underlying netConnection object.

Implementation
    public function get netConnection():NetConnection
netStreamproperty 
netStream:NetStream  [read-only]

Gets the underlying NetStream object.

Implementation
    public function get netStream():NetStream
playlistproperty 
playlist:Playlist  [read-write]Implementation
    public function get playlist():Playlist
    public function set playlist(value:Playlist):void
stoppingproperty 
stopping:Boolean  [read-only]

Is this provider in the process of stopping the stream? When stopped the provider should not dispatch any events resulting from events that might get triggered by the underlying streaming implementation.

Implementation
    public function get stopping():Boolean
streamCallbacksproperty 
streamCallbacks:Dictionary  [read-only]

Get the current stream callbacks.

Implementation
    public function get streamCallbacks():Dictionary
timeproperty 
time:Number  [read-only]

Current playhead time in seconds.

Implementation
    public function get time():Number
timeProviderproperty 
timeProvider:TimeProvider  [write-only]

Sets a time provider to be used by this StreamProvider. Normally the playhead time is queried from the NetStream.time property.

Implementation
    public function set timeProvider(value:TimeProvider):void
typeproperty 
type:String  [read-only]

Gets the type of StreamProvider either http, rtmp, psuedo.

Implementation
    public function get type():String
volumeControllerproperty 
volumeController:VolumeController  [write-only]

Volume controller used to control the video volume.

Implementation
    public function set volumeController(value:VolumeController):void
Method detail
addConnectionCallback()method
public function addConnectionCallback(name:String, listener:Function):void

Adds a callback function to the NetConnection instance. This function will fire ClipEvents whenever the callback is invoked in the connection.

Parameters
name:String
 
listener:Function

See also

ClipEventType.CONNECTION_EVENT
addStreamCallback()method 
public function addStreamCallback(name:String, listener:Function):void

Adds a callback function to the NetStream object. This function will fire a ClipEvent of type StreamEvent whenever the callback has been invoked on the stream. The invokations typically come from a server-side app running on RTMP server.

Parameters
name:String
 
listener:Function

See also

ClipEventType.NETSTREAM_EVENT
attachStream()method 
public function attachStream(video:DisplayObject):void

Attaches a stream to the specified display object.

Parameters
video:DisplayObject — the video object that was originally retrieved using getVideo().

See also

getVideo()method 
public function getVideo(clip:Clip):DisplayObject

Gets the Video object. A stream will be attached to the returned video object using attachStream().

Parameters
clip:Clip — the clip for which the Video object is queried for

Returns
DisplayObject

See also

load()method 
public function load(event:ClipEvent, clip:Clip, pauseAfterStart:Boolean = true):void

Starts loading the specivied clip. Once video data is available the provider must set it to the clip using clip.setContent(). Typically the video object passed to the clip is an instance of flash.media.Video.

Parameters
event:ClipEvent — the event that this provider should dispatch once loading has successfully started, once dispatched the player will call getVideo()
 
clip:Clip — the clip to load
 
pauseAfterStart:Boolean (default = true) — if true the playback is paused on first frame and buffering is continued

See also

Clip.setContent()
getVideo()
pause()method 
public function pause(event:ClipEvent):void

Pauses playback.

Parameters
event:ClipEvent — the event that this provider should dispatch once loading has been successfully paused
resume()method 
public function resume(event:ClipEvent):void

Resumes playback.

Parameters
event:ClipEvent — the event that this provider should dispatch once loading has been successfully resumed
seek()method 
public function seek(event:ClipEvent, seconds:Number):void

Seeks to the specified point in the timeline.

Parameters
event:ClipEvent — the event that this provider should dispatch once the seek is in target
 
seconds:Number — the target point in the timeline
stop()method 
public function stop(event:ClipEvent, closeStream:Boolean = false):void

Stops and rewinds to the beginning of current clip.

Parameters
event:ClipEvent — the event that this provider should dispatch once loading has been successfully stopped
 
closeStream:Boolean (default = false)
stopBuffering()method 
public function stopBuffering():void

Stops loading data into the buffer.

switchStream()method 
public function switchStream(event:ClipEvent, clip:Clip, netStreamPlayOptions:Object = null):void

Switch the stream in realtime with / without dynamic stream switching support

Parameters
event:ClipEvent — ClipEvent the clip event
 
clip:Clip — Clip the clip to switch to
 
netStreamPlayOptions:Object (default = null) — Object the NetStreamPlayOptions object to enable dynamic stream switching