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
usernameandpasswordfields.
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 -
Method Summary
Modifier and TypeMethodDescriptionaddEndOfStreamListener(EventListener<EndOfStreamEvent> listener) Add aEventListenerfor eventEndOfStreamEvent.voidaddEndOfStreamListener(EventListener<EndOfStreamEvent> listener, Continuation<ListenerSubscription> cont) Add aEventListenerfor eventEndOfStreamEvent.Get Returns the GStreamer DOT string for this element's private pipelinevoidGet Returns the GStreamer DOT string for this element's private pipelineGet Returns the GStreamer DOT string for this element's private pipelinelongGet Get or set the actual position of the video in ms.voidgetPosition(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 playedvoidgetVideoInfo(Continuation<VideoInfo> cont) Get Returns info about the source being playedGet Returns info about the source being playedvoidplay()Starts reproducing the media, sending it to the :rom:cls:`MediaSource`.voidplay(Continuation<Void> cont) Asynchronous version of play:Continuation.onSuccess(F)is called when the action is done.voidplay(Transaction tx) Starts reproducing the media, sending it to the :rom:cls:`MediaSource`.voidremoveEndOfStreamListener(ListenerSubscription listenerSubscription) Remove aListenerSubscriptionfor eventEndOfStreamEvent.voidremoveEndOfStreamListener(ListenerSubscription listenerSubscription, Continuation<Void> cont) Remove aListenerSubscriptionfor eventEndOfStreamEvent.voidsetPosition(long position) Set Get or set the actual position of the video in ms.voidsetPosition(long position, Continuation<Void> cont) Set Get or set the actual position of the video in ms.voidsetPosition(long position, Transaction tx) Set Get or set the actual position of the video in ms.Methods inherited from interface KurentoObject
addEventListener, invoke, isCommited, release, release, release, removeEventListener, waitCommited, whenCommited, whenCommitedMethods inherited from interface 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, dumpGstreamerDot, dumpGstreamerDot, dumpGstreamerDot, dumpGstreamerDot, dumpGstreamerDot, dumpGstreamerDot, 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, setVideoFormatMethods inherited from interface 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, setSendTagsInEventsMethods inherited from interface 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(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 aEventListenerfor 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 aEventListenerfor 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 aListenerSubscriptionfor eventEndOfStreamEvent. Synchronous call.- Parameters:
listenerSubscription- Listener subscription to be removed
-
removeEndOfStreamListener
Remove aListenerSubscriptionfor 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
-