Interface Player


public interface Player
Player interface.

  • Method Details

    • getCore

      @NonNull Core getCore()
      Returns the Core object managing this player's call, if any.

      Returns:
      the Core object associated
    • getCurrentPosition

      int getCurrentPosition()
      Get the current position in the opened file.

      Returns:
      The current position in the opened file
    • getDuration

      int getDuration()
      Get the duration of the opened file.

      Returns:
      The duration of the opened file
    • getIsVideoAvailable

      boolean getIsVideoAvailable()
      Returns whether the file has video and if it can be displayed.

      Returns:
      true if file has video and it can be displayed, false otherwise
    • getState

      Player.State getState()
      Get the current state of a player.

      Returns:
      The current Player.State of the player.
    • getVolumeGain

      float getVolumeGain()
      Get the volume gain of the player.

      Returns:
      Percentage of the gain. Valid values are in [ 0.0 : 1.0 ].
    • setVolumeGain

      void setVolumeGain(float gain)
      Set the volume gain of the player.

      Parameters:
      gain - Percentage of the gain. Valid values are in [ 0.0 : 1.0 ].
    • setWindowId

      void setWindowId(@Nullable Object windowId)
      Sets a window id to be used to display video if any.

      Parameters:
      windowId - The window id pointer to use.
    • close

      void close()
      Close the opened file.

    • createWindowId

      @Nullable Object createWindowId()
      Create a window id to be used to display video if any.

      Returns:
      window_id The window id pointer to use.
    • open

      int open(@NonNull String filename)
      Open a file for playing.

      Actually, only WAVE and MKV/MKA file formats are supported and a limited set of
      codecs depending of the selected format. Here are the list of working
      combinations:
      Parameters:
      filename - The path to the file to open
    • pause

      int pause()
      Pause the playing of a file.

      Returns:
      0 on success, a negative value otherwise
    • seek

      int seek(int timeMs)
      Seek in an opened file.

      Parameters:
      timeMs - The time we want to go to in the file (in milliseconds).
      Returns:
      0 on success, a negative value otherwise.
    • start

      int start()
      Start playing a file that has been opened with open(java.lang.String).

      Returns:
      0 on success, a negative value otherwise
    • addListener

      void addListener(PlayerListener listener)
    • removeListener

      void removeListener(PlayerListener listener)
    • setUserData

      void setUserData(Object data)
      Sets the object to store in this object user's data
      Parameters:
      data - the object to store
    • getUserData

      Object getUserData()
      Gets the object stored in this object user's data
      Returns:
      the object store if any, null otherwise
    • getNativePointer

      long getNativePointer()
      Gets the native pointer used by this class to make native method calls.
      Returns:
      the nativer pointer, as long
    • toString

      String toString()
      Overrides:
      toString in class Object