Native Player
1.0
|
A factory of PlayerController
objects.
More...
#include <player_provider.h>
Public Types | |
enum | PlayerType { kUnknown, kUrl, kEsDash } |
Public Member Functions | |
PlayerProvider (const pp::InstanceHandle &instance, std::shared_ptr< Communication::MessageSender > message_sender) | |
~PlayerProvider () | |
std::shared_ptr< PlayerController > | CreatePlayer (PlayerType type, const std::string &url, const Samsung::NaClPlayer::Rect view_rect, const std::string &subtitle={}, const std::string &encoding={}) |
A factory of PlayerController
objects.
API for controlling the player is specified by PlayerController
, but different implementations of it could have a different initialization procedure. This class encapsulates it, provided player controller is already initialized and ready to play the content.
Definition at line 51 of file player_provider.h.
This enum defines supported player types.
Enumerator | |
---|---|
kUnknown |
This value is not related to any player type. |
kUrl |
Value which corresponds to a URL player controller. To create this type of player only a URL to a content is required. A Format of provided content will be detected automatically.
|
kEsDash |
Value which corresponds to an elementary stream player controller with DASH. To create this type of player url to a DASH manifest file is required.
|
Definition at line 55 of file player_provider.h.
|
inlineexplicit |
Creates a PlayerProvider
object. Gathers objects which are provided to the PlayerController
implementation if it is needed.
[in] | instance | A handle to main plugin instance. |
[in] | message_sender | A class which will be used by the player to post messages through the communication channel. |
Definition at line 81 of file player_provider.h.
|
inline |
Destroys a PlayerProvider
object. Created PlayerController
objects will not be destroyed.
Definition at line 87 of file player_provider.h.
std::shared_ptr<PlayerController> PlayerProvider::CreatePlayer | ( | PlayerType | type, |
const std::string & | url, | ||
const Samsung::NaClPlayer::Rect | view_rect, | ||
const std::string & | subtitle = {} , |
||
const std::string & | encoding = {} |
||
) |
Provides an initialized PlayerController
of a given type. The PlayerController
object is ready to use. This is the main method of this class.
[in] | type | A type of the player controller which is needed. |
[in] | url | A URL address to a file which the player controller should use for getting the content. This parameter could point to different file types depending on the type parameter. Check PlayerType for more information about supported formats. |
[in] | view_rect | A position and size of the player window. |
[in] | subtitle | A URL address to an external subtitles file. It is an optional parameter, if is not provided then external subtitles are not be available. |
[in] | encoding | A code of subtitles formating. It is an optional parameter, if is not specified then UTF-8 is used. |
PlayerController.