Package org.linphone.core
Interface Player
public interface Player
Player interface.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(PlayerListener listener) void
close()
Close the opened file.Create a window id to be used to display video if any.getCore()
Returns theCore
object managing this player's call, if any.int
Get the current position in the opened file.int
Get the duration of the opened file.boolean
Returns whether the file has video and if it can be displayed.long
Gets 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 datafloat
Get the volume gain of the player.int
Open a file for playing.int
pause()
Pause the playing of a file.void
removeListener
(PlayerListener listener) int
seek
(int timeMs) Seek in an opened file.void
setUserData
(Object data) Sets the object to store in this object user's datavoid
setVolumeGain
(float gain) Set the volume gain of the player.void
setWindowId
(Object windowId) Sets a window id to be used to display video if any.int
start()
Start playing a file that has been opened withopen(java.lang.String)
.toString()
-
Method Details
-
getCore
- 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
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.
- 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:- 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()
-