Native Player
1.0
|
This class controls NaCl Player in the playback from the URL scenario. More...
#include <url_player_controller.h>
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 } |
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:
UrlPlayerController
supports playback from multimedia files.
PlayerProvider
is responsible for creation of UrlPlayerController
.Definition at line 76 of file url_player_controller.h.
|
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.
[in] | instance | An InstanceHandle identifying Native Player object. |
[in] | message_sender | A MessageSender object pointer which will be used to send messages through the communication channel. |
Definition at line 92 of file url_player_controller.h.
|
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.
|
overridevirtual |
Orders the player to change a stream representation to a defined one.
[in] | stream_type | A definition which stream representation should be changed. |
[in] | id | An id of the new stream representation which should be used. |
Implements PlayerController.
|
overridevirtual |
Orders the player to change a subtitles set from current to the specified one.
[in] | id | An id of a subtitles set which should be used. |
Implements PlayerController.
|
overridevirtual |
Orders the player to start or stop generating events related to subtitles.
Implements PlayerController.
|
overridevirtual |
Provides information about PlayerController
state.
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
.
[in] | content_container_url | A 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.
[in] | url | A URL address of the file with a media content |
[in] | subtitle | A 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] | encoding | Encoding of the subtitles file pointed by the subtitle parameter. UTF-8 encoding will be used as a default if an empty string is given. |
|
overridevirtual |
Orders the player to pause playback of the content.
Implements PlayerController.
|
overridevirtual |
Orders the player to start/resume playback of the loaded content.
Implements PlayerController.
|
overridevirtual |
Orders the player to send a message about all available subtitles text track's information.
Implements PlayerController.
|
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.
|
overridevirtual |
Sets a player display area.
[in] | view_rect | A size and position of a player display area. |
Implements PlayerController.