Shaka Player Embedded
progress_event.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_EVENTS_PROGRESS_EVENT_H_
16 #define SHAKA_EMBEDDED_JS_EVENTS_PROGRESS_EVENT_H_
17 
18 #include <string>
19 
20 #include "src/js/events/event.h"
22 
23 namespace shaka {
24 namespace js {
25 namespace events {
26 
27 class ProgressEvent : public Event {
28  DECLARE_TYPE_INFO(ProgressEvent);
29 
30  public:
31  ProgressEvent(EventType, bool, double, double);
32 
33  static ProgressEvent* Create(const std::string& type) {
34  return new ProgressEvent(type, false, 0, 0);
35  }
36 
37  const bool length_computable;
38  const double loaded;
39  const double total;
40 
41  private:
42  ProgressEvent(const std::string& type, bool length_computable, double loaded,
43  double total);
44 };
45 
46 class ProgressEventFactory : public BackingObjectFactory<ProgressEvent, Event> {
47  public:
49 };
50 
51 } // namespace events
52 } // namespace js
53 } // namespace shaka
54 
55 #endif // SHAKA_EMBEDDED_JS_EVENTS_PROGRESS_EVENT_H_
ProgressEvent(EventType, bool, double, double)
static ProgressEvent * Create(const std::string &type)
const std::string type
Definition: event.h:70