1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::js::JS;
use dom::bindings::codegen::InheritTypes::HTMLMediaElementDerived;
use dom::bindings::error::ErrorResult;
use dom::document::Document;
use dom::element::{ElementTypeId, HTMLAudioElementTypeId, HTMLVideoElementTypeId};
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlelement::HTMLElement;
use dom::node::ElementNodeTypeId;
use servo_util::str::DOMString;
#[deriving(Encodable)]
pub struct HTMLMediaElement {
htmlelement: HTMLElement,
}
impl HTMLMediaElementDerived for EventTarget {
fn is_htmlmediaelement(&self) -> bool {
match self.type_id {
NodeTargetTypeId(ElementNodeTypeId(HTMLVideoElementTypeId)) |
NodeTargetTypeId(ElementNodeTypeId(HTMLAudioElementTypeId)) => true,
_ => false
}
}
}
impl HTMLMediaElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JS<Document>) -> HTMLMediaElement {
HTMLMediaElement {
htmlelement: HTMLElement::new_inherited(type_id, tag_name, document)
}
}
}
impl HTMLMediaElement {
pub fn Src(&self) -> DOMString {
~""
}
pub fn SetSrc(&mut self, _src: DOMString) -> ErrorResult {
Ok(())
}
pub fn CurrentSrc(&self) -> DOMString {
~""
}
pub fn CrossOrigin(&self) -> DOMString {
~""
}
pub fn SetCrossOrigin(&mut self, _cross_origin: DOMString) -> ErrorResult {
Ok(())
}
pub fn Preload(&self) -> DOMString {
~""
}
pub fn SetPreload(&mut self, _preload: DOMString) -> ErrorResult {
Ok(())
}
pub fn Load(&self) {
}
pub fn CanPlayType(&self, _type: DOMString) -> DOMString {
~""
}
pub fn ReadyState(&self) -> u16 {
0
}
pub fn Seeking(&self) -> bool {
false
}
pub fn CurrentTime(&self) -> f64 {
0f64
}
pub fn SetCurrentTime(&mut self, _current_time: f64) -> ErrorResult {
Ok(())
}
pub fn GetDuration(&self) -> f64 {
0f64
}
pub fn Paused(&self) -> bool {
false
}
pub fn DefaultPlaybackRate(&self) -> f64 {
0f64
}
pub fn SetDefaultPlaybackRate(&mut self, _default_playback_rate: f64) -> ErrorResult {
Ok(())
}
pub fn PlaybackRate(&self) -> f64 {
0f64
}
pub fn SetPlaybackRate(&mut self, _playback_rate: f64) -> ErrorResult {
Ok(())
}
pub fn Ended(&self) -> bool {
false
}
pub fn Autoplay(&self) -> bool {
false
}
pub fn SetAutoplay(&mut self, _autoplay: bool) -> ErrorResult {
Ok(())
}
pub fn Loop(&self) -> bool {
false
}
pub fn SetLoop(&mut self, _loop: bool) -> ErrorResult {
Ok(())
}
pub fn Play(&self) -> ErrorResult {
Ok(())
}
pub fn Pause(&self) -> ErrorResult {
Ok(())
}
pub fn Controls(&self) -> bool {
false
}
pub fn SetControls(&mut self, _controls: bool) -> ErrorResult {
Ok(())
}
pub fn Volume(&self) -> f64 {
0f64
}
pub fn SetVolume(&mut self, _volume: f64) -> ErrorResult {
Ok(())
}
pub fn Muted(&self) -> bool {
false
}
pub fn SetMuted(&mut self, _muted: bool) {
}
pub fn DefaultMuted(&self) -> bool {
false
}
pub fn SetDefaultMuted(&mut self, _default_muted: bool) -> ErrorResult {
Ok(())
}
}
|