1 #![allow(unused_imports)]
4 use wasm_bindgen
::prelude
::*;
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."]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource)"]
13 #[doc = "*This API requires the following crate features to be activated: `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."]
19 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/sourceBuffers)"]
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."]
27 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/activeSourceBuffers)"]
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."]
35 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/readyState)"]
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."]
42 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/duration)"]
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."]
49 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/duration)"]
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."]
56 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceopen)"]
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."]
63 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceopen)"]
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."]
70 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceended)"]
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."]
77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceended)"]
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."]
84 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceclose)"]
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."]
91 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/onsourceclose)"]
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`."]
98 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/MediaSource)"]
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."]
106 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer)"]
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."]
113 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/clearLiveSeekableRange)"]
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."]
120 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream)"]
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."]
128 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/endOfStream)"]
130 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `MediaSourceEndOfStreamError`*"]
131 pub fn end_of_stream_with_error(
133 error
: MediaSourceEndOfStreamError
,
134 ) -> Result
<(), JsValue
>;
135 # [wasm_bindgen (static_method_of = MediaSource , js_class = "MediaSource" , js_name = isTypeSupported)]
136 #[doc = "The `isTypeSupported()` method."]
138 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/isTypeSupported)"]
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."]
146 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/removeSourceBuffer)"]
148 #[doc = "*This API requires the following crate features to be activated: `MediaSource`, `SourceBuffer`*"]
149 pub fn remove_source_buffer(
151 source_buffer
: &SourceBuffer
,
152 ) -> Result
<(), JsValue
>;
153 # [wasm_bindgen (catch , method , structural , js_class = "MediaSource" , js_name = setLiveSeekableRange)]
154 #[doc = "The `setLiveSeekableRange()` method."]
156 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange)"]
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
>;