org.red5.server.api.stream

## Interface IPlaylist

All Known Subinterfaces:
  IPlaylistSubscriberStream, IServerStream

All Known Implementing Classes:
  PlaylistSubscriberStream, ServerStream

    public interface IPlaylist

Playlist

### Method Summary

Methods
`void` `addItem(IPlayItem item)` Add an item to the list.
`void` `addItem(IPlayItem item, int index)` Add an item to specific index.
`IPlayItem` `getCurrentItem()` Get currently playing item
`int` `getCurrentItemIndex()` Get currently playing item index.
`IPlayItem` `getItem(int index)` Get the item according to the index.
`int` `getItemSize()` Return number of items in list
`boolean` `hasMoreItems()` Check if the playlist has more items after the currently playing one.
`boolean` `isRandom()` Whether items are randomly played.
`boolean` `isRepeat()` Whether repeat playing an item.
`boolean` `isRewind()` Whether rewind the list.
`void` `nextItem()` Go for next item decided by controller logic.
`void` `previousItem()` Go for the previous played item.
`void` `removeAllItems()` Remove all items.
`void` `removeItem(int index)` Remove an item from list.
`void` `setItem(int index)` Set the current item for playing.
`void` `setPlaylistController(IPlaylistController controller)` Set list controller.
`void` `setRandom(boolean random)` Set whether items should be randomly played.
`void` `setRepeat(boolean repeat)` Set whether repeat playing an item.
`void` `setRewind(boolean rewind)` Set whether rewind the list.

### Method Detail

#### addItem

    void addItem(IPlayItem item)

Add an item to the list.

Parameters:
  `item` - Playlist item

#### addItem

    void addItem(IPlayItem item,
               int index)

Add an item to specific index.

Parameters:
  `item` - Playlist item
  `index` - Index in list

#### removeItem

    void removeItem(int index)

Remove an item from list.

Parameters:
  `index` - Index in list

#### removeAllItems

    void removeAllItems()

Remove all items.

#### getItemSize

    int getItemSize()

Return number of items in list

Returns:
  Number of items in list

#### getCurrentItemIndex

    int getCurrentItemIndex()

Get currently playing item index.

Returns:
  Currently playing item index.

#### getCurrentItem

    IPlayItem getCurrentItem()

Get currently playing item

Returns:
  Item

#### getItem

    IPlayItem getItem(int index)

Get the item according to the index.

Parameters:
  `index` - Item index
Returns:
  Item at that index in list

#### hasMoreItems

    boolean hasMoreItems()

Check if the playlist has more items after the currently playing one.

Returns:
  `true` if more items are available, `false` otherwise

#### previousItem

    void previousItem()

Go for the previous played item.

#### nextItem

    void nextItem()

Go for next item decided by controller logic.

#### setItem

    void setItem(int index)

Set the current item for playing.

Parameters:
  `index` - Position in list

#### isRandom

    boolean isRandom()

Whether items are randomly played.

Returns:
  `true` if shuffle is on for this list, `false` otherwise

#### setRandom

    void setRandom(boolean random)

Set whether items should be randomly played.

Parameters:
  `random` - Shuffle flag

#### isRewind

    boolean isRewind()

Whether rewind the list.

Returns:
  `true` if playlist is rewind on end, `false` otherwise

#### setRewind

    void setRewind(boolean rewind)

Set whether rewind the list.

Parameters:
  `rewind` - New vallue for rewind flag

#### isRepeat

    boolean isRepeat()

Whether repeat playing an item.

Returns:
  `true` if repeat mode is on for this playlist, `false` otherwise

#### setRepeat

    void setRepeat(boolean repeat)

Set whether repeat playing an item.

Parameters:
  `repeat` - New value for item playback repeat flag

#### setPlaylistController

    void setPlaylistController(IPlaylistController controller)

Set list controller.

Parameters:
  `controller` - Playlist controller