public class SingleItemSubscriberStream extends AbstractClientStream implements ISingleItemSubscriberStream
Modifier and Type | Class and Description |
---|---|
class |
SingleItemSubscriberStream.Notifier
Handles notifications in a separate thread.
|
Modifier and Type | Field and Description |
---|---|
protected int |
bufferCheckInterval
Interval in ms to check for buffer underruns in VOD streams.
|
protected long |
creationTime
Timestamp this stream was created.
|
protected PlayEngine |
engine
Plays items back
|
protected Set<String> |
jobs
Scheduled job names
|
protected ISchedulingService |
schedulingService
Service used to provide notifications, keep client buffer filled, clean up, etc...
|
protected int |
underrunTrigger
Number of pending messages at which a
|
startTime, state
MODE_APPEND, MODE_LIVE, MODE_PUBLISH, MODE_READ, MODE_RECORD
Constructor and Description |
---|
SingleItemSubscriberStream() |
Modifier and Type | Method and Description |
---|---|
void |
cancelJob(String jobName)
Cancels a scheduled job by name.
|
void |
close()
Close this stream.
|
boolean |
isPaused()
Check if the stream is currently paused.
|
void |
onChange(StreamState state,
Object... changed)
Notification of state change and associated parameters.
|
void |
pause(int position)
Pause at a position for current playing item.
|
void |
play()
Start playing.
|
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 |
resume(int position)
Resume from a position for current playing item.
|
String |
scheduleOnceJob(IScheduledJob job)
Schedule a job to be executed only once after a 10ms delay.
|
String |
scheduleWithFixedDelay(IScheduledJob job,
int interval)
Schedule a job to be executed regularly at the given interval.
|
void |
seek(int position)
Seek into a position for current playing item.
|
void |
setBufferCheckInterval(int bufferCheckInterval)
Set interval to check for buffer underruns.
|
void |
setPlayItem(IPlayItem item)
Setter for property 'playItem'.
|
void |
setUnderrunTrigger(int underrunTrigger)
Set maximum number of pending messages at which a
|
void |
start()
Start this stream.
|
void |
stop()
Stop playing.
|
getBroadcastStreamPublishName, getClientBufferDuration, getConnection, getStreamId, setBroadcastStreamPublishName, setClientBufferDuration, setConnection, setStreamId
addStateChangeListener, fireStateChange, getCodecInfo, getCreationTime, getMetaData, getName, getScope, getStartTime, getState, getStreamAwareHandler, removeStateChangeListener, setCodecInfo, setMetaData, setName, setScope, setState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getState, setState
getBroadcastStreamPublishName, getClientBufferDuration, getConnection, getStreamId, setBroadcastStreamPublishName, setClientBufferDuration
getCodecInfo, getCreationTime, getName, getScope, getStartTime
protected ISchedulingService schedulingService
protected int bufferCheckInterval
protected int underrunTrigger
NetStream.Play.InsufficientBWmessage is generated for VOD streams.
protected long creationTime
protected PlayEngine engine
public void setPlayItem(IPlayItem item)
ISingleItemSubscriberStream
setPlayItem
in interface ISingleItemSubscriberStream
item
- Value to set for property 'playItem'.public void play() throws IOException
ISubscriberStream
play
in interface ISubscriberStream
IOException
- if an IO error occurred while starting to play the streampublic void pause(int position)
pause
in interface ISubscriberStream
position
- Position for pause in millisecond.public void resume(int position)
resume
in interface ISubscriberStream
position
- Position for resume in millisecond.public void stop()
stop
in interface IStream
stop
in interface ISubscriberStream
public void seek(int position) throws OperationNotSupportedException
seek
in interface ISubscriberStream
position
- Position for seek in millisecond.OperationNotSupportedException
- if the stream doesn't support seeking.public boolean isPaused()
ISubscriberStream
isPaused
in interface ISubscriberStream
public void receiveVideo(boolean receive)
receiveVideo
in interface ISubscriberStream
receive
- togglepublic void receiveAudio(boolean receive)
receiveAudio
in interface ISubscriberStream
receive
- togglepublic void setBufferCheckInterval(int bufferCheckInterval)
0to disable.
bufferCheckInterval
- interval in mspublic void setUnderrunTrigger(int underrunTrigger)
NetStream.Play.InsufficientBWmessage will be generated for VOD streams
underrunTrigger
- the maximum number of pending messagespublic void start()
IStream
public void close()
IStream
public void onChange(StreamState state, Object... changed)
onChange
in interface ISubscriberStream
state
- new statechanged
- parameters associated with the changepublic String scheduleOnceJob(IScheduledJob job)
scheduleOnceJob
in interface ISubscriberStream
job
- scheduled jobpublic String scheduleWithFixedDelay(IScheduledJob job, int interval)
scheduleWithFixedDelay
in interface ISubscriberStream
job
- scheduled jobinterval
- intervalpublic void cancelJob(String jobName)
cancelJob
in interface ISubscriberStream
jobName
- job nameCopyright © 2005–2019 Red5. All rights reserved.