Shaka Player Embedded
progress_event.cc
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 
16 
17 namespace shaka {
18 namespace js {
19 namespace events {
20 
21 ProgressEvent::ProgressEvent(EventType type, bool length_computable,
22  double loaded, double total)
23  : ProgressEvent(to_string(type), length_computable, loaded, total) {}
24 
25 ProgressEvent::ProgressEvent(const std::string& type, bool length_computable,
26  double loaded, double total)
27  : Event(type),
28  length_computable(length_computable),
29  loaded(loaded),
30  total(total) {}
31 
32 // \cond Doxygen_Skip
33 ProgressEvent::~ProgressEvent() {}
34 // \endcond Doxygen_Skip
35 
36 
38  AddReadOnlyProperty("lengthComputable", &ProgressEvent::length_computable);
39  AddReadOnlyProperty("loaded", &ProgressEvent::loaded);
40  AddReadOnlyProperty("total", &ProgressEvent::total);
41 }
42 
43 } // namespace events
44 } // namespace js
45 } // namespace shaka
ProgressEvent(EventType, bool, double, double)
std::string to_string(VideoReadyState state)
Definition: media_player.cc:32
ExceptionCode type
Event(const std::string &type)
Definition: event.cc:28
const std::string type
Definition: event.h:70