web_sys/features/
gen_MediaStream.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 = "MediaStream",
11 typescript_type = "MediaStream"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `MediaStream` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
19 pub type MediaStream;
20 #[wasm_bindgen(method, getter, js_class = "MediaStream", js_name = "id")]
21 #[doc = "Getter for the `id` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/id)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
26 pub fn id(this: &MediaStream) -> ::alloc::string::String;
27 #[wasm_bindgen(method, getter, js_class = "MediaStream", js_name = "active")]
28 #[doc = "Getter for the `active` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/active)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
33 pub fn active(this: &MediaStream) -> bool;
34 #[wasm_bindgen(method, getter, js_class = "MediaStream", js_name = "onaddtrack")]
35 #[doc = "Getter for the `onaddtrack` field of this object."]
36 #[doc = ""]
37 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/onaddtrack)"]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
40 pub fn onaddtrack(this: &MediaStream) -> Option<::js_sys::Function>;
41 #[wasm_bindgen(method, setter, js_class = "MediaStream", js_name = "onaddtrack")]
42 #[doc = "Setter for the `onaddtrack` field of this object."]
43 #[doc = ""]
44 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/onaddtrack)"]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
47 pub fn set_onaddtrack(this: &MediaStream, value: Option<&::js_sys::Function>);
48 #[wasm_bindgen(method, getter, js_class = "MediaStream", js_name = "onremovetrack")]
49 #[doc = "Getter for the `onremovetrack` field of this object."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/onremovetrack)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
54 pub fn onremovetrack(this: &MediaStream) -> Option<::js_sys::Function>;
55 #[wasm_bindgen(method, setter, js_class = "MediaStream", js_name = "onremovetrack")]
56 #[doc = "Setter for the `onremovetrack` field of this object."]
57 #[doc = ""]
58 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/onremovetrack)"]
59 #[doc = ""]
60 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
61 pub fn set_onremovetrack(this: &MediaStream, value: Option<&::js_sys::Function>);
62 #[wasm_bindgen(method, getter, js_class = "MediaStream", js_name = "currentTime")]
63 #[doc = "Getter for the `currentTime` field of this object."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/currentTime)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
68 pub fn current_time(this: &MediaStream) -> f64;
69 #[wasm_bindgen(catch, constructor, js_class = "MediaStream")]
70 #[doc = "The `new MediaStream(..)` constructor, creating a new instance of `MediaStream`."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/MediaStream)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
75 pub fn new() -> Result<MediaStream, JsValue>;
76 #[wasm_bindgen(catch, constructor, js_class = "MediaStream")]
77 #[doc = "The `new MediaStream(..)` constructor, creating a new instance of `MediaStream`."]
78 #[doc = ""]
79 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/MediaStream)"]
80 #[doc = ""]
81 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
82 pub fn new_with_stream(stream: &MediaStream) -> Result<MediaStream, JsValue>;
83 #[wasm_bindgen(catch, constructor, js_class = "MediaStream")]
84 #[doc = "The `new MediaStream(..)` constructor, creating a new instance of `MediaStream`."]
85 #[doc = ""]
86 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/MediaStream)"]
87 #[doc = ""]
88 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
89 pub fn new_with_tracks(tracks: &::wasm_bindgen::JsValue) -> Result<MediaStream, JsValue>;
90 #[cfg(feature = "MediaStreamTrack")]
91 #[wasm_bindgen(method, js_class = "MediaStream", js_name = "addTrack")]
92 #[doc = "The `addTrack()` method."]
93 #[doc = ""]
94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/addTrack)"]
95 #[doc = ""]
96 #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamTrack`*"]
97 pub fn add_track(this: &MediaStream, track: &MediaStreamTrack);
98 #[wasm_bindgen(method, js_class = "MediaStream")]
99 #[doc = "The `clone()` method."]
100 #[doc = ""]
101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/clone)"]
102 #[doc = ""]
103 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
104 pub fn clone(this: &MediaStream) -> MediaStream;
105 #[wasm_bindgen(method, js_class = "MediaStream", js_name = "getAudioTracks")]
106 #[doc = "The `getAudioTracks()` method."]
107 #[doc = ""]
108 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getAudioTracks)"]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
111 pub fn get_audio_tracks(this: &MediaStream) -> ::js_sys::Array;
112 #[cfg(feature = "MediaStreamTrack")]
113 #[wasm_bindgen(method, js_class = "MediaStream", js_name = "getTrackById")]
114 #[doc = "The `getTrackById()` method."]
115 #[doc = ""]
116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getTrackById)"]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamTrack`*"]
119 pub fn get_track_by_id(this: &MediaStream, track_id: &str) -> Option<MediaStreamTrack>;
120 #[wasm_bindgen(method, js_class = "MediaStream", js_name = "getTracks")]
121 #[doc = "The `getTracks()` method."]
122 #[doc = ""]
123 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getTracks)"]
124 #[doc = ""]
125 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
126 pub fn get_tracks(this: &MediaStream) -> ::js_sys::Array;
127 #[wasm_bindgen(method, js_class = "MediaStream", js_name = "getVideoTracks")]
128 #[doc = "The `getVideoTracks()` method."]
129 #[doc = ""]
130 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/getVideoTracks)"]
131 #[doc = ""]
132 #[doc = "*This API requires the following crate features to be activated: `MediaStream`*"]
133 pub fn get_video_tracks(this: &MediaStream) -> ::js_sys::Array;
134 #[cfg(feature = "MediaStreamTrack")]
135 #[wasm_bindgen(method, js_class = "MediaStream", js_name = "removeTrack")]
136 #[doc = "The `removeTrack()` method."]
137 #[doc = ""]
138 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream/removeTrack)"]
139 #[doc = ""]
140 #[doc = "*This API requires the following crate features to be activated: `MediaStream`, `MediaStreamTrack`*"]
141 pub fn remove_track(this: &MediaStream, track: &MediaStreamTrack);
142}