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 and password 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.
    • 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
      • 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​(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.
      • removeEndOfStreamListener

        void removeEndOfStreamListener​(ListenerSubscription listenerSubscription,
                                       Continuation<Void> cont)
        Remove a ListenerSubscription for event EndOfStreamEvent. Asynchronous call. Calls Continuation<Void> when it has been removed.
        Parameters:
        listenerSubscription - Listener subscription to be removed
        cont - Continuation to be called when the listener is removed