public final class NetStream extends AbstractNetStream implements INetStream
NetStream - implementation of the INetStream interface.INetStream.IAcknowledgementINetStream.IListener, INetStream.Info, INetStream.ListenerAdapterAPPEND, CLEAR_FAILED, CLEAR_SUCCESS, DATA_START, FAILED, INVALID_ARGUMENT, LIVE, PAUSE_NOTIFY, PLAY_COMPLETE, PLAY_FAILED, PLAY_FILE_STRUCTURE_INVALID, PLAY_INSUFFICIENT_BW, PLAY_NO_SUPPORTED_TRACK_FOUND, PLAY_PUBLISH_NOTIFY, PLAY_RESET, PLAY_START, PLAY_STOP, PLAY_STREAM_NOT_FOUND, PLAY_SWITCH, PLAY_UNPUBLISH_NOTIFY, PUBLISH_BADNAME, PUBLISH_START, RECORD, RECORD_FAILED, RECORD_NOACCESS, RECORD_START, RECORD_STOP, SEEK_FAILED, SEEK_NOTIFY, UNPAUSE_NOTIFY, UNPUBLISH_SUCCESS| Constructor and Description | 
|---|
NetStream(INetConnection connection)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
_RtmpSampleAccess(boolean audio,
                 boolean video)
'|RtmpSampleAccess' invoked by FMS server. 
 | 
void | 
attachAudio(IMicrophone microphone)
Specifies an audio stream sent over the INetStream object,
 from a  
microphone object passed as the source. | 
void | 
attachCamera(ICamera camera,
            int snapshotMilliseconds)
Starts capturing video from the specified source, or stops capturing
 if  
camera is set to null. | 
boolean | 
audioReliable()
For RTMFP connections, specifies whether audio is sent with full reliability. 
 | 
void | 
audioReliable(boolean reliable)
For RTMFP connections, specifies whether audio is sent with full reliability. 
 | 
boolean | 
audioSampleAccess()
For RTMFP connections, specifies whether peer-to-peer subscribers on this NetStream
 are allowed to capture the audio stream. 
 | 
void | 
audioSampleAccess(boolean access)
For RTMFP connections, specifies whether peer-to-peer subscribers on this NetStream
 are allowed to capture the audio stream. 
 | 
double | 
bufferLength()
Returns number of seconds of data currently in the buffer. 
 | 
int | 
bufferSize()
Returns number of data bytes currently in the buffer. 
 | 
long | 
bytesLoaded()
Returns number of bytes of data that have been loaded. 
 | 
long | 
bytesTotal()
Returns total size (in bytes) of the file being loaded. 
 | 
int | 
clearBuffer()
Clears buffer. 
 | 
void | 
close()
Stops playing all data on the stream, sets the time property to 0, and
 makes the stream available for another use. 
 | 
double | 
currentFPS()
Returns the number of frames per second being displayed. 
 | 
boolean | 
dataReliable()
For RTMFP connections, specifies whether NetStream.send() calls are sent with full reliability. 
 | 
void | 
dataReliable(boolean reliable)
For RTMFP connections, specifies whether NetStream.send() calls are sent with full reliability. 
 | 
java.lang.String | 
farID()
For RTMFP connections, the identifier of the far end that is connected to this NetStream instance. 
 | 
java.lang.String | 
farNonce()
For RTMFP and RTMPE connections, a value chosen substantially by the other end of this stream,
 unique to this connection. 
 | 
INetStream.IAcknowledgement | 
getAcknowledgement()  | 
ICamera | 
getCamera()
Returns  
ICamera associated with the stream. | 
INetStream.Info | 
getInfo()
Returns overall stream info. 
 | 
IMicrophone | 
getMicrophone()
Returns  
IMicrophone associated with the stream. | 
IVideo | 
getVideo()
Returns  
IVideo associated with the stream. | 
NetStreamInfo | 
info()
Returns a NetStreamInfo object whose properties contain statistics about the quality of service. 
 | 
double | 
liveDelay()
Returns the number of seconds of data in the subscribing stream's buffer in live (unbuffered) mode. 
 | 
boolean | 
multicastAvailabilitySendToAll()
For RTMFP connections, specifies whether peer-to-peer multicast fragment availability
 messages are sent to all peers or to just one peer. 
 | 
void | 
multicastAvailabilitySendToAll(boolean sendToAll)
For RTMFP connections, specifies whether peer-to-peer multicast fragment availability
 messages are sent to all peers or to just one peer. 
 | 
int | 
multicastAvailabilityUpdatePeriod()
For RTMFP connections, specifies the interval in seconds between messages
 sent to peers informing them that the local node has new peer-to-peer
 multicast media fragments available. 
 | 
void | 
multicastAvailabilityUpdatePeriod(int period)
For RTMFP connections, specifies the interval in seconds between messages
 sent to peers informing them that the local node has new peer-to-peer
 multicast media fragments available. 
 | 
int | 
multicastFetchPeriod()
For RTMFP connections, specifies the time in seconds between when the local node
 learns that a peer-to-peer multicast media fragment is available and
 when it tries to fetch it from a peer. 
 | 
void | 
multicastFetchPeriod(int period)
For RTMFP connections, specifies the time in seconds between when the local node
 learns that a peer-to-peer multicast media fragment is available and
 when it tries to fetch it from a peer. 
 | 
NetStreamMulticastInfo | 
multicastInfo()
For RTMFP connections, returns a NetStreamMulticastInfo object
 whose properties contain statistics about the quality of service. 
 | 
int | 
multicastPushNeighborLimit()
For RTMFP connections, specifies the maximum number of peers to which
 to proactively push multicast media. 
 | 
void | 
multicastPushNeighborLimit(int limit)
For RTMFP connections, specifies the maximum number of peers to which
 to proactively push multicast media. 
 | 
int | 
multicastRelayMarginDuration()
For RTMFP connections, specifies the duration in seconds that peer-to-peer
 multicast data remains available to send to peers that request
 it beyond a specified duration. 
 | 
void | 
multicastRelayMarginDuration(int duration)
For RTMFP connections, specifies the duration in seconds that peer-to-peer
 multicast data remains available to send to peers that request
 it beyond a specified duration. 
 | 
int | 
multicastWindowDuration()
For RTMFP connections, specifies the duration in seconds of the peer-to-peer
 multicast reassembly window. 
 | 
void | 
multicastWindowDuration(int duration)
For RTMFP connections, specifies the duration in seconds of the peer-to-peer
 multicast reassembly window. 
 | 
java.lang.String | 
nearNonce()
For RTMFP and RTMPE connections, a value chosen substantially by this end of the stream,
 unique to this connection. 
 | 
void | 
pause()
Pauses playback of a video stream. 
 | 
java.util.List<INetStream> | 
peerStreams()
An object that holds all of the subscribing NetStream instances
 that are listening to this publishing NetStream instance. 
 | 
void | 
play(IVideo video,
    java.lang.Object... args)
Begins playback of external audio or a video (FLV) file. 
 | 
void | 
publish(java.lang.String name,
       java.lang.String type)
Sends streaming audio, video, and text messages from a client to a server. 
 | 
void | 
receiveAudio(boolean flag)
Specifies whether incoming audio plays on the stream. 
 | 
void | 
receiveVideo(boolean flag)
Specifies whether incoming video plays on the stream. 
 | 
void | 
resume()
Resumes playback of a video stream that is paused. 
 | 
void | 
seek(double offset)
Seeks the keyframe closest to the specified location (an offset, in seconds,
 from the beginning of the stream). 
 | 
void | 
send(java.lang.String handlerName,
    java.lang.Object... args)
Sends a message on the specified stream to all subscribing clients. 
 | 
void | 
setAcknowledgement(INetStream.IAcknowledgement ack)
Sets  
ack. | 
double | 
time()
Returns position of the playhead (in seconds). 
 | 
void | 
togglePause()
Pauses or resumes playback of a stream. 
 | 
boolean | 
videoReliable()
For RTMFP connections, specifies whether video is sent with full reliability. 
 | 
void | 
videoReliable(boolean reliable)
For RTMFP connections, specifies whether video is sent with full reliability. 
 | 
boolean | 
videoSampleAccess()
For RTMFP connections, specifies whether peer-to-peer subscribers on this NetStream
 are allowed to capture the video stream. 
 | 
void | 
videoSampleAccess(boolean access)
For RTMFP connections, specifies whether peer-to-peer subscribers on this NetStream
 are allowed to capture the video stream. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEventListener, bufferTime, bufferTime, client, client, objectEncoding, removeEventListenerpublic NetStream(INetConnection connection)
connection - connectionpublic INetStream.Info getInfo()
INetStreamgetInfo in interface INetStreampublic ICamera getCamera()
INetStreamICamera associated with the stream.
  Note:
 
 - Camera is set by INetStream.attachCamera(ICamera, int) method.
getCamera in interface INetStreampublic IMicrophone getMicrophone()
INetStreamIMicrophone associated with the stream.
  Note:
 
 - Microphone is set by INetStream.attachAudio(IMicrophone) method.
getMicrophone in interface INetStreampublic IVideo getVideo()
INetStreamIVideo associated with the stream.
  Note:
 
 - Video is set by INetStream.play(IVideo, Object[]) method.
getVideo in interface INetStreampublic double bufferLength()
INetStreambufferLength in interface INetStreampublic int bufferSize()
INetStreambufferSize in interface INetStreampublic long bytesLoaded()
INetStreambytesLoaded in interface INetStreampublic long bytesTotal()
INetStreambytesTotal in interface INetStreampublic int clearBuffer()
INetStreamclearBuffer in interface INetStreampublic void attachAudio(IMicrophone microphone)
INetStreammicrophone object passed as the source.attachAudio in interface INetStreammicrophone - source of the audio transmissionpublic void attachCamera(ICamera camera, int snapshotMilliseconds)
INetStreamcamera is set to null. This method is available only
 to the publisher of the specified stream.attachCamera in interface INetStreamcamera - source of the video transmissionsnapshotMilliseconds - Specifies whether the video stream is continuous,
 a single frame, or a series of single frames used to create time-lapse photographypublic void publish(java.lang.String name,
           java.lang.String type)
INetStreampublish in interface INetStreamname - string that identifies the streamtype - string that specifies how to publish the stream.
 Valid values are "record", "append", and "live". The default value is "live".public void send(java.lang.String handlerName,
        java.lang.Object... args)
INetStreamsend in interface INetStreamargs - optional arguments that can be of any typepublic double currentFPS()
INetStreamcurrentFPS in interface INetStreampublic double liveDelay()
INetStreamliveDelay in interface INetStreampublic double time()
INetStreamtime in interface INetStreampublic void play(IVideo video, java.lang.Object... args)
INetStream Note: 
 file parameter can be either string or object array:
 {name : Object [,start : Number[, len : Number[, reset : Object]]]}
 where
    start - An optional numeric parameter that specifies the
 start time, in seconds. This parameter can also be used to indicate whether
 the stream is live or recorded.
    The default value for start is -2, which means that it first tries to play
 the live stream specified in name. If a live stream of that name is not found,
 it plays the recorded stream specified in name. If neither a live nor a
 recorded stream is found, it opens a live stream named name, even
 though no one is publishing on it. When someone does begin publishing on
 that stream, it begins playing it.
    If you pass -1 for start, it plays only the live stream specified in name.
 If no live stream is found, it waits for it indefinitely if len is set to -1;
 if len is set to a different value, it waits for len seconds before it begins
 playing the next item in the playlist.
    If you pass 0 or a positive number for start, it plays only a recorded
 stream named name, beginning start seconds from the beginning of the stream.
 If no recorded stream is found, it begins playing the next item in the playlist
 immediately.
    If you pass a negative number other than -1 or -2 for start, it
 interprets the value as if it were -2.
 
    len - An optional numeric parameter that specifies the duration of the playback,
 in seconds.
    The default value for len is -1, which means that it plays a live stream
 until it is no longer available or plays a recorded stream until it ends.
    If you pass 0 for len, it plays the single frame that is start seconds
 from the beginning of a recorded stream (assuming start is equal to or greater than 0).
    If you pass a positive number for len, it plays a live stream for len seconds
 after it becomes available, or plays a recorded stream for len seconds.
 (If a stream ends before len seconds, playback ends when the stream ends.)
    If you pass a negative number other than -1 for len, it interprets the value
 as if it were -1.
 
    reset - An optional Boolean value or number that specifies whether to
 flush any previous playlist. If reset is false (0), name is added (queued)
 in the current playlist; that is, name plays only after previous streams
 finish playing. You can use this technique to create a dynamic playlist.
 If reset is true (1), any previous play calls are cleared and name is played
 immediately. By default, the value is true.play in interface INetStreamvideo - video object which received audio/video dataargs - the location of the FLV file to play, as a URLRequest object or a stringpublic void pause()
INetStreampause in interface INetStreampublic void receiveAudio(boolean flag)
INetStreamreceiveAudio in interface INetStreamflag - specifies whether incoming audio plays on the
 specified stream (true) or not (false)public void receiveVideo(boolean flag)
INetStreamreceiveVideo in interface INetStreamflag - specifies whether incoming video plays on the
 specified stream (true) or not (false)public void resume()
INetStreamresume in interface INetStreampublic void seek(double offset)
INetStreamseek in interface INetStreamoffset - offset positionpublic void togglePause()
INetStreamtogglePause in interface INetStreampublic void close()
INetStreamclose in interface INetStreampublic INetStream.IAcknowledgement getAcknowledgement()
public void setAcknowledgement(INetStream.IAcknowledgement ack)
INetStreamack.public boolean audioReliable()
INetStreamtrue, all audio transmitted over this NetStream is fully reliable.
 When false, the audio transmitted is not fully reliable, but instead is retransmitted for a limited time and then dropped.
 You can use the false value to reduce latency at the expense of audio quality.
 
 false on a network protocol
 that does not support partial reliability, the attempt is ignored and the property is set to true.public void audioReliable(boolean reliable)
INetStreamtrue, all audio transmitted over this NetStream is fully reliable.
 When false, the audio transmitted is not fully reliable, but instead is retransmitted for a limited time and then dropped.
 You can use the false value to reduce latency at the expense of audio quality.
 
 false on a network protocol
 that does not support partial reliability, the attempt is ignored and the property is set to true.public boolean audioSampleAccess()
INetStreamfalse, subscriber attempts to capture the audio stream show permission errors.public void audioSampleAccess(boolean access)
INetStreamfalse, subscriber attempts to capture the audio stream show permission errors.public boolean dataReliable()
INetStreamtrue, NetStream.send() calls that are transmitted over this NetStream are fully reliable.
 When false, NetStream.send() calls are not transmitted with full reliability,
 but instead are retransmitted for a limited time and then dropped.
 You can set this value to false to reduce latency at the expense of data quality.
 
 false on a network protocol that does not support partial reliability,
 the attempt is ignored and the property is set to true.public void dataReliable(boolean reliable)
INetStreamtrue, NetStream.send() calls that are transmitted over this NetStream are fully reliable.
 When false, NetStream.send() calls are not transmitted with full reliability,
 but instead are retransmitted for a limited time and then dropped.
 You can set this value to false to reduce latency at the expense of data quality.
 
 false on a network protocol that does not support partial reliability,
 the attempt is ignored and the property is set to true.public java.lang.String farID()
INetStreampublic java.lang.String farNonce()
INetStreampublic NetStreamInfo info()
INetStreampublic boolean multicastAvailabilitySendToAll()
INetStreamtrue specifies that the messages are sent to all peers once per
 specified interval. A value of false specifies that the messages are sent to just
 one peer per specified interval.
 The interval is determined by the multicastAvailabilityUpdatePeriod property.public void multicastAvailabilitySendToAll(boolean sendToAll)
INetStreamtrue specifies that the messages are sent to all peers once per
 specified interval. A value of false specifies that the messages are sent to just
 one peer per specified interval.
 The interval is determined by the multicastAvailabilityUpdatePeriod property.public int multicastAvailabilityUpdatePeriod()
INetStreampublic void multicastAvailabilityUpdatePeriod(int period)
INetStreampublic int multicastFetchPeriod()
INetStreampublic void multicastFetchPeriod(int period)
INetStreampublic int multicastPushNeighborLimit()
INetStreampublic void multicastPushNeighborLimit(int limit)
INetStreampublic int multicastRelayMarginDuration()
INetStreampublic void multicastRelayMarginDuration(int duration)
INetStreampublic int multicastWindowDuration()
INetStreampublic void multicastWindowDuration(int duration)
INetStreampublic NetStreamMulticastInfo multicastInfo()
INetStreampublic java.lang.String nearNonce()
INetStreampublic java.util.List<INetStream> peerStreams()
INetStreampublic boolean videoReliable()
INetStreamtrue, all video transmitted over this NetStream is fully reliable.
 When false, the video transmitted is not fully reliable, but instead is retransmitted for a limited time and then dropped.
 You can use the false value to reduce latency at the expense of video quality.
 
 false on a network protocol
 that does not support partial reliability, the attempt is ignored and the property is set to true.public void videoReliable(boolean reliable)
INetStreamtrue, all video transmitted over this NetStream is fully reliable.
 When false, the video transmitted is not fully reliable, but instead is retransmitted for a limited time and then dropped.
 You can use the false value to reduce latency at the expense of video quality.
 
 false on a network protocol
 that does not support partial reliability, the attempt is ignored and the property is set to true.public boolean videoSampleAccess()
INetStreamfalse, subscriber attempts to capture the video stream show permission errors.public void videoSampleAccess(boolean access)
INetStreamfalse, subscriber attempts to capture the video stream show permission errors.public void _RtmpSampleAccess(boolean audio,
                     boolean video)
audio - video -