Interface PlayerEndpoint
- All Superinterfaces:
Endpoint
,KurentoObject
,MediaElement
,MediaObject
,UriEndpoint
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
-
Method Summary
Modifier and TypeMethodDescriptionaddEndOfStreamListener
(EventListener<EndOfStreamEvent> listener) Add aEventListener
for eventEndOfStreamEvent
.void
addEndOfStreamListener
(EventListener<EndOfStreamEvent> listener, Continuation<ListenerSubscription> cont) Add aEventListener
for eventEndOfStreamEvent
.Get Returns the GStreamer DOT string for this element's private pipelinevoid
Get Returns the GStreamer DOT string for this element's private pipelineGet Returns the GStreamer DOT string for this element's private pipelinelong
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.Get Get or set the actual position of the video in ms.Get Returns info about the source being playedvoid
getVideoInfo
(Continuation<VideoInfo> cont) Get Returns info about the source being playedGet 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 Details
-
getVideoInfo
VideoInfo getVideoInfo()Get Returns info about the source being played -
getVideoInfo
Get Returns info about the source being played -
getVideoInfo
Get Returns info about the source being played -
getElementGstreamerDot
String getElementGstreamerDot()Get Returns the GStreamer DOT string for this element's private pipeline -
getElementGstreamerDot
Get Returns the GStreamer DOT string for this element's private pipeline -
getElementGstreamerDot
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
Get Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos -
getPosition
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
Set Get or set the actual position of the video in ms.
Note Setting the position only works for seekable videos -
setPosition
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
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
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
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
Remove aListenerSubscription
for eventEndOfStreamEvent
. Synchronous call.- Parameters:
listenerSubscription
- Listener subscription to be removed
-
removeEndOfStreamListener
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
-