Native Player  1.0
message_sender.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // Copyright (c) 2016, Samsung Electronics Co., Ltd
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
20 // , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 //
23 // @author Tomasz Borkowski
24 // Michal Murgrabia
25 //
26 // ----------------------------------------------------------------------------
27 
28 #ifndef NATIVE_PLAYER_INC_COMMUNICATOR_MESSAGE_SENDER_H_
29 #define NATIVE_PLAYER_INC_COMMUNICATOR_MESSAGE_SENDER_H_
30 
31 #include <vector>
32 
33 #include "common.h"
34 #include "nacl_player/common.h"
35 #include "nacl_player/media_common.h"
36 
39 
40 namespace Communication {
41 
50 
52  public:
57  explicit MessageSender(pp::Instance* instance) : instance_(instance) {}
58 
61 
67  void SetMediaDuration(Samsung::NaClPlayer::TimeTicks duration);
68 
73  void CurrentTimeUpdate(Samsung::NaClPlayer::TimeTicks time);
74 
79  void BufferingCompleted();
80 
90  void SetRepresentations(const std::vector<AudioStream>& stream);
91 
101  void SetRepresentations(const std::vector<VideoStream>& stream);
102 
110  void ChangeRepresentation(StreamType stream_type, int32_t id);
111 
119  void ShowSubtitles(Samsung::NaClPlayer::TimeTicks duration,
120  const pp::Var& text);
121 
129  void SetTextTracks(const std::vector<Samsung::NaClPlayer::TextTrackInfo>&
130  textInfo);
131 
132  private:
137  inline void PostMessage(const pp::Var& message);
138 
139  pp::Instance* instance_;
140 };
141 
142 } // namespace Communication
143 
144 #endif // NATIVE_PLAYER_INC_COMMUNICATOR_MESSAGE_SENDER_H_
StreamType
Definition: common.h:55
void SetTextTracks(const std::vector< Samsung::NaClPlayer::TextTrackInfo > &textInfo)
MessageSender(pp::Instance *instance)
void ChangeRepresentation(StreamType stream_type, int32_t id)
~MessageSender()
Destroys the MessageSender object.
void ShowSubtitles(Samsung::NaClPlayer::TimeTicks duration, const pp::Var &text)
This class is designed to create and post messages from the player using the communication channel...
void SetMediaDuration(Samsung::NaClPlayer::TimeTicks duration)
void CurrentTimeUpdate(Samsung::NaClPlayer::TimeTicks time)
void SetRepresentations(const std::vector< AudioStream > &stream)