## org.red5.server.api.stream
Interface IBroadcastStream

All Superinterfaces:
  IStream

All Known Subinterfaces:
  IClientBroadcastStream, IServerStream

All Known Implementing Classes:
  ClientBroadcastStream, ServerStream

    public interface IBroadcastStream

extends IStream

A broadcast stream is a stream source to be subscribed by clients. To subscribe a stream from your client Flash application use NetStream.play method. Broadcast stream can be saved at server-side.

Author:
  The Red5 Project (red5@osflash.org), Luke Hubbard (luke@codegent.com), Steven Gong (steven.gong@gmail.com)

Method Summary
`void` `addStreamListener(IStreamListener listener)` Add a listener to be notified about received packets.
`Notify` `getMetaData()` Returns the metadata for the associated stream, if it exists.
`IProvider` `getProvider()` Get the provider corresponding to this stream.
`String` `getPublishedName()` Get stream publish name.
`String` `getSaveFilename()` Get the filename the stream is being saved as.
`Collection<IStreamListener>` `getStreamListeners()` Return registered stream listeners.
`void` `removeStreamListener(IStreamListener listener)` Remove a listener from being notified about received packets.
`void` `saveAs(String filePath, boolean isAppend)` Save the broadcast stream as a file.
`void` `setPublishedName(String name)`

Methods inherited from interface org.red5.server.api.stream.IStream
`close, getCodecInfo, getCreationTime, getName, getScope, start, stop`

Method Detail

### saveAs

    void saveAs(String filePath,
                boolean isAppend)
                throws IOException,
                       ResourceNotFoundException,
                       ResourceExistException

  Save the broadcast stream as a file.

  Parameters:
    `filePath` - The path of the file relative to the scope.
    `isAppend` - Whether to append to the end of file.
  Throws:
    `IOException` - File could not be created/written to.
    `ResourceExistException` - Resource exist when trying to create.
    `ResourceNotFoundException` - Resource not exist when trying to append.

### getSaveFilename

    String getSaveFilename()

  Get the filename the stream is being saved as.

  Returns:
    The filename relative to the scope or `null` if the stream is not being saved.

### getProvider

    IProvider getProvider()

  Get the provider corresponding to this stream. Provider objects are object that

  Returns:
    the provider

### getPublishedName

    String getPublishedName()

  Get stream publish name. Publish name is the value of the first parameter had been passed to `NetStream.publish` on client side in SWF.

  Returns:
    Stream publish name

### setPublishedName

    void setPublishedName(String name)

  Parameters:
    `name` - Set stream publish name

### addStreamListener

    void addStreamListener(IStreamListener listener)

  Add a listener to be notified about received packets.

  Parameters:
    `listener` - the listener to add

### removeStreamListener

    void removeStreamListener(IStreamListener listener)

  Remove a listener from being notified about received packets.

  Parameters:
    `listener` - the listener to remove

### getStreamListeners

    Collection<IStreamListener> getStreamListeners()

  Return registered stream listeners.

  Returns:
    the registered listeners

### getMetaData

    Notify getMetaData()

  Returns the metadata for the associated stream, if it exists.

  Returns:
    stream meta data

Copyright © 2006-2010 The Red5 Project