public final class PlayEngine extends Object implements IFilter, IPushableConsumer, IPipeConnectionListener
Modifier and Type | Class and Description |
---|---|
static class |
PlayEngine.Builder
Builder pattern
|
KEY
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkSendMessageEnabled(RTMPMessage message)
Check if sending the given message was enabled by the client.
|
void |
close()
Close stream
|
int |
getLastMessageTimestamp()
Returns the timestamp of the last message sent.
|
long |
getPlaybackStart() |
boolean |
isPaused() |
boolean |
isPullMode() |
void |
onOOBControlMessage(IMessageComponent source,
IPipe pipe,
OOBControlMessage oobCtrlMsg) |
void |
onPipeConnectionEvent(PipeConnectionEvent event)
Pipe connection event handler
|
void |
pause(int position)
Pause at position
|
void |
play(IPlayItem item)
Play stream
|
void |
play(IPlayItem item,
boolean withReset)
Play stream
|
void |
pushMessage(IPipe pipe,
IMessage message)
Pushes message through pipe
|
boolean |
receiveAudio()
Returns true if the engine currently receives audio.
|
boolean |
receiveAudio(boolean receive)
Returns true if the engine currently receives audio and
sets the new value.
|
boolean |
receiveVideo()
Returns true if the engine currently receives video.
|
boolean |
receiveVideo(boolean receive)
Returns true if the engine currently receives video and
sets the new value.
|
void |
resume(int position)
Resume playback
|
void |
seek(int position)
Seek to a given position
|
void |
sendBlankAudio(boolean sendBlankAudio) |
void |
setBufferCheckInterval(int bufferCheckInterval) |
void |
setMaxPendingVideoFrames(int maxPendingVideoFrames) |
void |
setMaxSequentialPendingVideoFrames(int maxSequentialPendingVideoFrames) |
void |
setUnderrunTrigger(int underrunTrigger) |
void |
start()
Start stream
|
void |
stop()
Stop playback
|
public void setBufferCheckInterval(int bufferCheckInterval)
public void setUnderrunTrigger(int underrunTrigger)
public void start()
public void play(IPlayItem item) throws StreamNotFoundException, IllegalStateException, IOException
item
- Playlist itemStreamNotFoundException
- Stream not foundIllegalStateException
- Stream is in stopped stateIOException
- Stream had io exceptionpublic void play(IPlayItem item, boolean withReset) throws StreamNotFoundException, IllegalStateException, IOException
item
- Playlist itemwithReset
- Send reset status before playing.StreamNotFoundException
- Stream not foundIllegalStateException
- Stream is in stopped stateIOException
- Stream had IO exceptionpublic void pause(int position) throws IllegalStateException
position
- Position in fileIllegalStateException
- If stream is stoppedpublic void resume(int position) throws IllegalStateException
position
- Resumes playbackIllegalStateException
- If stream is stoppedpublic void seek(int position) throws IllegalStateException, OperationNotSupportedException
position
- PositionIllegalStateException
- If stream is in stopped stateOperationNotSupportedException
- If this object doesn't support the operation.public void stop() throws IllegalStateException
IllegalStateException
- If stream is in stopped statepublic void close()
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg)
onOOBControlMessage
in interface IMessageComponent
source
- Message component sourcepipe
- Connection pipeoobCtrlMsg
- Out-of-band control messagepublic void onPipeConnectionEvent(PipeConnectionEvent event)
onPipeConnectionEvent
in interface IPipeConnectionListener
event
- Pipe connection eventpublic void pushMessage(IPipe pipe, IMessage message) throws IOException
pushMessage
in interface IPushableConsumer
pipe
- Pipemessage
- MessageIOException
- if message could not be writtenpublic boolean isPullMode()
public boolean isPaused()
public int getLastMessageTimestamp()
public long getPlaybackStart()
public void sendBlankAudio(boolean sendBlankAudio)
public boolean receiveAudio()
public boolean receiveAudio(boolean receive)
receive
- new valuepublic boolean receiveVideo()
public boolean receiveVideo(boolean receive)
receive
- new valueprotected boolean checkSendMessageEnabled(RTMPMessage message)
message
- the message to checktrue
if the message should be sent, false
otherwise (and the message is discarded)public void setMaxPendingVideoFrames(int maxPendingVideoFrames)
maxPendingVideoFrames
- the maxPendingVideoFrames to setpublic void setMaxSequentialPendingVideoFrames(int maxSequentialPendingVideoFrames)
maxSequentialPendingVideoFrames
- the maxSequentialPendingVideoFrames to setCopyright © 2006-2012 The Red5 Project