web_sys/features/
gen_MediaSource.rs

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