web_sys/features/
gen_MediaStreamTrack.rs1#![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 = "MediaStreamTrack",
11 typescript_type = "MediaStreamTrack"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `MediaStreamTrack` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
19 pub type MediaStreamTrack;
20 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "kind")]
21 #[doc = "Getter for the `kind` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/kind)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
26 pub fn kind(this: &MediaStreamTrack) -> ::alloc::string::String;
27 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "id")]
28 #[doc = "Getter for the `id` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/id)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
33 pub fn id(this: &MediaStreamTrack) -> ::alloc::string::String;
34 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "label")]
35 #[doc = "Getter for the `label` field of this object."]
36 #[doc = ""]
37 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/label)"]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
40 pub fn label(this: &MediaStreamTrack) -> ::alloc::string::String;
41 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "enabled")]
42 #[doc = "Getter for the `enabled` field of this object."]
43 #[doc = ""]
44 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/enabled)"]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
47 pub fn enabled(this: &MediaStreamTrack) -> bool;
48 #[wasm_bindgen(method, setter, js_class = "MediaStreamTrack", js_name = "enabled")]
49 #[doc = "Setter for the `enabled` field of this object."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/enabled)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
54 pub fn set_enabled(this: &MediaStreamTrack, value: bool);
55 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "muted")]
56 #[doc = "Getter for the `muted` field of this object."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/muted)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
61 pub fn muted(this: &MediaStreamTrack) -> bool;
62 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "onmute")]
63 #[doc = "Getter for the `onmute` field of this object."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onmute)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
68 pub fn onmute(this: &MediaStreamTrack) -> Option<::js_sys::Function>;
69 #[wasm_bindgen(method, setter, js_class = "MediaStreamTrack", js_name = "onmute")]
70 #[doc = "Setter for the `onmute` field of this object."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onmute)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
75 pub fn set_onmute(this: &MediaStreamTrack, value: Option<&::js_sys::Function>);
76 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "onunmute")]
77 #[doc = "Getter for the `onunmute` field of this object."]
78 #[doc = ""]
79 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onunmute)"]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
82 pub fn onunmute(this: &MediaStreamTrack) -> Option<::js_sys::Function>;
83 #[wasm_bindgen(method, setter, js_class = "MediaStreamTrack", js_name = "onunmute")]
84 #[doc = "Setter for the `onunmute` field of this object."]
85 #[doc = ""]
86 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onunmute)"]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
89 pub fn set_onunmute(this: &MediaStreamTrack, value: Option<&::js_sys::Function>);
90 #[cfg(feature = "MediaStreamTrackState")]
91 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "readyState")]
92 #[doc = "Getter for the `readyState` field of this object."]
93 #[doc = ""]
94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/readyState)"]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaStreamTrackState`*"]
97 pub fn ready_state(this: &MediaStreamTrack) -> MediaStreamTrackState;
98 #[wasm_bindgen(method, getter, js_class = "MediaStreamTrack", js_name = "onended")]
99 #[doc = "Getter for the `onended` field of this object."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onended)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
104 pub fn onended(this: &MediaStreamTrack) -> Option<::js_sys::Function>;
105 #[wasm_bindgen(method, setter, js_class = "MediaStreamTrack", js_name = "onended")]
106 #[doc = "Setter for the `onended` field of this object."]
107 #[doc = ""]
108 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/onended)"]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
111 pub fn set_onended(this: &MediaStreamTrack, value: Option<&::js_sys::Function>);
112 #[wasm_bindgen(
113 catch,
114 method,
115 js_class = "MediaStreamTrack",
116 js_name = "applyConstraints"
117 )]
118 #[doc = "The `applyConstraints()` method."]
119 #[doc = ""]
120 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/applyConstraints)"]
121 #[doc = ""]
122 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
123 pub fn apply_constraints(this: &MediaStreamTrack) -> Result<::js_sys::Promise, JsValue>;
124 #[cfg(feature = "MediaTrackConstraints")]
125 #[wasm_bindgen(
126 catch,
127 method,
128 js_class = "MediaStreamTrack",
129 js_name = "applyConstraints"
130 )]
131 #[doc = "The `applyConstraints()` method."]
132 #[doc = ""]
133 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/applyConstraints)"]
134 #[doc = ""]
135 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaTrackConstraints`*"]
136 pub fn apply_constraints_with_constraints(
137 this: &MediaStreamTrack,
138 constraints: &MediaTrackConstraints,
139 ) -> Result<::js_sys::Promise, JsValue>;
140 #[wasm_bindgen(method, js_class = "MediaStreamTrack")]
141 #[doc = "The `clone()` method."]
142 #[doc = ""]
143 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/clone)"]
144 #[doc = ""]
145 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
146 pub fn clone(this: &MediaStreamTrack) -> MediaStreamTrack;
147 #[cfg(web_sys_unstable_apis)]
148 #[cfg(feature = "MediaTrackCapabilities")]
149 #[wasm_bindgen(method, js_class = "MediaStreamTrack", js_name = "getCapabilities")]
150 #[doc = "The `getCapabilities()` method."]
151 #[doc = ""]
152 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getCapabilities)"]
153 #[doc = ""]
154 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaTrackCapabilities`*"]
155 #[doc = ""]
156 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
157 #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
158 pub fn get_capabilities(this: &MediaStreamTrack) -> MediaTrackCapabilities;
159 #[cfg(feature = "MediaTrackConstraints")]
160 #[wasm_bindgen(method, js_class = "MediaStreamTrack", js_name = "getConstraints")]
161 #[doc = "The `getConstraints()` method."]
162 #[doc = ""]
163 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getConstraints)"]
164 #[doc = ""]
165 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaTrackConstraints`*"]
166 pub fn get_constraints(this: &MediaStreamTrack) -> MediaTrackConstraints;
167 #[cfg(feature = "MediaTrackSettings")]
168 #[wasm_bindgen(method, js_class = "MediaStreamTrack", js_name = "getSettings")]
169 #[doc = "The `getSettings()` method."]
170 #[doc = ""]
171 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getSettings)"]
172 #[doc = ""]
173 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`, `MediaTrackSettings`*"]
174 pub fn get_settings(this: &MediaStreamTrack) -> MediaTrackSettings;
175 #[wasm_bindgen(method, js_class = "MediaStreamTrack")]
176 #[doc = "The `stop()` method."]
177 #[doc = ""]
178 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop)"]
179 #[doc = ""]
180 #[doc = "*This API requires the following crate features to be activated: `MediaStreamTrack`*"]
181 pub fn stop(this: &MediaStreamTrack);
182}