Packageorg.openvideoplayer.net
Classpublic class OvpNetStream
InheritanceOvpNetStream Inheritance flash.net.NetStream
Subclasses AkamaiNetStream, OvpDynamicNetStream

The OvpNetStream class extends flash.net.NetStream to provide unique features such as a fast start (dual buffer) for streams, and metadata events.



Public Properties
 PropertyDefined By
  bufferPercentage : Number
[read-only] The buffer percentage currently reported by the stream.
OvpNetStream
  bufferTimeout : Number
OvpNetStream
  client : Object
[override] [write-only] Sets the client object for this class, to enable integration into existing players which like to receive onMetaData, onPlayStatus etc via callback events.
OvpNetStream
  createProgressivePauseEvents : Boolean
Since the Flash player does not dispatch pause and resume events for progressive download files, setting this property to true, will cause this class to dispatch the proper events when pause or resume is called.
OvpNetStream
  fastMotionFrameStepAmount : uint
Use this accessor to set the value of the variable that controls how many frames will be stepped over during fast motion playback.
OvpNetStream
  fastMotionStepInterval : uint
Use this accessor to set the value of the variable that controls how quickly the frames will be stepped over during fast motion playback.
OvpNetStream
  fastStartMinBufferLength : Number
Added by Will for suppport player
OvpNetStream
  isBuffering : Boolean
[read-only] Returns the buffering status of the stream.
OvpNetStream
  isLive : Boolean
The isLive flag is a convenience property.
OvpNetStream
  isProgressive : Boolean
[read-only] Informs whether the current connection is progressive or not.
OvpNetStream
  maxBufferLength : Number
The desired buffer length set for the NetStream, in seconds.
OvpNetStream
  netConnection : NetConnection
[read-only] Get the NetConnection object this class is using.
OvpNetStream
  panning : Number
The panning of the current NetStream.
OvpNetStream
  progressInterval : Number
The interval in milliseconds at which the OvpEvent.PROGRESS event is dispatched.
OvpNetStream
  slowMotionFrameStepAmount : uint
Use this accessor to set the value of the variable that controls how many frames will be stepped over during slow motion playback.
OvpNetStream
  slowMotionStepInterval : uint
Use this accessor to set the value of the variable that controls how quickly the frames will be stepped over during slow motion playback.
OvpNetStream
  streamLength : Number
[read-only] The stream length for a progressive download.
OvpNetStream
  streamTimeout : Number
The maximum number of seconds the class should wait before timing out while trying to locate a stream on the network.
OvpNetStream
  timeAsTimeCode : String
[read-only] Returns the current time of the stream, as timecode HH:MM:SS.
OvpNetStream
  useFastStartBuffer : Boolean
Dictates whether a fast start (dual buffer) strategy should be used.
OvpNetStream
  volume : Number
The volume of the NetStream.
OvpNetStream
Public Methods
 MethodDefined By
  
OvpNetStream(connection:Object)
Constructor
OvpNetStream
  
close():void
[override] Closes the stream.
OvpNetStream
  
fastMotionOn(forward:Boolean = true, overrideStepRate:Number, overrideStepInterval:Number):void
Turns on fast motion playback - NOTE - for use with FMS streaming
OvpNetStream
  
getMp3Id3Info(filename:String):Boolean
Initiates the process of extracting the ID3 information from an MP3 file.
OvpNetStream
  
pause():void
[override]
OvpNetStream
  
play(... arguments):void
[override] Begins playing content if it exists.
OvpNetStream
  
resume():void
[override]
OvpNetStream
  
slowMotionOn(forward:Boolean = true, overrideStepRate:Number, overrideStepInterval:Number):void
Turns on slow motion playback - NOTE - for use with FMS streaming
OvpNetStream
  
Returns playback mode to normal and cleans up.
OvpNetStream
Events
 Event Summary Defined By
  Dispatched if the class receives an AsyncErrorEvent.ASYNC_ERROR event.OvpNetStream
  Dispatched when a stream from a server is complete.OvpNetStream
  Dispatched when an embedded cue point is reached while playing a video.OvpNetStream
  Dispatched when the class has detected, by analyzing the NetStream.netStatus events, the end of the stream.OvpNetStream
  Dispatched when an OVP error condition has occurred.OvpNetStream
  Dispatched when the class receives information about ID3 data embedded in an MP3 file.OvpNetStream
  Dispatched when the class receives an image embedded in a H.264 file.OvpNetStream
  Dispatched when the class receives descriptive information embedded in the video file being played.OvpNetStream
  Dispatched if the class' onFI callback is called.OvpNetStream
  Dispatched when the class has completely played a stream or switches to a different stream in a server-side playlist.OvpNetStream
  Dispatched repeatedly at the progressInterval once the class begins playing a stream.OvpNetStream
  Dispatched if metadata matching the name "duration" is received while playing a progressive stream.OvpNetStream
  Dispatched when the class receives text data embedded in a H.264 file.OvpNetStream
  Dispatched if the trick timer event onTrickMotion callback is called.OvpNetStream
Property Detail
bufferPercentageproperty
bufferPercentage:Number  [read-only]

The buffer percentage currently reported by the stream. This property will always have an integer value between 0 and 100. The max value is capped at 100 even if the bufferLength exceeds the bufferTime.


Implementation
    public function get bufferPercentage():Number

See also

flash.net.NetStream.bufferTime
maxBufferLength
bufferTimeoutproperty 
bufferTimeout:Number


Implementation
    public function get bufferTimeout():Number
    public function set bufferTimeout(value:Number):void
clientproperty 
client:Object  [write-only] [override]

Sets the client object for this class, to enable integration into existing players which like to receive onMetaData, onPlayStatus etc via callback events. Note that the OvpNetStream class makes these same callbacks available as events. These, combined with the OvpEvent.DATA_MESSAGE generic callback catcher, make use of the client object unnecessary.


Implementation
    public function set client(value:Object):void
createProgressivePauseEventsproperty 
createProgressivePauseEvents:Boolean

Since the Flash player does not dispatch pause and resume events for progressive download files, setting this property to true, will cause this class to dispatch the proper events when pause or resume is called.


Implementation
    public function get createProgressivePauseEvents():Boolean
    public function set createProgressivePauseEvents(value:Boolean):void
fastMotionFrameStepAmountproperty 
fastMotionFrameStepAmount:uint

Use this accessor to set the value of the variable that controls how many frames will be stepped over during fast motion playback.


Implementation
    public function get fastMotionFrameStepAmount():uint
    public function set fastMotionFrameStepAmount(value:uint):void
fastMotionStepIntervalproperty 
fastMotionStepInterval:uint

Use this accessor to set the value of the variable that controls how quickly the frames will be stepped over during fast motion playback.


Implementation
    public function get fastMotionStepInterval():uint
    public function set fastMotionStepInterval(value:uint):void
fastStartMinBufferLengthproperty 
fastStartMinBufferLength:Number

Added by Will for suppport player


Implementation
    public function get fastStartMinBufferLength():Number
    public function set fastStartMinBufferLength(value:Number):void
isBufferingproperty 
isBuffering:Boolean  [read-only]

Returns the buffering status of the stream. This value will be true after NetStream.Play.Start and before NetStream.Buffer.Full or NetStream.Buffer.Flush and false at all other times.


Implementation
    public function get isBuffering():Boolean
isLiveproperty 
isLive:Boolean

The isLive flag is a convenience property. This class currently does nothing with this property.


Implementation
    public function get isLive():Boolean
    public function set isLive(value:Boolean):void
isProgressiveproperty 
isProgressive:Boolean  [read-only]

Informs whether the current connection is progressive or not.


Implementation
    public function get isProgressive():Boolean

See also

maxBufferLengthproperty 
maxBufferLength:Number

The desired buffer length set for the NetStream, in seconds. If useFastStartBuffer has been set to false (the default), then this value will be used to set the constant buffer value on the NetStream. If useFastStartBuffer has been set to true, then the NetStream buffer will alternate between 0.5 (after a NetStream.Play.Start event) and the value set by this property.

The default value is 3.


Implementation
    public function get maxBufferLength():Number
    public function set maxBufferLength(value:Number):void

See also

useFastStartBuffer
flash.net.NetStream.bufferTime
flash.net.NetStream.bufferLength
netConnectionproperty 
netConnection:NetConnection  [read-only]

Get the NetConnection object this class is using.


Implementation
    public function get netConnection():NetConnection
panningproperty 
panning:Number

The panning of the current NetStream. Possible volume values lie between -1 (full left) to 1 (full right).

The default value is 0.


Implementation
    public function get panning():Number
    public function set panning(value:Number):void
progressIntervalproperty 
progressInterval:Number

The interval in milliseconds at which the OvpEvent.PROGRESS event is dispatched. This event commences with the first play() request and continues until close() is called.

The default value is 100.


Implementation
    public function get progressInterval():Number
    public function set progressInterval(value:Number):void

See also

slowMotionFrameStepAmountproperty 
slowMotionFrameStepAmount:uint

Use this accessor to set the value of the variable that controls how many frames will be stepped over during slow motion playback.


Implementation
    public function get slowMotionFrameStepAmount():uint
    public function set slowMotionFrameStepAmount(value:uint):void
slowMotionStepIntervalproperty 
slowMotionStepInterval:uint

Use this accessor to set the value of the variable that controls how quickly the frames will be stepped over during slow motion playback.


Implementation
    public function get slowMotionStepInterval():uint
    public function set slowMotionStepInterval(value:uint):void
streamLengthproperty 
streamLength:Number  [read-only]

The stream length for a progressive download. The value is obtained in the onMetaData event handler, which is called when the Flash Player receives descriptive information embedded in the FLV file being played. Therefore, this property will return 0 until the onMetaData event handler is called. For streaming video, the stream length must be requested via the requestStreamLength method on the OvpConnection class. Note the onMetaData event handler in this class will dispatch an OvpEvent.STREAM_LENGTH event, just as the OvpConnection class does on a requestStreamLength method call on the OvpConnection class.


Implementation
    public function get streamLength():Number

See also

streamTimeoutproperty 
streamTimeout:Number

The maximum number of seconds the class should wait before timing out while trying to locate a stream on the network. This time begins decrementing the moment a play request is made. After this master time out has been triggered, the class will issue an Error event OvpError.STREAM_NOT_FOUND.

The default value is 3600.


Implementation
    public function get streamTimeout():Number
    public function set streamTimeout(value:Number):void
timeAsTimeCodeproperty 
timeAsTimeCode:String  [read-only]

Returns the current time of the stream, as timecode HH:MM:SS. This property will only return a valid value if the NetStream has been established.


Implementation
    public function get timeAsTimeCode():String
useFastStartBufferproperty 
useFastStartBuffer:Boolean

Dictates whether a fast start (dual buffer) strategy should be used. A fast start buffer means that the NetStream buffer is set to value of 0.5 seconds after a NetStream.Play.Start or NetStream.Buffer.Empty event and then to maxBufferLength after the NetStream.Buffer.Full event is received. This gives the advantages of a fast stream start combined with a robust buffer for long-term bandwidth. Users whose connections are close to the bitrate of the stream may see very rapid stuttering of the stream with this approach, so it is best deployed in situations in which each users' bandwidth is several multiples of the streaming files' bitrate.

Note that fast start cannot be used with LIVE STREAMS.


Implementation
    public function get useFastStartBuffer():Boolean
    public function set useFastStartBuffer(value:Boolean):void

See also

volumeproperty 
volume:Number

The volume of the NetStream. Possible volume values lie between 0 (silent) and 1 (full volume).

The default value is 1.


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Constructor Detail
OvpNetStream()Constructor
public function OvpNetStream(connection:Object)

Constructor

Parameters
connection:Object — This object can be either an OvpConnection object or a flash.net.NetConnection object. If an OvpConnection object is provided, the constructor will use the flash.net.NetConnection object within it.
Method Detail
close()method
override public function close():void

Closes the stream.

See also

flash.net.NetStream.close()
fastMotionOn()method 
public function fastMotionOn(forward:Boolean = true, overrideStepRate:Number, overrideStepInterval:Number):void

Turns on fast motion playback - NOTE - for use with FMS streaming

Parameters

forward:Boolean (default = true) — Defaulted to true, set this parameter to false to put fast motion playback in rewind mode.
 
overrideStepRate:Number (default = NaN) — Use this parameter to override the stored fastMotionFrameStepAmount variable. The overrideStepRate is the amount of frames that will be stepped over on each interval.
 
overrideStepInterval:Number (default = NaN) — Use this parameter to override the locally stored fastMotionStepInterval variable. The overrideStepInterval is the interval in which the frame stepping will be trigger.

getMp3Id3Info()method 
public function getMp3Id3Info(filename:String):Boolean

Initiates the process of extracting the ID3 information from an MP3 file. Since this process is asynchronous, the actual ID3 metadata is retrieved by listening for the OvpEvent.MP3_ID3 and inspecting the info parameter.

Parameters

filename:String

Returns
Boolean — false if the NetConnection has not yet been defined, otherwise true.
pause()method 
override public function pause():void

play()method 
override public function play(... arguments):void

Begins playing content if it exists. This method supports both streaming and progressive playback.

Parameters

... arguments — name of the stream to play.

See also

flash.net.NetStream.play()
resume()method 
override public function resume():void

slowMotionOn()method 
public function slowMotionOn(forward:Boolean = true, overrideStepRate:Number, overrideStepInterval:Number):void

Turns on slow motion playback - NOTE - for use with FMS streaming

Parameters

forward:Boolean (default = true) — Defaulted to true, set this parameter to false to put slow motion playback in rewind mode.
 
overrideStepRate:Number (default = NaN) — Use this parameter to override the stored slowMotionFrameStepAmount variable. The overrideStepRate is the amount of frames that will be stepped over on each interval.
 
overrideStepInterval:Number (default = NaN) — Use this parameter to override the locally stored slowMotionStepInterval variable. The overrideStepInterval is the interval in which the frame stepping will be trigger.

trickMotionModeOff()method 
public function trickMotionModeOff():void

Returns playback mode to normal and cleans up.

Event Detail
asyncerror Event
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched if the class receives an AsyncErrorEvent.ASYNC_ERROR event.

See also

complete Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when a stream from a server is complete.

See also

cuepoint Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when an embedded cue point is reached while playing a video.

See also

end Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

See also

error Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when an OVP error condition has occurred. The OvpEvent object contains a data property. The contents of the data property will contain the error number and a description.

See also

id3 Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class receives information about ID3 data embedded in an MP3 file.

See also

imagedata Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class receives an image embedded in a H.264 file.

metadata Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class receives descriptive information embedded in the video file being played.

See also

onfi Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched if the class' onFI callback is called.

See also

playstatus Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class has completely played a stream or switches to a different stream in a server-side playlist.

See also

progress Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched repeatedly at the progressInterval once the class begins playing a stream. Event is halted after close is called.

See also

streamlength Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched if metadata matching the name "duration" is received while playing a progressive stream.

textdata Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class receives text data embedded in a H.264 file.

trickModeTimerTick Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched if the trick timer event onTrickMotion callback is called. Only available in flash player 10.1 or higher.

See also