Shaka Player Embedded
player_externs.h
Go to the documentation of this file.
1 // Copyright 2020 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 // AUTO-GENERATED: DO NOT EDIT
16 
17 #ifndef SHAKA_EMBEDDED_INTERNAL_PLAYER_EXTERNS_H_
18 #define SHAKA_EMBEDDED_INTERNAL_PLAYER_EXTERNS_H_
19 
20 #include <string>
21 #include <vector>
22 
23 #include "shaka/optional.h"
24 #include "shaka/player_externs.h"
25 #include "src/mapping/convert_js.h"
26 #include "src/mapping/struct.h"
27 
28 namespace shaka {
29 
30 namespace js {
31 
34 
35  ADD_DICT_FIELD(start, double);
36  ADD_DICT_FIELD(end, double);
37 };
38 
39 struct BufferedInfo : Struct {
41 
42  ADD_DICT_FIELD(total, std::vector<shaka::js::BufferedRange>);
43  ADD_DICT_FIELD(audio, std::vector<shaka::js::BufferedRange>);
44  ADD_DICT_FIELD(video, std::vector<shaka::js::BufferedRange>);
45  ADD_DICT_FIELD(text, std::vector<shaka::js::BufferedRange>);
46 };
47 
48 struct LanguageRole : Struct {
50 
51  ADD_DICT_FIELD(language, std::string);
52  ADD_DICT_FIELD(role, std::string);
53 };
54 
55 
56 } // namespace js
57 
58 template <>
60  static bool FromJsValue(Handle<JsValue> source, shaka::BufferedRange* dest) {
63  return false;
64  }
65  *dest = shaka::BufferedRange(std::move(temp));
66  return true;
67  }
68 };
69 
70 template <>
72  static bool FromJsValue(Handle<JsValue> source, shaka::BufferedInfo* dest) {
75  return false;
76  }
77  *dest = shaka::BufferedInfo(std::move(temp));
78  return true;
79  }
80 };
81 
82 template <>
84  static bool FromJsValue(Handle<JsValue> source, shaka::LanguageRole* dest) {
87  return false;
88  }
89  *dest = shaka::LanguageRole(std::move(temp));
90  return true;
91  }
92 };
93 
94 
95 } // namespace shaka
96 
97 #endif // SHAKA_EMBEDDED_INTERNAL_PLAYER_EXTERNS_H_
const char * dest
Definition: media_utils.cc:31
DECLARE_STRUCT_SPECIAL_METHODS_MOVE_ONLY(BufferedRange)
const char * source
Definition: media_utils.cc:30
static bool FromJsValue(Handle< JsValue > source, shaka::BufferedInfo *dest)
ADD_DICT_FIELD(start, double)
static bool FromJsValue(Handle< JsValue > source, shaka::LanguageRole *dest)
static bool FromJsValue(Handle< JsValue > source, shaka::BufferedRange *dest)