NetStream object

The NetStream object provides methods and properties for playing Flash Video (FLV) files from the local file system or an HTTP address.

Method summary for the NetStream object

Method Description
NetStream.close() Stops publishing or playing all data on the stream and makes the stream available for another use.
NetStream.pause() Pauses or resumes playback of a stream.
NetStream.play() Subscriber method; feeds streaming audio, video, and text messages being published on the Flash Communication Server, or a recorded file stored on the server, to the client.
NetStream.seek() Subscriber method; seeks to a position in the recorded stream currently playing.
NetStream.setBufferTime() Method; for a publishing stream, this number indicates how long the outgoing buffer can grow before Flash starts dropping frames. For a subscribing stream, this number indicates how long to buffer incoming data before starting to displaying the stream.

Property summary for the NetStream object

Property Description
NetStream.bufferLength The number of seconds of data currently in the buffer.
NetStream.bufferTime The number of seconds assigned to the buffer by NetStream.setBufferTime().
NetStream.currentFps The number of frames per second being sent or received on the publishing or subscribing stream.
NetStream.time The number of seconds a stream has been playing or publishing.

Event handler summary for the NetStream object

Event handler Description
NetStream.onStatus Invoked every time a status change or error is posted for the NetStream object.

Constructor for the NetStream object

Availability

Flash Player 6.

Usage

new NetStream(my_nc)

Parameters

my_nc A NetConnection object.

Returns

A NetStream object.

Description

Constructor; creates a stream that can be used for playing FLV files through the specified NetConnection object.

Example

The following code first constructs a new NetConnection object, my_nc, and uses it to construct a new NetStream object called videoStream_ns.

my_nc = new NetConnection();
videoStream_ns = new NetStream(my_nc);

See also

NetConnection object, NetStream object