|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.stream.AbstractStream
org.red5.server.stream.AbstractClientStream
org.red5.server.stream.PlaylistSubscriberStream
public class PlaylistSubscriberStream
Stream of playlist subsciber
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.red5.server.stream.AbstractStream |
|---|
AbstractStream.State |
| Field Summary |
|---|
| Fields inherited from class org.red5.server.stream.AbstractStream |
|---|
state |
| Fields inherited from interface org.red5.server.api.stream.IClientStream |
|---|
MODE_APPEND, MODE_LIVE, MODE_PUBLISH, MODE_READ, MODE_RECORD |
| Constructor Summary | |
|---|---|
PlaylistSubscriberStream()
Constructs a new PlaylistSubscriberStream. |
|
| Method Summary | |
|---|---|
void |
addItem(IPlayItem item)
Add an item to the list. |
void |
addItem(IPlayItem item,
int index)
Add an item to specific index. |
void |
close()
Close this stream. |
long |
getBytesSent()
Return total number of bytes sent to the client from this stream. |
long |
getCreationTime()
Returns timestamp at which the stream was created. |
IPlayItem |
getCurrentItem()
Get currently playing item |
int |
getCurrentItemIndex()
Get currently playing item index. |
int |
getCurrentTimestamp()
Return the currently active timestamp inside the stream. |
double |
getEstimatedBufferFill()
Return estimated fill ratio of the client buffer. |
ScheduledThreadPoolExecutor |
getExecutor()
Return the executor to use. |
IPlayItem |
getItem(int index)
Get the item according to the index. |
int |
getItemSize()
Return number of items in list |
IPlaylistSubscriberStreamStatistics |
getStatistics()
Return statistics about this stream. |
boolean |
hasMoreItems()
Check if the playlist has more items after the currently playing one. |
boolean |
isPaused()
Check if the stream is currently paused. |
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. |
protected void |
notifyItemPause(IPlayItem item,
int position)
Notifies subscribers on pause |
protected void |
notifyItemPlay(IPlayItem item,
boolean isLive)
Notifies subscribers on item playback |
protected void |
notifyItemResume(IPlayItem item,
int position)
Notifies subscribers on resume |
protected void |
notifyItemSeek(IPlayItem item,
int position)
Notify on item seek |
protected void |
notifyItemStop(IPlayItem item)
Notifies subscribers on item stop |
protected void |
notifySubscriberClose()
Notifies subscribers on stop |
protected void |
notifySubscriberStart()
Notifies subscribers on start |
protected void |
onItemEnd()
Notified by the play engine when the current item reaches the end. |
void |
pause(int position)
Pause at a position for current playing item. |
void |
play()
Start playing. |
void |
previousItem()
Go for the previous played item. |
void |
receiveAudio(boolean receive)
Should the stream send audio to the client? |
void |
receiveVideo(boolean receive)
Should the stream send video to the client? |
void |
removeAllItems()
Remove all items. |
void |
removeItem(int index)
Remove an item from list. |
void |
resume(int position)
Resume from a position for current playing item. |
void |
seek(int position)
Seek into a position for current playing item. |
void |
setBandwidthConfigure(IBandwidthConfigure config)
Setter for bandwidth config |
void |
setBandwidthController(IBWControlService bwController)
|
void |
setBufferCheckInterval(int bufferCheckInterval)
Set interval to check for buffer underruns. |
void |
setExecutor(ScheduledThreadPoolExecutor executor)
Set the executor to use. |
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. |
void |
setUnderrunTrigger(int underrunTrigger)
Set maximum number of pending messages at which a NetStream.Play.InsufficientBW message will be
generated for VOD streams |
void |
start()
Start this stream. |
void |
stop()
Stop playing. |
void |
written(Object message)
Notified by RTMPHandler when a message has been sent. |
| Methods inherited from class org.red5.server.stream.AbstractClientStream |
|---|
getBandwidthConfigure, getClientBufferDuration, getConnection, getParentBWControllable, getStreamId, setClientBufferDuration, setConnection, setStreamId |
| Methods inherited from class org.red5.server.stream.AbstractStream |
|---|
getCodecInfo, getName, getScope, getStreamAwareHandler, setCodecInfo, setName, setScope |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.red5.server.api.stream.IClientStream |
|---|
getConnection, getStreamId, setClientBufferDuration |
| Methods inherited from interface org.red5.server.api.stream.IStream |
|---|
getCodecInfo, getName, getScope |
| Methods inherited from interface org.red5.server.api.IBWControllable |
|---|
getBandwidthConfigure, getParentBWControllable |
| Methods inherited from interface org.red5.server.api.statistics.IPlaylistSubscriberStreamStatistics |
|---|
getClientBufferDuration |
| Constructor Detail |
|---|
public PlaylistSubscriberStream()
| Method Detail |
|---|
public void setExecutor(ScheduledThreadPoolExecutor executor)
executor - the executorpublic ScheduledThreadPoolExecutor getExecutor()
public void setBufferCheckInterval(int bufferCheckInterval)
0 to
disable.
bufferCheckInterval - interval in mspublic void setUnderrunTrigger(int underrunTrigger)
NetStream.Play.InsufficientBW message will be
generated for VOD streams
underrunTrigger - the maximum number of pending messagespublic void start()
start in interface IStream
public void play()
throws IOException
play in interface ISubscriberStreamIOException - if an IO error occurred while starting to play the streampublic void pause(int position)
pause in interface ISubscriberStreamposition - Position for pause in millisecond.public void resume(int position)
resume in interface ISubscriberStreamposition - Position for resume in millisecond.public void stop()
stop in interface IStreamstop in interface ISubscriberStream
public void seek(int position)
throws OperationNotSupportedException
seek in interface ISubscriberStreamposition - Position for seek in millisecond.
OperationNotSupportedException - if the stream doesn't support seeking.public void close()
close in interface IStreampublic boolean isPaused()
isPaused in interface ISubscriberStreampublic void addItem(IPlayItem item)
addItem in interface IPlaylistitem - Playlist item
public void addItem(IPlayItem item,
int index)
addItem in interface IPlaylistitem - Playlist itemindex - Index in listpublic void removeItem(int index)
removeItem in interface IPlaylistindex - Index in listpublic void removeAllItems()
removeAllItems in interface IPlaylistpublic void previousItem()
previousItem in interface IPlaylistpublic boolean hasMoreItems()
hasMoreItems in interface IPlaylisttrue if more items are available, false otherwisepublic void nextItem()
nextItem in interface IPlaylistpublic void setItem(int index)
setItem in interface IPlaylistindex - Position in listpublic boolean isRandom()
isRandom in interface IPlaylisttrue if shuffle is on for this list, false otherwisepublic void setRandom(boolean random)
setRandom in interface IPlaylistrandom - Shuffle flagpublic boolean isRewind()
isRewind in interface IPlaylisttrue if playlist is rewind on end, false otherwisepublic void setRewind(boolean rewind)
setRewind in interface IPlaylistrewind - New vallue for rewind flagpublic boolean isRepeat()
isRepeat in interface IPlaylisttrue if repeat mode is on for this playlist, false otherwisepublic void setRepeat(boolean repeat)
setRepeat in interface IPlaylistrepeat - New value for item playback repeat flagpublic void receiveVideo(boolean receive)
receiveVideo in interface ISubscriberStreampublic void receiveAudio(boolean receive)
receiveAudio in interface ISubscriberStreampublic void setPlaylistController(IPlaylistController controller)
setPlaylistController in interface IPlaylistcontroller - Playlist controllerpublic int getItemSize()
getItemSize in interface IPlaylistpublic int getCurrentItemIndex()
getCurrentItemIndex in interface IPlaylistpublic IPlayItem getCurrentItem()
getCurrentItem in interface IPlaylistpublic IPlayItem getItem(int index)
getItem in interface IPlaylistindex - Item index
public void setBandwidthController(IBWControlService bwController)
public void setBandwidthConfigure(IBandwidthConfigure config)
setBandwidthConfigure in interface IBWControllablesetBandwidthConfigure in class AbstractClientStreamconfig - Bandwidth configpublic void written(Object message)
message - Message that has been writtenprotected void onItemEnd()
protected void notifySubscriberStart()
protected void notifySubscriberClose()
protected void notifyItemPlay(IPlayItem item,
boolean isLive)
item - Item being playedisLive - Is it a live broadcasting?protected void notifyItemStop(IPlayItem item)
item - Item that just has been stopped
protected void notifyItemPause(IPlayItem item,
int position)
item - Item that just has been pausedposition - Playback head position
protected void notifyItemResume(IPlayItem item,
int position)
item - Item that just has been resumedposition - Playback head position
protected void notifyItemSeek(IPlayItem item,
int position)
item - Playlist itemposition - Seek positionpublic IPlaylistSubscriberStreamStatistics getStatistics()
getStatistics in interface IPlaylistSubscriberStreampublic long getCreationTime()
getCreationTime in interface IStatisticsBasegetCreationTime in interface IStreamgetCreationTime in class AbstractStreampublic int getCurrentTimestamp()
getCurrentTimestamp in interface IStreamStatisticspublic long getBytesSent()
getBytesSent in interface IPlaylistSubscriberStreamStatisticspublic double getEstimatedBufferFill()
getEstimatedBufferFill in interface IPlaylistSubscriberStreamStatistics
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||