Native Player  1.0
Communication::MessageSender Class Reference

This class is designed to create and post messages from the player using the communication channel. Possible messages, which the player can send, are defined in enum MessageFromPlayer. More...

#include <message_sender.h>

Public Member Functions

 MessageSender (pp::Instance *instance)
 
 ~MessageSender ()
 Destroys the MessageSender object. More...
 
void SetMediaDuration (Samsung::NaClPlayer::TimeTicks duration)
 
void CurrentTimeUpdate (Samsung::NaClPlayer::TimeTicks time)
 
void BufferingCompleted ()
 
void SetRepresentations (const std::vector< AudioStream > &stream)
 
void SetRepresentations (const std::vector< VideoStream > &stream)
 
void ChangeRepresentation (StreamType stream_type, int32_t id)
 
void ShowSubtitles (Samsung::NaClPlayer::TimeTicks duration, const pp::Var &text)
 
void SetTextTracks (const std::vector< Samsung::NaClPlayer::TextTrackInfo > &textInfo)
 

Detailed Description

This class is designed to create and post messages from the player using the communication channel. Possible messages, which the player can send, are defined in enum MessageFromPlayer.

See also
Communication The description of Communication namespace provides a brief of the communication mechanism.
MessageFromPlayer

Definition at line 51 of file message_sender.h.

Constructor & Destructor Documentation

Communication::MessageSender::MessageSender ( pp::Instance *  instance)
inlineexplicit

Creates a MessageSender object.

Parameters
[in]instanceA pointer to a module which will be used for sending messages.

Definition at line 57 of file message_sender.h.

Communication::MessageSender::~MessageSender ( )
inline

Destroys the MessageSender object.

Definition at line 60 of file message_sender.h.

Member Function Documentation

void Communication::MessageSender::BufferingCompleted ( )

Prepares and posts a message with the information that buffering has been finished, and playback is possible from this moment.

See also
kBufferingCompleted Main key value in the prepared message.
void Communication::MessageSender::ChangeRepresentation ( StreamType  stream_type,
int32_t  id 
)

Prepares and posts a message with the information that representation of the stream has been changed to the one defined by id.

Parameters
[in]stream_typeA type of stream which has been changed. Audio or Video.
[in]idAn id of current active representation.
See also
kRepresentationChanged Main key value in the prepared message.
void Communication::MessageSender::CurrentTimeUpdate ( Samsung::NaClPlayer::TimeTicks  time)

Prepares and posts a message with a new current playback position.

Parameters
[in]timeA current playback position.
See also
kTimeUpdate Main key value in the prepared message.
void Communication::MessageSender::SetMediaDuration ( Samsung::NaClPlayer::TimeTicks  duration)

Prepares and posts a message with the duration of the content.

Parameters
[in]durationA total length in seconds of the loaded media content.
See also
kSetDuration Main key value in the prepared message.
void Communication::MessageSender::SetRepresentations ( const std::vector< AudioStream > &  stream)

Prepares and posts messages about all available audio stream representations from the provided array container. A separate message will be sent for each representation.

Parameters
[in]streamA vector with AudioStreams. Id, bitrate and language are taken from those streams.
See also
kAudioRepresentation Main key value in the prepared message.
AudioStream
Note
This method is used by the DASH type player.
void Communication::MessageSender::SetRepresentations ( const std::vector< VideoStream > &  stream)

Prepares and posts messages about all available video stream representations from a provided array container. A separate message will be sent for each representation.

Parameters
[in]streamA vector with VideoStreams. Id, bitrate and resolution are taken from those streams.
See also
kVideoRepresentation Main key value in the prepared message.
VideoStream
Note
This method is used by the DASH type player.
void Communication::MessageSender::SetTextTracks ( const std::vector< Samsung::NaClPlayer::TextTrackInfo > &  textInfo)

Prepares and posts messages about all subtitles' track information from a provided container. A separate message will be sent for each track information.

Parameters
[in]textInfoA vector with a subtitles track information. Id, and language are taken from those streams.
See also
kSubtitlesRepresentation Main key value in the prepared message.
void Communication::MessageSender::ShowSubtitles ( Samsung::NaClPlayer::TimeTicks  duration,
const pp::Var &  text 
)

Prepares and posts a message with the subtitle which should be presented for the given duration.

Parameters
[in]durationA value indicating for how long the subtitle should be presented from the current moment.
[in]textA subtitle content.
See also
kSubtitles Main key value in the prepared message.

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