NetStream


Object
    |
    +-NetStream

public dynamic class NetStream
extends Object

The NetStream class provides methods and properties for playing Flash Video (FLV) files from the local file system or an HTTP address. You use a NetStream object to stream video through a NetConnection object. Playing external FLV files provides several advantages over embedding video in a Flash document, such as better performance and memory management, and independent video and Flash frame rates. This class provides a number of methods and properties you can use to track the progress of the file as it loads and plays, and to give the user control over playback (stopping, pausing, and so on).

Availability: ActionScript 1.0; Flash Player 7

Property summary

Modifiers

Property

Description

 

bufferLength:Number [read-only]

The number of seconds of data currently in the buffer.

 

bufferTime:Number [read-only]

The number of seconds assigned to the buffer by NetStream.setBufferTime().

 

bytesLoaded:Number [read-only]

The number of bytes of data that have been loaded into the player.

 

bytesTotal:Number [read-only]

The total size in bytes of the file being loaded into the player.

 

checkPolicyFile:Boolean

Specifies whether Flash Player should attempt to download a cross-domain policy file from the loaded FLV file's server before beginning to load the FLV file itself.

 

currentFps:Number [read-only]

The number of frames per second being displayed.

 

time:Number [read-only]

The position of the playhead, in seconds.

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Event summary

Event

Description

onCuePoint = function(infoObject:Object) {}

Invoked when an embedded cue point is reached while playing an FLV file.

onMetaData = function(infoObject:Object) {}

Invoked when the Flash Player receives descriptive information embedded in the FLV file being played.

onStatus = function(infoObject:Object) {}

Invoked every time a status change or error is posted for the NetStream object.

Constructor summary

Signature

Description

NetStream(connection:NetConnection)

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

Method summary

Modifiers

Signature

Description

 

close() : Void

Stops playing all data on the stream, sets the NetStream.time property to 0, and makes the stream available for another use.

 

pause([flag:Boolean]) : Void

Pauses or resumes playback of a stream.

 

play(name:Object, start:Number, len:Number, reset:Object) : Void

Begins playback of an external video (FLV) file.

 

seek(offset:Number) : Void

Seeks the keyframe closest to the specified number of seconds from the beginning of the stream.

 

setBufferTime(bufferTime:Number) : Void

Specifies how long to buffer messages before starting to display the stream.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)



Flash CS3