Shaka Player Embedded
navigator.h
Go to the documentation of this file.
1 // Copyright 2016 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_JS_NAVIGATOR_H_
16 #define SHAKA_EMBEDDED_JS_NAVIGATOR_H_
17 
18 #include <string>
19 #include <vector>
20 
21 #include "shaka/version.h"
25 #include "src/mapping/promise.h"
26 
27 // #define PLATFORM // Defined by BUILD.gn
28 #define APP_NAME "Netscape"
29 #define APP_CODE_NAME "Mozilla"
30 #define APP_VERSION "5.0"
31 #define PRODUCT "Gecko"
32 #define PRODUCT_SUB "20030107"
33 #ifdef OS_IOS
34 // Include "Apple" so Shaka Player thinks it's Apple to favor native HLS.
35 # define VENDOR "Shaka-Player-Embedded (like Apple)"
36 #else
37 # define VENDOR "Shaka-Player-Embedded"
38 #endif
39 #define VENDOR_SUB SHAKA_VERSION_STR
40 #define USER_AGENT \
41  APP_CODE_NAME "/" APP_VERSION " (" PLATFORM ") " VENDOR "/" VENDOR_SUB
42 
43 
44 namespace shaka {
45 namespace js {
46 
47 class Navigator : public BackingObject {
48  DECLARE_TYPE_INFO(Navigator);
49 
50  public:
51  Navigator();
52 
53  const std::string app_name = APP_NAME;
54  const std::string app_code_name = APP_CODE_NAME;
55  const std::string app_version = APP_VERSION;
56  const std::string platform = PLATFORM;
57  const std::string product = PRODUCT;
58  const std::string product_sub = PRODUCT_SUB;
59  const std::string vendor = VENDOR;
60  const std::string vendor_sub = VENDOR_SUB;
61  const std::string user_agent = USER_AGENT;
62 
64  std::string key_system,
65  std::vector<eme::MediaKeySystemConfiguration> configs);
66 };
67 
68 class NavigatorFactory : public BackingObjectFactory<Navigator> {
69  public:
71  ~NavigatorFactory() override;
72 };
73 
74 } // namespace js
75 } // namespace shaka
76 
77 #endif // SHAKA_EMBEDDED_JS_NAVIGATOR_H_
const std::string vendor_sub
Definition: navigator.h:60
const std::string product
Definition: navigator.h:57
const std::string vendor
Definition: navigator.h:59
const std::string app_code_name
Definition: navigator.h:54
const std::string app_version
Definition: navigator.h:55
const std::string product_sub
Definition: navigator.h:58
const std::string platform
Definition: navigator.h:56
Promise RequestMediaKeySystemAccess(std::string key_system, std::vector< eme::MediaKeySystemConfiguration > configs)
Definition: navigator.cc:31
const std::string app_name
Definition: navigator.h:53
const std::string user_agent
Definition: navigator.h:61