Liblinphone  4.5.0
Public Types | Public Member Functions | List of all members
linphone::Player Class Reference

Player interface. More...

#include <player.hh>

Inheritance diagram for linphone::Player:

Public Types

enum  State {
  State::Closed,
  State::Paused,
  State::Playing
}
 The state of a Player. More...
 

Public Member Functions

 Player (void *ptr, bool takeRef=true)
 
LINPHONECXX_PUBLIC _LinphonePlayer * cPtr ()
 
LINPHONECXX_PUBLIC void addListener (const std::shared_ptr< PlayerListener > &listener)
 
LINPHONECXX_PUBLIC void removeListener (const std::shared_ptr< PlayerListener > &listener)
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::CoregetCore () const
 Returns the Core object managing this player's call, if any. More...
 
LINPHONECXX_PUBLIC int getCurrentPosition ()
 Get the current position in the opened file. More...
 
LINPHONECXX_PUBLIC int getDuration ()
 Get the duration of the opened file. More...
 
LINPHONECXX_PUBLIC bool getIsVideoAvailable ()
 Returns whether the file has video and if it can be displayed. More...
 
LINPHONECXX_PUBLIC State getState ()
 Get the current state of a player. More...
 
LINPHONECXX_PUBLIC void setWindowId (void *windowId)
 Sets a window id to be used to display video if any. More...
 
LINPHONECXX_PUBLIC void close ()
 Close the opened file.
 
LINPHONECXX_PUBLIC linphone::Status open (const std::string &filename)
 Open a file for playing. More...
 
LINPHONECXX_PUBLIC linphone::Status pause ()
 Pause the playing of a file. More...
 
LINPHONECXX_PUBLIC linphone::Status seek (int timeMs)
 Seek in an opened file. More...
 
LINPHONECXX_PUBLIC linphone::Status start ()
 Start playing a file that has been opened with open(). More...
 

Detailed Description

Player interface.

Member Enumeration Documentation

◆ State

The state of a Player.

Enumerator
Closed 

No file is opened for playing.

Paused 

The player is paused.

Playing 

The player is playing.

Member Function Documentation

◆ getCore()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::Player::getCore ( ) const

Returns the Core object managing this player's call, if any.

Returns
the Core object associated

◆ getCurrentPosition()

LINPHONECXX_PUBLIC int linphone::Player::getCurrentPosition ( )

Get the current position in the opened file.

Returns
The current position in the opened file

◆ getDuration()

LINPHONECXX_PUBLIC int linphone::Player::getDuration ( )

Get the duration of the opened file.

Returns
The duration of the opened file

◆ getIsVideoAvailable()

LINPHONECXX_PUBLIC bool linphone::Player::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()

LINPHONECXX_PUBLIC State linphone::Player::getState ( )

Get the current state of a player.

Returns
The current State of the player.

◆ open()

LINPHONECXX_PUBLIC linphone::Status linphone::Player::open ( const std::string &  filename)

Open a file for playing.

Parameters
filenameThe path to the file to open

◆ pause()

LINPHONECXX_PUBLIC linphone::Status linphone::Player::pause ( )

Pause the playing of a file.

Returns
0 on success, a negative value otherwise

◆ seek()

LINPHONECXX_PUBLIC linphone::Status linphone::Player::seek ( int  timeMs)

Seek in an opened file.

Parameters
timeMsThe time we want to go to in the file (in milliseconds).
Returns
0 on success, a negative value otherwise.

◆ setWindowId()

LINPHONECXX_PUBLIC void linphone::Player::setWindowId ( void *  windowId)

Sets a window id to be used to display video if any.

Parameters
windowIdThe window id pointer to use.

◆ start()

LINPHONECXX_PUBLIC linphone::Status linphone::Player::start ( )

Start playing a file that has been opened with open().

Returns
0 on success, a negative value otherwise

The documentation for this class was generated from the following file: