Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.red5.server.stream
Class StreamService

    java.lang.Object
      org.red5.server.stream.StreamService

All Implemented Interfaces:
  IScopeService, IStreamService

    public class StreamService

extends Object
implements IStreamService

Stream service

Field Summary

Fields inherited from interface org.red5.server.api.stream.IStreamService
`BEAN_NAME`

Constructor Summary
`StreamService()`

Method Summary
`void` | `closeStream()` Close the stream but not deallocate the resources.
`static void` | `closeStream(IConnection connection, int streamId)` Close stream.
`int` | `createStream()` Create a stream and return a corresponding id.
`void` | `deleteStream(int streamId)` Close the stream if not been closed.
`void` | `deleteStream(IStreamCapableConnection conn, int streamId)` Delete stream
`IBroadcastScope` | `getBroadcastScope(IScope scope, String name)` Return broadcast scope object for given scope and child scope name
`void` | `pause(Boolean pausePlayback, int position)` Pause at given position.
`void` | `pauseRaw(Boolean pausePlayback, int position)` Undocumented Flash Plugin 10 call, assuming to be the alias to pause(boolean, int)
`void` | `play(Boolean dontStop)` Play stream without initial stop
`void` | `play(String name)` Play stream with name
`void` | `play(String name, int start)` Play stream with name from start position
`void` | `play(String name, int start, int length)` Play stream with name from start position and for given amount if time
`void` | `play(String name, int start, int length, boolean flushPlaylist)` Publishes stream from given position for given amount of time
`void` | `play(String name, int start, int length, Object flushPlaylist)`
`void` | `publish(Boolean dontStop)` Publish
`void` | `publish(String name)` Publishes stream with given name
`void` | `publish(String name, String mode)` Publishes stream with given name and mode
`void` | `receiveAudio(boolean receive)` Can recieve audio?
`void` | `receiveVideo(boolean receive)` Can recieve video?
`void` | `releaseStream(String streamName)` Called by FME.
`void` | `seek(int position)` Seek to position
`static void` | `sendNetStreamStatus(IConnection conn, String statusCode, String description, String name, String status, int streamId)` Send `NetStream.Status` to client (Flash Player)

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StreamService

    public StreamService()

Method Detail

### closeStream

    public void closeStream()

  Close the stream but not deallocate the resources.

  Specified by:
    `closeStream` in interface `IStreamService`

### closeStream

    public static void closeStream(IConnection connection,
                                   int streamId)

  Close stream. This method can close both IClientBroadcastStream (coming from Flash Player to Red5) and ISubscriberStream (from Red5 to Flash Player). Corresponding application handlers (streamSubscriberClose, etc.) are called as if close was initiated by Flash Player. It is recommended to remember stream id in application handlers, ex.:

       public void streamBroadcastStart(IBroadcastStream stream) {
              super.streamBroadcastStart(stream);
              if (stream instanceof IClientBroadcastStream) {
                      int publishedStreamId = ((ClientBroadcastStream)stream).getStreamId();
                      Red5.getConnectionLocal().setAttribute(PUBLISHED_STREAM_ID_ATTRIBUTE, publishedStreamId);
              }
       }

       public void streamPlaylistItemPlay(IPlaylistSubscriberStream stream, IPlayItem item, boolean isLive) {
              super.streamPlaylistItemPlay(stream, item, isLive);
              Red5.getConnectionLocal().setAttribute(WATCHED_STREAM_ID_ATTRIBUTE, stream.getStreamId());
       }

  When stream is closed, corresponding NetStream status will be sent to stream provider / consumers. Implementation is based on Red5's StreamService.close()

  Parameters:
    `connection` - client connection
    `streamId` - stream ID (number: 1,2,...)

### createStream

    public int createStream()

  Create a stream and return a corresponding id.

  Specified by:
    `createStream` in interface `IStreamService`
  Returns:
    ID of created stream

### deleteStream

    public void deleteStream(int streamId)

  Close the stream if not been closed. Deallocate the related resources.

  Specified by:
    `deleteStream` in interface `IStreamService`
  Parameters:
    `streamId` - Stram id

### deleteStream

    public void deleteStream(IStreamCapableConnection conn,
                             int streamId)

  Delete stream

  Specified by:
    `deleteStream` in interface `IStreamService`
  Parameters:
    `conn` - Stream capable connection
    `streamId` - Stream id

### releaseStream

    public void releaseStream(String streamName)

  Called by FME.

  Specified by:
    `releaseStream` in interface `IStreamService`
  Parameters:
    `streamName` - stream name

### pauseRaw

    public void pauseRaw(Boolean pausePlayback,
                         int position)

  Undocumented Flash Plugin 10 call, assuming to be the alias to pause(boolean, int)

  Specified by:
    `pauseRaw` in interface `IStreamService`
  Parameters:
    `pausePlayback` - Pause flah
    `position` - Pause position

### pause

    public void pause(Boolean pausePlayback,
                      int position)

  Pause at given position. Required as "pausePlayback" can be "null" if no flag is passed by the client

  Specified by:
    `pause` in interface `IStreamService`
  Parameters:
    `pausePlayback` - Pause playback or not
    `position` - Pause position

### play

    public void play(String name,
                     int start,
                     int length,
                     Object flushPlaylist)

### play

    public void play(String name,
                     int start,
                     int length,
                     boolean flushPlaylist)

  Publishes stream from given position for given amount of time

  Specified by:
    `play` in interface `IStreamService`
  Parameters:
    `name` - Stream published name
    `start` - Start position
    `length` - Playback length
    `flushPlaylist` - Flush playlist?

### play

    public void play(String name,
                     int start,
                     int length)

  Play stream with name from start position and for given amount if time

  Specified by:
    `play` in interface `IStreamService`
  Parameters:
    `name` - Stream name
    `start` - Start position
    `length` - Playback length

### play

    public void play(String name,
                     int start)

  Play stream with name from start position

  Specified by:
    `play` in interface `IStreamService`
  Parameters:
    `name` - Stream name
    `start` - Start position

### play

    public void play(String name)

  Play stream with name

  Specified by:
    `play` in interface `IStreamService`
  Parameters:
    `name` - Stream name

### play

    public void play(Boolean dontStop)

  Play stream without initial stop

  Specified by:
    `play` in interface `IStreamService`
  Parameters:
    `dontStop` - Stoppage flag

### publish

    public void publish(Boolean dontStop)

  Publish

  Specified by:
    `publish` in interface `IStreamService`
  Parameters:
    `dontStop` - Whether need to stop first

### publish

    public void publish(String name,
                        String mode)

  Publishes stream with given name and mode

  Specified by:
    `publish` in interface `IStreamService`
  Parameters:
    `name` - Stream published name
    `mode` - Stream publishing mode

### publish

    public void publish(String name)

  Publishes stream with given name

  Specified by:
    `publish` in interface `IStreamService`
  Parameters:
    `name` - Stream published name

### seek

    public void seek(int position)

  Seek to position

  Specified by:
    `seek` in interface `IStreamService`
  Parameters:
    `position` - Seek position

### receiveVideo

    public void receiveVideo(boolean receive)

  Can recieve video?

  Specified by:
    `receiveVideo` in interface `IStreamService`
  Parameters:
    `receive` - Boolean flag

### receiveAudio

    public void receiveAudio(boolean receive)

  Can recieve audio?

  Specified by:
    `receiveAudio` in interface `IStreamService`
  Parameters:
    `receive` - Boolean flag

### getBroadcastScope

    public IBroadcastScope getBroadcastScope(IScope scope,
                                             String name)

  Return broadcast scope object for given scope and child scope name

  Parameters:
    `scope` - Scope object
    `name` - Child scope name
  Returns:
    Broadcast scope

### sendNetStreamStatus

    public static void sendNetStreamStatus(IConnection conn,
                                           String statusCode,
                                           String description,
                                           String name,
                                           String status,
                                           int streamId)

  Send `NetStream.Status` to client (Flash Player)

  Parameters:
    `conn` - connection
    `statusCode` - NetStream status code
    `description` - description
    `name` - name
    `status` - The status - error, warning, or status
    `streamId` - stream id

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006-2010 The Red5 Project