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

All Superinterfaces:
  IStream

    public interface IOnDemandStream

extends IStream

Extends stream to add methods for on demand access.

Author:
  The Red5 Project (red5@osflash.org), Luke Hubbard (luke@codegent.com)

Method Summary
`boolean` `isPaused()` Is the stream paused
`boolean` `isPlaying()` Is the stream playing
`boolean` `isStopped()` Is the stream stopped
`void` `pause()` Pause the stream
`void` `play()` Start playback
`void` `play(int length)` Start playback with a given maximum duration.
`void` `resume()` Resume a paused stream
`void` `seek(int position)` Seek to the keyframe nearest to position
`void` `stop()` Stop the stream, this resets the position to the start

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

Method Detail

### play

    void play()

  Start playback

### play

    void play(int length)

  Start playback with a given maximum duration.

  Parameters:
    `length` - maximum duration in milliseconds

### seek

    void seek(int position)

  Seek to the keyframe nearest to position

  Parameters:
    `position` - position in milliseconds

### pause

    void pause()

  Pause the stream

### resume

    void resume()

  Resume a paused stream

### stop

    void stop()

  Stop the stream, this resets the position to the start

  Specified by:
    `stop` in interface `IStream`

### isPaused

    boolean isPaused()

  Is the stream paused

  Returns:
    true if the stream is paused

### isStopped

    boolean isStopped()

  Is the stream stopped

  Returns:
    true if the stream is stopped

### isPlaying

    boolean isPlaying()

  Is the stream playing

  Returns:
    true if the stream is playing

Copyright © 2006-2010 The Red5 Project