Native Player  1.0
PlayerProvider Class Reference

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< PlayerControllerCreatePlayer (PlayerType type, const std::string &url, const Samsung::NaClPlayer::Rect view_rect, const std::string &subtitle={}, const std::string &encoding={})
 

Detailed Description

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.

Member Enumeration Documentation

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.

See also
UrlPlayerController
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.

See also
EsDashPlayerController

Definition at line 55 of file player_provider.h.

Constructor & Destructor Documentation

PlayerProvider::PlayerProvider ( const pp::InstanceHandle &  instance,
std::shared_ptr< Communication::MessageSender message_sender 
)
inlineexplicit

Creates a PlayerProvider object. Gathers objects which are provided to the PlayerController implementation if it is needed.

Parameters
[in]instanceA handle to main plugin instance.
[in]message_senderA class which will be used by the player to post messages through the communication channel.
See also
pp::Instance
Communication::MessageSender

Definition at line 81 of file player_provider.h.

PlayerProvider::~PlayerProvider ( )
inline

Destroys a PlayerProvider object. Created PlayerController objects will not be destroyed.

Definition at line 87 of file player_provider.h.

Member Function Documentation

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.

Parameters
[in]typeA type of the player controller which is needed.
[in]urlA 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_rectA position and size of the player window.
[in]subtitleA URL address to an external subtitles file. It is an optional parameter, if is not provided then external subtitles are not be available.
[in]encodingA code of subtitles formating. It is an optional parameter, if is not specified then UTF-8 is used.
Returns
A configured and initialized PlayerController.

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