Package org.red5.server.api.stream
Interface IBroadcastStream
- All Superinterfaces:
IStream
- All Known Subinterfaces:
IClientBroadcastStream
,IServerStream
- All Known Implementing Classes:
ClientBroadcastStream
,ServerStream
A broadcast stream is a stream source to be subscribed to by clients. To subscribe to a stream from your client Flash application use NetStream.play method. Broadcast stream can be saved at the server-side.
- Author:
- The Red5 Project, Luke Hubbard (luke@codegent.com), Steven Gong (steven.gong@gmail.com)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addStreamListener
(IStreamListener listener) Add a listener to be notified about received packets.Returns the metadata for the associated stream, if it exists.Get the provider corresponding to this stream.Get stream publish name.Get the filename the stream is being saved as.Return registered stream listeners.void
removeStreamListener
(IStreamListener listener) Remove a listener from being notified about received packets.void
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 Details
-
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 toNetStream.publish
on client side in SWF.- Returns:
- Stream publish name
-
setPublishedName
- Parameters:
name
- Set stream publish name
-
addStreamListener
Add a listener to be notified about received packets.- Parameters:
listener
- the listener to add
-
removeStreamListener
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
-