Package org.linphone.core
Interface Player
public interface Player
Player interface.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(PlayerListener listener) voidclose()Close the opened file.Create a window id to be used to display video if any.createWindowId(Object context) Create a window id to be used to display video if any.getCore()Returns theCoreobject managing this player's call, if any.intGet the current position in the opened file.intGet the duration of the opened file.booleanReturns whether the file has video and if it can be displayed.longGets the native pointer used by this class to make native method calls.getState()Get the current state of a player.Gets the object stored in this object user's datafloatGet the volume gain of the player.intOpen a file for playing.intpause()Pause the playing of a file.voidremoveListener(PlayerListener listener) intseek(int timeMs) Seek in an opened file.voidsetUserData(Object data) Sets the object to store in this object user's datavoidsetVolumeGain(float gain) Set the volume gain of the player.voidsetWindowId(Object windowId) Sets a window id to be used to display video if any.intstart()Start playing a file that has been opened withopen(java.lang.String).toString()
-
Method Details
-
getCore
- Returns:
- the
Coreobject 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.Stateof 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
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
Create a window id to be used to display video if any.
A context can be used to prevent Linphone from allocating the container
(MSOglContextInfo for MSOGL). null if not used.
A context can be used to prevent Linphone from allocating the container
(MSOglContextInfo for MSOGL). null if not used.- Parameters:
context- preallocated Window ID (Used only for MSOGL)- Returns:
- window_id The window id pointer to use.
-
createWindowId
Create a window id to be used to display video if any.
- Returns:
- window_id The window id pointer to use.
-
open
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:
-WAVE format: only PCM s16le codec is supported.
-MKV/MKA format:- 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()- Returns:
- 0 on success, a negative value otherwise
-
addListener
-
removeListener
-
setUserData
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()
-