Native Player
1.0
|
Classes | |
class | MessageReceiver |
Main class responsible for handling messages from the communication channel and controlling player life cycle. More... | |
class | MessageSender |
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... | |
Enumerations | |
enum | MessageToPlayer { kClosePlayer = 0, kLoadMedia = 1, kPlay = 2, kPause = 3, kSeek = 4, kChangeRepresentation = 5, kChangeSubtitlesRepresentation = 7, kChangeSubtitlesVisibility = 8, kChangeViewRect } |
enum | MessageFromPlayer { kTimeUpdate = 100, kSetDuration = 101, kBufferingCompleted = 102, kAudioRepresentation = 103, kVideoRepresentation = 104, kSubtitlesRepresentation = 105, kRepresentationChanged = 106, kSubtitles = 107 } |
enum | ClipTypeEnum { , ClipTypeEnum::kUrl = 1, ClipTypeEnum::kDash = 2 } |
Variables | |
const std::string | kKeyMessageToPlayer = "messageToPlayer" |
const std::string | kKeyMessageFromPlayer = "messageFromPlayer" |
const std::string | kKeyBitrate = "bitrate" |
const std::string | kKeyDuration = "duration" |
const std::string | kKeyEncoding = "encoding" |
const std::string | kKeyId = "id" |
const std::string | kKeyLanguage = "language" |
const std::string | kKeySubtitle = "subtitle" |
const std::string | kKeyTime = "time" |
const std::string | kKeyType = "type" |
const std::string | kKeyUrl = "url" |
const std::string | kKeyWidth = "width" |
const std::string | kKeyHeight = "height" |
const std::string | kKeyXCoordination = "x_coordinate" |
const std::string | kKeyYCoordination = "y_coordinate" |
In this namespace you can find a class designed for receiving messages from UI, a class designed for sending messages to UI and key values used for a message building.
It is assumed that UI is implemented in the separate module. In this application JavaScript is used for this purpose. For communication purposes the "post message" - "handle message" mechanism, characteristic for JavaScript and supported in NaCl, is used. All messages are VarDictionary
objects and their values are held in a "key" - "value" map. It is mandatory for the message to contain a kKeyAction
entry which defines message type.
|
strong |
This enum is used to define type of clip which is requested. Basing on this information the player can prepare accurate playback pipeline.
It is used in a MessageToPlayer::kLoadMedia
message.
Enumerator | |
---|---|
kUrl |
Requested content is a media container. |
kDash |
Requested content is a dash manifest. |
Definition at line 188 of file messages.h.
Values defined in this enum are used to recognize the message type sent from the player. The value of this type should be send in the VarDictionary
object with the kKeyMessageFromPlayer
key. When an action requires additional parameters these values should be also included in the sameVarDictionary
object. Parameters can be found in the values description, each one's type key identifier and description is provided.
Definition at line 125 of file messages.h.
Values defined in this enum are used to recognize the message type sent to the player. The value of this type should be send in the VarDictionary
object with the kKeyMessageToPlayer
key. When an action requires additional parameters these values should be also included in the sameVarDictionary
object. Parameters can be found in the values description, each one's type key identifier and description is provided.
Enumerator | |||||||||
---|---|---|---|---|---|---|---|---|---|
kClosePlayer |
A request to close the player; no additional parameters. | ||||||||
kLoadMedia |
A request to load content specified in additional fields and prepare the player to play it.
| ||||||||
kPlay |
A request to start playing; no additional parameters. | ||||||||
kPause |
A request to pause playing; no additional parameters. | ||||||||
kSeek |
A request to set a playback current position to a defined one.
| ||||||||
kChangeRepresentation |
A request to change stream representation to a defined one.
| ||||||||
kChangeSubtitlesRepresentation |
A request to change subtitles representation to a defined one.
| ||||||||
kChangeSubtitlesVisibility |
A request to enable or disable subtitle events, depending on the previous state. Initially subtitles events are enabled. No additional parameters. | ||||||||
kChangeViewRect |
An information about the players position and size.
|
Definition at line 55 of file messages.h.
const std::string Communication::kKeyBitrate = "bitrate" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 218 of file messages.h.
const std::string Communication::kKeyDuration = "duration" |
A string value used in messages as a VarDictionary
key. This key maps to a double
type value.
Definition at line 222 of file messages.h.
const std::string Communication::kKeyEncoding = "encoding" |
A string value used in messages as a VarDictionary
key. This key maps to a string
type value.
Definition at line 226 of file messages.h.
const std::string Communication::kKeyHeight = "height" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 258 of file messages.h.
const std::string Communication::kKeyId = "id" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 230 of file messages.h.
const std::string Communication::kKeyLanguage = "language" |
A string value used in messages as a VarDictionary
key. This key maps to a string
type value.
Definition at line 234 of file messages.h.
const std::string Communication::kKeyMessageFromPlayer = "messageFromPlayer" |
A string value used in messages as a VarDictionary
key. kKeyMessageFromPlayer
is used in all messages sent by the player. The value in a field with this key is used to define what kind of message it is. The only values the player can use for this field are values defined by enum MessageFromPlayer
Definition at line 214 of file messages.h.
const std::string Communication::kKeyMessageToPlayer = "messageToPlayer" |
A string value used in messages as a VarDictionary
key. kKeyMessageToPlayer
has to be used in all messages addressed to the player. The value sent in a field with this key is used to define what kind of message it is. The only values accepted for this field are the ones defined by the enum MessageToPlayer
.
Definition at line 206 of file messages.h.
const std::string Communication::kKeySubtitle = "subtitle" |
A string value used in messages as a VarDictionary
key. This key maps to a string
type value.
Definition at line 238 of file messages.h.
const std::string Communication::kKeyTime = "time" |
A string value used in messages as a VarDictionary
key. This key maps to a double
type value.
Definition at line 242 of file messages.h.
const std::string Communication::kKeyType = "type" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 246 of file messages.h.
const std::string Communication::kKeyUrl = "url" |
A string value used in messages as a VarDictionary
key. This key maps to a string
type value.
Definition at line 250 of file messages.h.
const std::string Communication::kKeyWidth = "width" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 254 of file messages.h.
const std::string Communication::kKeyXCoordination = "x_coordinate" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 262 of file messages.h.
const std::string Communication::kKeyYCoordination = "y_coordinate" |
A string value used in messages as a VarDictionary
key. This key maps to an int
type value.
Definition at line 266 of file messages.h.