1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "SourceBuffer",
11 typescript_type = "SourceBuffer"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `SourceBuffer` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
19 pub type SourceBuffer;
20 #[cfg(feature = "SourceBufferAppendMode")]
21 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "mode")]
22 #[doc = "Getter for the `mode` field of this object."]
23 #[doc = ""]
24 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/mode)"]
25 #[doc = ""]
26 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`, `SourceBufferAppendMode`*"]
27 pub fn mode(this: &SourceBuffer) -> SourceBufferAppendMode;
28 #[cfg(feature = "SourceBufferAppendMode")]
29 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "mode")]
30 #[doc = "Setter for the `mode` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/mode)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`, `SourceBufferAppendMode`*"]
35 pub fn set_mode(this: &SourceBuffer, value: SourceBufferAppendMode);
36 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "updating")]
37 #[doc = "Getter for the `updating` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/updating)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
42 pub fn updating(this: &SourceBuffer) -> bool;
43 #[cfg(feature = "TimeRanges")]
44 #[wasm_bindgen(catch, method, getter, js_class = "SourceBuffer", js_name = "buffered")]
45 #[doc = "Getter for the `buffered` field of this object."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/buffered)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`, `TimeRanges`*"]
50 pub fn buffered(this: &SourceBuffer) -> Result<TimeRanges, JsValue>;
51 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "timestampOffset")]
52 #[doc = "Getter for the `timestampOffset` field of this object."]
53 #[doc = ""]
54 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/timestampOffset)"]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
57 pub fn timestamp_offset(this: &SourceBuffer) -> f64;
58 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "timestampOffset")]
59 #[doc = "Setter for the `timestampOffset` field of this object."]
60 #[doc = ""]
61 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/timestampOffset)"]
62 #[doc = ""]
63 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
64 pub fn set_timestamp_offset(this: &SourceBuffer, value: f64);
65 #[cfg(feature = "AudioTrackList")]
66 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "audioTracks")]
67 #[doc = "Getter for the `audioTracks` field of this object."]
68 #[doc = ""]
69 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/audioTracks)"]
70 #[doc = ""]
71 #[doc = "*This API requires the following crate features to be activated: `AudioTrackList`, `SourceBuffer`*"]
72 pub fn audio_tracks(this: &SourceBuffer) -> AudioTrackList;
73 #[cfg(feature = "VideoTrackList")]
74 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "videoTracks")]
75 #[doc = "Getter for the `videoTracks` field of this object."]
76 #[doc = ""]
77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/videoTracks)"]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`, `VideoTrackList`*"]
80 pub fn video_tracks(this: &SourceBuffer) -> VideoTrackList;
81 #[cfg(feature = "TextTrackList")]
82 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "textTracks")]
83 #[doc = "Getter for the `textTracks` field of this object."]
84 #[doc = ""]
85 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/textTracks)"]
86 #[doc = ""]
87 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`, `TextTrackList`*"]
88 pub fn text_tracks(this: &SourceBuffer) -> TextTrackList;
89 #[wasm_bindgen(
90 method,
91 getter,
92 js_class = "SourceBuffer",
93 js_name = "appendWindowStart"
94 )]
95 #[doc = "Getter for the `appendWindowStart` field of this object."]
96 #[doc = ""]
97 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowStart)"]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
100 pub fn append_window_start(this: &SourceBuffer) -> f64;
101 #[wasm_bindgen(
102 method,
103 setter,
104 js_class = "SourceBuffer",
105 js_name = "appendWindowStart"
106 )]
107 #[doc = "Setter for the `appendWindowStart` field of this object."]
108 #[doc = ""]
109 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowStart)"]
110 #[doc = ""]
111 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
112 pub fn set_append_window_start(this: &SourceBuffer, value: f64);
113 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "appendWindowEnd")]
114 #[doc = "Getter for the `appendWindowEnd` field of this object."]
115 #[doc = ""]
116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowEnd)"]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
119 pub fn append_window_end(this: &SourceBuffer) -> f64;
120 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "appendWindowEnd")]
121 #[doc = "Setter for the `appendWindowEnd` field of this object."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendWindowEnd)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
126 pub fn set_append_window_end(this: &SourceBuffer, value: f64);
127 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "onupdatestart")]
128 #[doc = "Getter for the `onupdatestart` field of this object."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onupdatestart)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
133 pub fn onupdatestart(this: &SourceBuffer) -> Option<::js_sys::Function>;
134 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "onupdatestart")]
135 #[doc = "Setter for the `onupdatestart` field of this object."]
136 #[doc = ""]
137 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onupdatestart)"]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
140 pub fn set_onupdatestart(this: &SourceBuffer, value: Option<&::js_sys::Function>);
141 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "onupdate")]
142 #[doc = "Getter for the `onupdate` field of this object."]
143 #[doc = ""]
144 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onupdate)"]
145 #[doc = ""]
146 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
147 pub fn onupdate(this: &SourceBuffer) -> Option<::js_sys::Function>;
148 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "onupdate")]
149 #[doc = "Setter for the `onupdate` field of this object."]
150 #[doc = ""]
151 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onupdate)"]
152 #[doc = ""]
153 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
154 pub fn set_onupdate(this: &SourceBuffer, value: Option<&::js_sys::Function>);
155 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "onupdateend")]
156 #[doc = "Getter for the `onupdateend` field of this object."]
157 #[doc = ""]
158 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onupdateend)"]
159 #[doc = ""]
160 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
161 pub fn onupdateend(this: &SourceBuffer) -> Option<::js_sys::Function>;
162 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "onupdateend")]
163 #[doc = "Setter for the `onupdateend` field of this object."]
164 #[doc = ""]
165 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onupdateend)"]
166 #[doc = ""]
167 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
168 pub fn set_onupdateend(this: &SourceBuffer, value: Option<&::js_sys::Function>);
169 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "onerror")]
170 #[doc = "Getter for the `onerror` field of this object."]
171 #[doc = ""]
172 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onerror)"]
173 #[doc = ""]
174 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
175 pub fn onerror(this: &SourceBuffer) -> Option<::js_sys::Function>;
176 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "onerror")]
177 #[doc = "Setter for the `onerror` field of this object."]
178 #[doc = ""]
179 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onerror)"]
180 #[doc = ""]
181 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
182 pub fn set_onerror(this: &SourceBuffer, value: Option<&::js_sys::Function>);
183 #[wasm_bindgen(method, getter, js_class = "SourceBuffer", js_name = "onabort")]
184 #[doc = "Getter for the `onabort` field of this object."]
185 #[doc = ""]
186 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onabort)"]
187 #[doc = ""]
188 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
189 pub fn onabort(this: &SourceBuffer) -> Option<::js_sys::Function>;
190 #[wasm_bindgen(method, setter, js_class = "SourceBuffer", js_name = "onabort")]
191 #[doc = "Setter for the `onabort` field of this object."]
192 #[doc = ""]
193 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/onabort)"]
194 #[doc = ""]
195 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
196 pub fn set_onabort(this: &SourceBuffer, value: Option<&::js_sys::Function>);
197 #[wasm_bindgen(catch, method, js_class = "SourceBuffer")]
198 #[doc = "The `abort()` method."]
199 #[doc = ""]
200 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/abort)"]
201 #[doc = ""]
202 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
203 pub fn abort(this: &SourceBuffer) -> Result<(), JsValue>;
204 #[wasm_bindgen(catch, method, js_class = "SourceBuffer", js_name = "appendBuffer")]
205 #[doc = "The `appendBuffer()` method."]
206 #[doc = ""]
207 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer)"]
208 #[doc = ""]
209 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
210 pub fn append_buffer_with_array_buffer(
211 this: &SourceBuffer,
212 data: &::js_sys::ArrayBuffer,
213 ) -> Result<(), JsValue>;
214 #[wasm_bindgen(catch, method, js_class = "SourceBuffer", js_name = "appendBuffer")]
215 #[doc = "The `appendBuffer()` method."]
216 #[doc = ""]
217 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer)"]
218 #[doc = ""]
219 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
220 pub fn append_buffer_with_array_buffer_view(
221 this: &SourceBuffer,
222 data: &::js_sys::Object,
223 ) -> Result<(), JsValue>;
224 #[wasm_bindgen(catch, method, js_class = "SourceBuffer", js_name = "appendBuffer")]
225 #[doc = "The `appendBuffer()` method."]
226 #[doc = ""]
227 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer)"]
228 #[doc = ""]
229 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
230 pub fn append_buffer_with_u8_array(this: &SourceBuffer, data: &mut [u8])
231 -> Result<(), JsValue>;
232 #[wasm_bindgen(catch, method, js_class = "SourceBuffer", js_name = "appendBuffer")]
233 #[doc = "The `appendBuffer()` method."]
234 #[doc = ""]
235 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer)"]
236 #[doc = ""]
237 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
238 pub fn append_buffer_with_js_u8_array(
239 this: &SourceBuffer,
240 data: &::js_sys::Uint8Array,
241 ) -> Result<(), JsValue>;
242 #[wasm_bindgen(
243 catch,
244 method,
245 js_class = "SourceBuffer",
246 js_name = "appendBufferAsync"
247 )]
248 #[doc = "The `appendBufferAsync()` method."]
249 #[doc = ""]
250 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBufferAsync)"]
251 #[doc = ""]
252 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
253 pub fn append_buffer_async_with_array_buffer(
254 this: &SourceBuffer,
255 data: &::js_sys::ArrayBuffer,
256 ) -> Result<::js_sys::Promise, JsValue>;
257 #[wasm_bindgen(
258 catch,
259 method,
260 js_class = "SourceBuffer",
261 js_name = "appendBufferAsync"
262 )]
263 #[doc = "The `appendBufferAsync()` method."]
264 #[doc = ""]
265 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBufferAsync)"]
266 #[doc = ""]
267 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
268 pub fn append_buffer_async_with_array_buffer_view(
269 this: &SourceBuffer,
270 data: &::js_sys::Object,
271 ) -> Result<::js_sys::Promise, JsValue>;
272 #[wasm_bindgen(
273 catch,
274 method,
275 js_class = "SourceBuffer",
276 js_name = "appendBufferAsync"
277 )]
278 #[doc = "The `appendBufferAsync()` method."]
279 #[doc = ""]
280 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBufferAsync)"]
281 #[doc = ""]
282 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
283 pub fn append_buffer_async_with_u8_array(
284 this: &SourceBuffer,
285 data: &mut [u8],
286 ) -> Result<::js_sys::Promise, JsValue>;
287 #[wasm_bindgen(
288 catch,
289 method,
290 js_class = "SourceBuffer",
291 js_name = "appendBufferAsync"
292 )]
293 #[doc = "The `appendBufferAsync()` method."]
294 #[doc = ""]
295 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBufferAsync)"]
296 #[doc = ""]
297 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
298 pub fn append_buffer_async_with_js_u8_array(
299 this: &SourceBuffer,
300 data: &::js_sys::Uint8Array,
301 ) -> Result<::js_sys::Promise, JsValue>;
302 #[wasm_bindgen(catch, method, js_class = "SourceBuffer", js_name = "changeType")]
303 #[doc = "The `changeType()` method."]
304 #[doc = ""]
305 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/changeType)"]
306 #[doc = ""]
307 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
308 pub fn change_type(this: &SourceBuffer, type_: &str) -> Result<(), JsValue>;
309 #[wasm_bindgen(catch, method, js_class = "SourceBuffer")]
310 #[doc = "The `remove()` method."]
311 #[doc = ""]
312 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/remove)"]
313 #[doc = ""]
314 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
315 pub fn remove(this: &SourceBuffer, start: f64, end: f64) -> Result<(), JsValue>;
316 #[wasm_bindgen(catch, method, js_class = "SourceBuffer", js_name = "removeAsync")]
317 #[doc = "The `removeAsync()` method."]
318 #[doc = ""]
319 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/removeAsync)"]
320 #[doc = ""]
321 #[doc = "*This API requires the following crate features to be activated: `SourceBuffer`*"]
322 pub fn remove_async(
323 this: &SourceBuffer,
324 start: f64,
325 end: f64,
326 ) -> Result<::js_sys::Promise, JsValue>;
327}