public interface PlayerEndpoint extends 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:///path/to/file
http(s)://{server-ip}/path/to/file
http(s)://{username}:{password}@{server-ip}:{server-port}/path/to/file
rtsp://{server-ip}
rtsp://{username}:{password}@{server-ip}:{server-port}/path/to/file
{username}
or {password}
.
This means that {username}
cannot contain colons
(:
), and {password}
cannot contain 'at' signs
(@
). This is a limitation of GStreamer 1.8 (the underlying
media framework behind Kurento), and is already fixed in newer versions
(which the upcoming Kurento 7.x will use).
{username}
or {password}
must be url-encoded.
This means that colons (:
) should be replaced with
%3A
, and 'at' signs (@
) should be replaced with
%40
.
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.
Modifier and Type | Interface and Description |
---|---|
static class |
PlayerEndpoint.Builder |
Modifier and Type | Method and Description |
---|---|
ListenerSubscription |
addEndOfStreamListener(EventListener<EndOfStreamEvent> listener)
Add a
EventListener for event EndOfStreamEvent . |
void |
addEndOfStreamListener(EventListener<EndOfStreamEvent> listener,
Continuation<ListenerSubscription> cont)
Add a
EventListener for event EndOfStreamEvent . |
String |
getElementGstreamerDot()
Get Returns the GStreamer DOT string for this element's private pipeline
|
void |
getElementGstreamerDot(Continuation<String> cont)
Get Returns the GStreamer DOT string for this element's private pipeline
|
TFuture<String> |
getElementGstreamerDot(Transaction tx)
Get Returns the GStreamer DOT string for this element's private pipeline
|
long |
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 played
|
void |
getVideoInfo(Continuation<VideoInfo> cont)
Get Returns info about the source being played
|
TFuture<VideoInfo> |
getVideoInfo(Transaction tx)
Get Returns info about the source being played
|
void |
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 a
ListenerSubscription for event EndOfStreamEvent . |
void |
removeEndOfStreamListener(ListenerSubscription listenerSubscription,
Continuation<Void> cont)
Remove a
ListenerSubscription for event EndOfStreamEvent . |
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.
|
addUriEndpointStateChangedListener, addUriEndpointStateChangedListener, getState, getState, getState, getUri, getUri, getUri, pause, pause, pause, removeUriEndpointStateChangedListener, removeUriEndpointStateChangedListener, stop, stop, stop
addElementConnectedListener, addElementConnectedListener, addElementDisconnectedListener, addElementDisconnectedListener, addMediaFlowInStateChangedListener, addMediaFlowInStateChangedListener, addMediaFlowInStateChangeListener, addMediaFlowInStateChangeListener, addMediaFlowOutStateChangedListener, addMediaFlowOutStateChangedListener, addMediaFlowOutStateChangeListener, addMediaFlowOutStateChangeListener, addMediaTranscodingStateChangedListener, addMediaTranscodingStateChangedListener, addMediaTranscodingStateChangeListener, addMediaTranscodingStateChangeListener, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, disconnect, getGstreamerDot, getGstreamerDot, getGstreamerDot, getGstreamerDot, getGstreamerDot, getGstreamerDot, getMaxOuputBitrate, getMaxOuputBitrate, getMaxOuputBitrate, getMaxOutputBitrate, getMaxOutputBitrate, getMaxOutputBitrate, getMinOuputBitrate, getMinOuputBitrate, getMinOuputBitrate, getMinOutputBitrate, getMinOutputBitrate, getMinOutputBitrate, 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, removeMediaFlowInStateChangeListener, removeMediaFlowInStateChangeListener, removeMediaFlowOutStateChangedListener, removeMediaFlowOutStateChangedListener, removeMediaFlowOutStateChangeListener, removeMediaFlowOutStateChangeListener, removeMediaTranscodingStateChangedListener, removeMediaTranscodingStateChangedListener, removeMediaTranscodingStateChangeListener, removeMediaTranscodingStateChangeListener, setAudioFormat, setAudioFormat, setAudioFormat, setMaxOuputBitrate, setMaxOuputBitrate, setMaxOuputBitrate, setMaxOutputBitrate, setMaxOutputBitrate, setMaxOutputBitrate, setMinOuputBitrate, setMinOuputBitrate, setMinOuputBitrate, setMinOutputBitrate, setMinOutputBitrate, setMinOutputBitrate, setOutputBitrate, setOutputBitrate, setOutputBitrate, setVideoFormat, setVideoFormat, setVideoFormat
addErrorListener, addErrorListener, addTag, addTag, addTag, getChildren, getChildren, getChildren, getChilds, getChilds, getChilds, 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
addEventListener, invoke, isCommited, release, release, release, removeEventListener, waitCommited, whenCommited, whenCommited
VideoInfo getVideoInfo()
void getVideoInfo(Continuation<VideoInfo> cont)
TFuture<VideoInfo> getVideoInfo(Transaction tx)
String getElementGstreamerDot()
void getElementGstreamerDot(Continuation<String> cont)
TFuture<String> getElementGstreamerDot(Transaction tx)
long getPosition()
void getPosition(Continuation<Long> cont)
TFuture<Long> getPosition(Transaction tx)
void setPosition(long position)
void setPosition(long position, Continuation<Void> cont)
void setPosition(long position, Transaction tx)
void play()
void play(Continuation<Void> cont)
Continuation.onSuccess(F)
is called when the action is
done. If an error occurs, Continuation.onError(java.lang.Throwable)
is called.play()
void play(Transaction tx)
ListenerSubscription addEndOfStreamListener(EventListener<EndOfStreamEvent> listener)
EventListener
for event EndOfStreamEvent
. Synchronous call.listener
- Listener to be called on EndOfStreamEventvoid addEndOfStreamListener(EventListener<EndOfStreamEvent> listener, Continuation<ListenerSubscription> cont)
EventListener
for event EndOfStreamEvent
. Asynchronous call.
Calls Continuation<ListenerSubscription> when it has been added.listener
- Listener to be called on EndOfStreamEventcont
- Continuation to be called when the listener is registeredvoid removeEndOfStreamListener(ListenerSubscription listenerSubscription)
ListenerSubscription
for event EndOfStreamEvent
. Synchronous call.listenerSubscription
- Listener subscription to be removedvoid removeEndOfStreamListener(ListenerSubscription listenerSubscription, Continuation<Void> cont)
ListenerSubscription
for event EndOfStreamEvent
. Asynchronous call.
Calls Continuation<Void> when it has been removed.listenerSubscription
- Listener subscription to be removedcont
- Continuation to be called when the listener is removedCopyright © 2022 Kurento. All rights reserved.