Native Player  1.0
UrlPlayerController Class Reference

This class controls NaCl Player in the playback from the URL scenario. More...

#include <url_player_controller.h>

Inheritance diagram for UrlPlayerController:
PlayerController

Public Member Functions

 UrlPlayerController (const pp::InstanceHandle &instance, std::shared_ptr< Communication::MessageSender > message_sender)
 
 ~UrlPlayerController ()
 
void InitPlayer (const std::string &url, const std::string &subtitle={}, const std::string &encoding={})
 
void Play () override
 Orders the player to start/resume playback of the loaded content. More...
 
void Pause () override
 Orders the player to pause playback of the content. More...
 
void Seek (Samsung::NaClPlayer::TimeTicks to_time) override
 
void ChangeRepresentation (StreamType stream_type, int32_t id) override
 
void SetViewRect (const Samsung::NaClPlayer::Rect &view_rect) override
 
void PostTextTrackInfo () override
 
void ChangeSubtitles (int32_t id) override
 
void ChangeSubtitleVisibility () override
 Orders the player to start or stop generating events related to subtitles. More...
 
PlayerState GetState () override
 
void InitializeUrlPlayer (const std::string &content_container_url)
 
- Public Member Functions inherited from PlayerController
 PlayerController ()
 Creates a PlayerController object. More...
 
virtual ~PlayerController ()
 Destroys the PlayerController object. More...
 

Additional Inherited Members

- Public Types inherited from PlayerController
enum  PlayerState {
  PlayerState::kUnitialized, PlayerState::kReady, PlayerState::kPaused, PlayerState::kPlaying,
  PlayerState::kError
}
 

Detailed Description

This class controls NaCl Player in the playback from the URL scenario.

This class provides an implementation of the PlayerController interface. It controls a life cycle and manages a MediaPlayer object. MediaPlayer is the main class of NaCl Player.
This particular PlayerController uses URLDataSource as a media data source. Using UrlPlayerController means that downloading and demuxing are made by NaCl Player.
The application needs to control only basic player operations:

  • Play
  • Pause
  • Seek
  • Post subtitles (optional)

UrlPlayerController supports playback from multimedia files.

Note
For supported formats please check http://www.samsungdforum.com/Tizen/Spec
Factory PlayerProvider is responsible for creation of UrlPlayerController.
See also
Samsung::NaClPlayer::URLDataSource
PlayerProvider

Definition at line 76 of file url_player_controller.h.

Constructor & Destructor Documentation

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

Constructs a UrlPlayerController object with the given parameters. NaCl Player must be initialized using the InitPlayer() method before a playback can be started.
UrlPlayerController is created by a PlayerProvider factory.

Parameters
[in]instanceAn InstanceHandle identifying Native Player object.
[in]message_senderA MessageSender object pointer which will be used to send messages through the communication channel.
See also
Communication::MessageSender
UrlPlayerController::InitPlayer()

Definition at line 92 of file url_player_controller.h.

UrlPlayerController::~UrlPlayerController ( )
inline

Destroys UrlPlayerController object. This also destroys a MediaPlayer object and thus a player pipeline.

Definition at line 103 of file url_player_controller.h.

Member Function Documentation

void UrlPlayerController::ChangeRepresentation ( StreamType  stream_type,
int32_t  id 
)
overridevirtual

Orders the player to change a stream representation to a defined one.

Parameters
[in]stream_typeA definition which stream representation should be changed.
[in]idAn id of the new stream representation which should be used.

Implements PlayerController.

void UrlPlayerController::ChangeSubtitles ( int32_t  id)
overridevirtual

Orders the player to change a subtitles set from current to the specified one.

Parameters
[in]idAn id of a subtitles set which should be used.

Implements PlayerController.

void UrlPlayerController::ChangeSubtitleVisibility ( )
overridevirtual

Orders the player to start or stop generating events related to subtitles.

Implements PlayerController.

PlayerState UrlPlayerController::GetState ( )
overridevirtual

Provides information about PlayerController state.

Returns
A current state of the player.

Implements PlayerController.

void UrlPlayerController::InitializeUrlPlayer ( const std::string &  content_container_url)

This method initializes a media data source with the given URL. After a successful initialization the media data source is attached to the player. This method is called after UrlPlayerController::InitPlayer.

Parameters
[in]content_container_urlA URL address of a file with a media content.
void UrlPlayerController::InitPlayer ( const std::string &  url,
const std::string &  subtitle = {},
const std::string &  encoding = {} 
)

This method initializes UrlPlayerController with the given parameters. In this method NaCl Player is created. Listeners are registered and if the subtitle path is present external subtitles are added.
This method is called by a PlayerProvider factory.

Parameters
[in]urlA URL address of the file with a media content
[in]subtitleA URL address to an external subtitles file. It is an optional parameter, if an empty string is provided then external subtitles are not available.
[in]encodingEncoding of the subtitles file pointed by the subtitle parameter. UTF-8 encoding will be used as a default if an empty string is given.
void UrlPlayerController::Pause ( )
overridevirtual

Orders the player to pause playback of the content.

Implements PlayerController.

void UrlPlayerController::Play ( )
overridevirtual

Orders the player to start/resume playback of the loaded content.

Implements PlayerController.

void UrlPlayerController::PostTextTrackInfo ( )
overridevirtual

Orders the player to send a message about all available subtitles text track's information.

Implements PlayerController.

void UrlPlayerController::Seek ( Samsung::NaClPlayer::TimeTicks  to_time)
overridevirtual

Orders the player to change the current playback time to the defined one.

param[in] to_time Time from which playback should continue when seek operation completes.

Implements PlayerController.

void UrlPlayerController::SetViewRect ( const Samsung::NaClPlayer::Rect &  view_rect)
overridevirtual

Sets a player display area.

Parameters
[in]view_rectA size and position of a player display area.

Implements PlayerController.


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