Native Player  1.0
player_provider.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 Michal Murgrabia
24 //
25 // ----------------------------------------------------------------------------
26 
27 #ifndef NATIVE_PLAYER_INC_PLAYER_PLAYER_PROVIDER_H_
28 #define NATIVE_PLAYER_INC_PLAYER_PLAYER_PROVIDER_H_
29 
30 #include <string>
31 
32 #include "nacl_player/common.h"
33 #include "ppapi/cpp/instance.h"
34 
35 #include "common.h"
38 
41 
50 
52  public:
55  enum PlayerType {
58 
64 
70  };
71 
81  explicit PlayerProvider(const pp::InstanceHandle& instance,
82  std::shared_ptr<Communication::MessageSender> message_sender)
83  : instance_(instance), message_sender_((std::move(message_sender))) {}
84 
88 
106  std::shared_ptr<PlayerController> CreatePlayer(PlayerType type,
107  const std::string& url,
108  const Samsung::NaClPlayer::Rect view_rect,
109  const std::string& subtitle = {},
110  const std::string& encoding = {});
111 
112  private:
113  pp::InstanceHandle instance_;
114  std::shared_ptr<Communication::MessageSender> message_sender_;
115 };
116 
117 #endif // NATIVE_PLAYER_INC_PLAYER_PLAYER_PROVIDER_H_
This file defines the PlayerController class.
PlayerProvider(const pp::InstanceHandle &instance, std::shared_ptr< Communication::MessageSender > message_sender)
This value is not related to any player type.
std::shared_ptr< PlayerController > CreatePlayer(PlayerType type, const std::string &url, const Samsung::NaClPlayer::Rect view_rect, const std::string &subtitle={}, const std::string &encoding={})
This file defines a MessageSender class.
A factory of PlayerController objects.