Interface PlayerEndpoint
-
- All Superinterfaces:
Endpoint
,KurentoObject
,MediaElement
,MediaObject
,UriEndpoint
public interface PlayerEndpoint extends UriEndpoint
Retrieves content from external sources.PlayerEndpoint will access the given resource, read all available data, and inject it into Kurento. Once this is is done, the injected video or audio will be available for passing through any other Filter or Endpoint to which the PlayerEndpoint gets connected.
The source can provide either seekable or non-seekable media; this will dictate whether the PlayerEndpoint is able (or not) to seek through the file, for example to jump to any given timestamp.
The Source URI supports these formats:
-
File: A file path that will be read from the local file system. Example:
file:///path/to/file
-
HTTP: Any file available in an HTTP server. Examples:
http(s)://host/path/to/file
-
http(s)://username:password@host:port/path/to/file
-
RTSP: Typically used to capture a feed from an IP Camera. Examples:
rtsp://host
-
rtsp://username:password@host:port/path/to/file?key=value&key=value
-
NOTE: Special characters must be
URL-encoded
in
username
andpassword
fields.
Note that PlayerEndpoint requires read permissions to the source ; otherwise, the media server won't be able to retrieve any data, and an
ErrorEvent
will be fired. Make sure your application subscribes to this event, otherwise troubleshooting issues will be difficult.The list of valid operations is:
-
play
: Starts streaming media. If invoked after pause, it will resume playback. -
stop
: Stops streaming media. If play is invoked afterwards, the file will be streamed from the beginning. -
pause
: Pauses media streaming. Play must be invoked in order to resume playback. -
seek
: If the source supports seeking to a different time position, then the PlayerEndpoint can:-
setPosition
: Allows to set the position in the file. -
getPosition
: Returns the current position being streamed.
-
Events fired
- EndOfStreamEvent: If the file is streamed completely.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PlayerEndpoint.Builder
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ListenerSubscription
addEndOfStreamListener(EventListener<EndOfStreamEvent> listener)
Add aEventListener
for eventEndOfStreamEvent
.void
addEndOfStreamListener(EventListener<EndOfStreamEvent> listener, Continuation<ListenerSubscription> cont)
Add aEventListener
for eventEndOfStreamEvent
.String
getElementGstreamerDot()
Get Returns the GStreamer DOT string for this element's private pipelinevoid
getElementGstreamerDot(Continuation<String> cont)
Get Returns the GStreamer DOT string for this element's private pipelineTFuture<String>
getElementGstreamerDot(Transaction tx)
Get Returns the GStreamer DOT string for this element's private pipelinelong
getPosition()
Get Get or set the actual position of the video in ms.void
getPosition(Continuation<Long> cont)
Get Get or set the actual position of the video in ms.TFuture<Long>
getPosition(Transaction tx)
Get Get or set the actual position of the video in ms.VideoInfo
getVideoInfo()
Get Returns info about the source being playedvoid
getVideoInfo(Continuation<VideoInfo> cont)
Get Returns info about the source being playedTFuture<VideoInfo>
getVideoInfo(Transaction tx)
Get Returns info about the source being playedvoid
play()
Starts reproducing the media, sending it to the :rom:cls:`MediaSource`.void
play(Continuation<Void> cont)
Asynchronous version of play:Continuation.onSuccess(F)
is called when the action is done.void
play(Transaction tx)
Starts reproducing the media, sending it to the :rom:cls:`MediaSource`.void
removeEndOfStreamListener(ListenerSubscription listenerSubscription)
Remove aListenerSubscription
for eventEndOfStreamEvent
.void
removeEndOfStreamListener(ListenerSubscription listenerSubscription, Continuation<Void> cont)
Remove aListenerSubscription
for eventEndOfStreamEvent
.void
setPosition(long position)
Set Get or set the actual position of the video in ms.void
setPosition(long position, Continuation<Void> cont)
Set Get or set the actual position of the video in ms.void
setPosition(long position, Transaction tx)
Set Get or set the actual position of the video in ms.-
Methods inherited from interface org.kurento.client.KurentoObject
addEventListener, invoke, isCommited, release, release, release, removeEventListener, waitCommited, whenCommited, whenCommited
-
Methods inherited from interface org.kurento.client.MediaElement
addElementConnectedListener, addElementConnectedListener, addElementDisconnectedListener, addElementDisconnectedListener, addMediaFlowInStateChangedListener, addMediaFlowInStateChangedListener, addMediaFlowOutStateChangedListener, addMediaFlowOutStateChangedListener, addMediaTranscodingStateChangedListener, addMediaTranscodingStateChangedListener, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, getEncoderBitrate, getEncoderBitrate, getEncoderBitrate, getGstreamerDot, getGstreamerDot, getGstreamerDot, getGstreamerDot, getGstreamerDot, getGstreamerDot, getMaxEncoderBitrate, getMaxEncoderBitrate, getMaxEncoderBitrate, getMinEncoderBitrate, getMinEncoderBitrate, getMinEncoderBitrate, getSinkConnections, getSinkConnections, getSinkConnections, getSinkConnections, getSinkConnections, getSinkConnections, getSinkConnections, getSinkConnections, getSinkConnections, getSourceConnections, getSourceConnections, getSourceConnections, getSourceConnections, getSourceConnections, getSourceConnections, getSourceConnections, getSourceConnections, getSourceConnections, getStats, getStats, getStats, getStats, getStats, getStats, isMediaFlowingIn, isMediaFlowingIn, isMediaFlowingIn, isMediaFlowingIn, isMediaFlowingIn, isMediaFlowingIn, isMediaFlowingOut, isMediaFlowingOut, isMediaFlowingOut, isMediaFlowingOut, isMediaFlowingOut, isMediaFlowingOut, isMediaTranscoding, isMediaTranscoding, isMediaTranscoding, isMediaTranscoding, isMediaTranscoding, isMediaTranscoding, removeElementConnectedListener, removeElementConnectedListener, removeElementDisconnectedListener, removeElementDisconnectedListener, removeMediaFlowInStateChangedListener, removeMediaFlowInStateChangedListener, removeMediaFlowOutStateChangedListener, removeMediaFlowOutStateChangedListener, removeMediaTranscodingStateChangedListener, removeMediaTranscodingStateChangedListener, setAudioFormat, setAudioFormat, setAudioFormat, setEncoderBitrate, setEncoderBitrate, setEncoderBitrate, setMaxEncoderBitrate, setMaxEncoderBitrate, setMaxEncoderBitrate, setMinEncoderBitrate, setMinEncoderBitrate, setMinEncoderBitrate, setVideoFormat, setVideoFormat, setVideoFormat
-
Methods inherited from interface org.kurento.client.MediaObject
addErrorListener, addErrorListener, addTag, addTag, addTag, getChildren, getChildren, getChildren, getCreationTime, getCreationTime, getCreationTime, getId, getId, getId, getMediaPipeline, getMediaPipeline, getMediaPipeline, getName, getName, getName, getParent, getParent, getParent, getSendTagsInEvents, getSendTagsInEvents, getSendTagsInEvents, getTag, getTag, getTag, getTags, getTags, getTags, removeErrorListener, removeErrorListener, removeTag, removeTag, removeTag, setName, setName, setName, setSendTagsInEvents, setSendTagsInEvents, setSendTagsInEvents
-
Methods inherited from interface org.kurento.client.UriEndpoint
addUriEndpointStateChangedListener, addUriEndpointStateChangedListener, getState, getState, getState, getUri, getUri, getUri, pause, pause, pause, removeUriEndpointStateChangedListener, removeUriEndpointStateChangedListener, stop, stop, stop
-
-
-
-
Method Detail
-
getVideoInfo
VideoInfo getVideoInfo()
Get Returns info about the source being played
-
getVideoInfo
void getVideoInfo(Continuation<VideoInfo> cont)
Get Returns info about the source being played
-
getVideoInfo
TFuture<VideoInfo> getVideoInfo(Transaction tx)
Get Returns info about the source being played
-
getElementGstreamerDot
String getElementGstreamerDot()
Get Returns the GStreamer DOT string for this element's private pipeline
-
getElementGstreamerDot
void getElementGstreamerDot(Continuation<String> cont)
Get Returns the GStreamer DOT string for this element's private pipeline
-
getElementGstreamerDot
TFuture<String> getElementGstreamerDot(Transaction tx)
Get Returns the GStreamer DOT string for this element's private pipeline
-
getPosition
long getPosition()
Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos
-
getPosition
void getPosition(Continuation<Long> cont)
Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos
-
getPosition
TFuture<Long> getPosition(Transaction tx)
Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos
-
setPosition
void setPosition(long position)
Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos
-
setPosition
void setPosition(long position, Continuation<Void> cont)
Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos
-
setPosition
void setPosition(long position, Transaction tx)
Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos
-
play
void play()
Starts reproducing the media, sending it to the :rom:cls:`MediaSource`. If the endpoint has been connected to other endpoints, those will start receiving media.
-
play
void play(Continuation<Void> cont)
Asynchronous version of play:Continuation.onSuccess(F)
is called when the action is done. If an error occurs,Continuation.onError(java.lang.Throwable)
is called.- See Also:
play()
-
play
void play(Transaction tx)
Starts reproducing the media, sending it to the :rom:cls:`MediaSource`. If the endpoint has been connected to other endpoints, those will start receiving media.
-
addEndOfStreamListener
ListenerSubscription addEndOfStreamListener(EventListener<EndOfStreamEvent> listener)
Add aEventListener
for eventEndOfStreamEvent
. Synchronous call.- Parameters:
listener
- Listener to be called on EndOfStreamEvent- Returns:
- ListenerSubscription for the given Listener
-
addEndOfStreamListener
void addEndOfStreamListener(EventListener<EndOfStreamEvent> listener, Continuation<ListenerSubscription> cont)
Add aEventListener
for eventEndOfStreamEvent
. Asynchronous call. Calls Continuation<ListenerSubscription> when it has been added.- Parameters:
listener
- Listener to be called on EndOfStreamEventcont
- Continuation to be called when the listener is registered
-
removeEndOfStreamListener
void removeEndOfStreamListener(ListenerSubscription listenerSubscription)
Remove aListenerSubscription
for eventEndOfStreamEvent
. Synchronous call.- Parameters:
listenerSubscription
- Listener subscription to be removed
-
removeEndOfStreamListener
void removeEndOfStreamListener(ListenerSubscription listenerSubscription, Continuation<Void> cont)
Remove aListenerSubscription
for eventEndOfStreamEvent
. Asynchronous call. Calls Continuation<Void> when it has been removed.- Parameters:
listenerSubscription
- Listener subscription to be removedcont
- Continuation to be called when the listener is removed
-
-