maxcountryman_web_sys/features/
gen_MediaSource.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = MediaSource , typescript_type = "MediaSource")]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `MediaSource` class."]
9 #[doc = ""]
10 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource)"]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
13 pub type MediaSource;
14 #[cfg(feature = "SourceBufferList")]
15 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = sourceBuffers)]
16 #[doc = "Getter for the `sourceBuffers` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/sourceBuffers)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `SourceBufferList`*"]
21 pub fn source_buffers(this: &MediaSource) -> SourceBufferList;
22 #[cfg(feature = "SourceBufferList")]
23 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = activeSourceBuffers)]
24 #[doc = "Getter for the `activeSourceBuffers` field of this object."]
25 #[doc = ""]
26 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/activeSourceBuffers)"]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `SourceBufferList`*"]
29 pub fn active_source_buffers(this: &MediaSource) -> SourceBufferList;
30 #[cfg(feature = "MediaSourceReadyState")]
31 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = readyState)]
32 #[doc = "Getter for the `readyState` field of this object."]
33 #[doc = ""]
34 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/readyState)"]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `MediaSourceReadyState`*"]
37 pub fn ready_state(this: &MediaSource) -> MediaSourceReadyState;
38 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = duration)]
39 #[doc = "Getter for the `duration` field of this object."]
40 #[doc = ""]
41 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/duration)"]
42 #[doc = ""]
43 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
44 pub fn duration(this: &MediaSource) -> f64;
45 # [wasm_bindgen (structural , method , setter , js_class = "MediaSource" , js_name = duration)]
46 #[doc = "Setter for the `duration` field of this object."]
47 #[doc = ""]
48 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/duration)"]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
51 pub fn set_duration(this: &MediaSource, value: f64);
52 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = onsourceopen)]
53 #[doc = "Getter for the `onsourceopen` field of this object."]
54 #[doc = ""]
55 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceopen)"]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
58 pub fn onsourceopen(this: &MediaSource) -> Option<::js_sys::Function>;
59 # [wasm_bindgen (structural , method , setter , js_class = "MediaSource" , js_name = onsourceopen)]
60 #[doc = "Setter for the `onsourceopen` field of this object."]
61 #[doc = ""]
62 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceopen)"]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
65 pub fn set_onsourceopen(this: &MediaSource, value: Option<&::js_sys::Function>);
66 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = onsourceended)]
67 #[doc = "Getter for the `onsourceended` field of this object."]
68 #[doc = ""]
69 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceended)"]
70 #[doc = ""]
71 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
72 pub fn onsourceended(this: &MediaSource) -> Option<::js_sys::Function>;
73 # [wasm_bindgen (structural , method , setter , js_class = "MediaSource" , js_name = onsourceended)]
74 #[doc = "Setter for the `onsourceended` field of this object."]
75 #[doc = ""]
76 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceended)"]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
79 pub fn set_onsourceended(this: &MediaSource, value: Option<&::js_sys::Function>);
80 # [wasm_bindgen (structural , method , getter , js_class = "MediaSource" , js_name = onsourceclosed)]
81 #[doc = "Getter for the `onsourceclosed` field of this object."]
82 #[doc = ""]
83 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceclosed)"]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
86 pub fn onsourceclosed(this: &MediaSource) -> Option<::js_sys::Function>;
87 # [wasm_bindgen (structural , method , setter , js_class = "MediaSource" , js_name = onsourceclosed)]
88 #[doc = "Setter for the `onsourceclosed` field of this object."]
89 #[doc = ""]
90 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceclosed)"]
91 #[doc = ""]
92 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
93 pub fn set_onsourceclosed(this: &MediaSource, value: Option<&::js_sys::Function>);
94 #[wasm_bindgen(catch, constructor, js_class = "MediaSource")]
95 #[doc = "The `new MediaSource(..)` constructor, creating a new instance of `MediaSource`."]
96 #[doc = ""]
97 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/MediaSource)"]
98 #[doc = ""]
99 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
100 pub fn new() -> Result<MediaSource, JsValue>;
101 #[cfg(feature = "SourceBuffer")]
102 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = addSourceBuffer)]
103 #[doc = "The `addSourceBuffer()` method."]
104 #[doc = ""]
105 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer)"]
106 #[doc = ""]
107 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `SourceBuffer`*"]
108 pub fn add_source_buffer(this: &MediaSource, type_: &str) -> Result<SourceBuffer, JsValue>;
109 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = clearLiveSeekableRange)]
110 #[doc = "The `clearLiveSeekableRange()` method."]
111 #[doc = ""]
112 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/clearLiveSeekableRange)"]
113 #[doc = ""]
114 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
115 pub fn clear_live_seekable_range(this: &MediaSource) -> Result<(), JsValue>;
116 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = endOfStream)]
117 #[doc = "The `endOfStream()` method."]
118 #[doc = ""]
119 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream)"]
120 #[doc = ""]
121 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
122 pub fn end_of_stream(this: &MediaSource) -> Result<(), JsValue>;
123 #[cfg(feature = "MediaSourceEndOfStreamError")]
124 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = endOfStream)]
125 #[doc = "The `endOfStream()` method."]
126 #[doc = ""]
127 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream)"]
128 #[doc = ""]
129 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `MediaSourceEndOfStreamError`*"]
130 pub fn end_of_stream_with_error(
131 this: &MediaSource,
132 error: MediaSourceEndOfStreamError,
133 ) -> Result<(), JsValue>;
134 # [wasm_bindgen (static_method_of = MediaSource , js_class = "MediaSource" , js_name = isTypeSupported)]
135 #[doc = "The `isTypeSupported()` method."]
136 #[doc = ""]
137 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported)"]
138 #[doc = ""]
139 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
140 pub fn is_type_supported(type_: &str) -> bool;
141 #[cfg(feature = "SourceBuffer")]
142 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = removeSourceBuffer)]
143 #[doc = "The `removeSourceBuffer()` method."]
144 #[doc = ""]
145 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/removeSourceBuffer)"]
146 #[doc = ""]
147 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `SourceBuffer`*"]
148 pub fn remove_source_buffer(
149 this: &MediaSource,
150 source_buffer: &SourceBuffer,
151 ) -> Result<(), JsValue>;
152 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = setLiveSeekableRange)]
153 #[doc = "The `setLiveSeekableRange()` method."]
154 #[doc = ""]
155 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange)"]
156 #[doc = ""]
157 #[doc = "*This API requires the following crate features to be activated: `MediaSource`*"]
158 pub fn set_live_seekable_range(this: &MediaSource, start: f64, end: f64)
159 -> Result<(), JsValue>;
160}