Shaka Player Embedded
video_element.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 #ifndef SHAKA_EMBEDDED_JS_MSE_VIDEO_ELEMENT_H_
16 #define SHAKA_EMBEDDED_JS_MSE_VIDEO_ELEMENT_H_
17 
18 #include <unordered_set>
19 
21 #include "src/core/ref_ptr.h"
25 #include "src/mapping/struct.h"
26 
27 namespace shaka {
28 namespace js {
29 namespace mse {
30 
33 
34  ADD_DICT_FIELD(creationTime, double);
35  ADD_DICT_FIELD(totalVideoFrames, uint64_t);
36  ADD_DICT_FIELD(droppedVideoFrames, uint64_t);
37  ADD_DICT_FIELD(corruptedVideoFrames, uint64_t);
38 };
39 
42 
43  public:
45  media::MediaPlayer* player);
46 
47  static RefPtr<HTMLVideoElement> AnyVideoElement();
48  static media::MediaPlayer* AnyMediaPlayer();
49 
50  ExceptionOr<VideoPlaybackQuality> GetVideoPlaybackQuality() const;
51 
52  private:
53  static std::unordered_set<HTMLVideoElement*> g_video_elements_;
54 };
55 
57  : public BackingObjectFactory<HTMLVideoElement, HTMLMediaElement> {
58  public:
60 };
61 
62 } // namespace mse
63 } // namespace js
64 } // namespace shaka
65 
66 #endif // SHAKA_EMBEDDED_JS_MSE_VIDEO_ELEMENT_H_
DECLARE_STRUCT_SPECIAL_METHODS_COPYABLE(VideoPlaybackQuality)
#define DECLARE_TYPE_INFO(type)
ADD_DICT_FIELD(creationTime, double)