web_sys/features/
gen_RtcRtpSourceEntry.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpSourceEntry)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `RtcRtpSourceEntry` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
12 pub type RtcRtpSourceEntry;
13 #[doc = "Get the `audioLevel` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
16 #[wasm_bindgen(method, getter = "audioLevel")]
17 pub fn get_audio_level(this: &RtcRtpSourceEntry) -> Option<f64>;
18 #[doc = "Change the `audioLevel` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
21 #[wasm_bindgen(method, setter = "audioLevel")]
22 pub fn set_audio_level(this: &RtcRtpSourceEntry, val: f64);
23 #[doc = "Get the `source` field of this object."]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
26 #[wasm_bindgen(method, getter = "source")]
27 pub fn get_source(this: &RtcRtpSourceEntry) -> u32;
28 #[doc = "Change the `source` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
31 #[wasm_bindgen(method, setter = "source")]
32 pub fn set_source(this: &RtcRtpSourceEntry, val: u32);
33 #[doc = "Get the `timestamp` field of this object."]
34 #[doc = ""]
35 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
36 #[wasm_bindgen(method, getter = "timestamp")]
37 pub fn get_timestamp(this: &RtcRtpSourceEntry) -> f64;
38 #[doc = "Change the `timestamp` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
41 #[wasm_bindgen(method, setter = "timestamp")]
42 pub fn set_timestamp(this: &RtcRtpSourceEntry, val: f64);
43 #[doc = "Get the `voiceActivityFlag` field of this object."]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
46 #[wasm_bindgen(method, getter = "voiceActivityFlag")]
47 pub fn get_voice_activity_flag(this: &RtcRtpSourceEntry) -> Option<bool>;
48 #[doc = "Change the `voiceActivityFlag` field of this object."]
49 #[doc = ""]
50 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`*"]
51 #[wasm_bindgen(method, setter = "voiceActivityFlag")]
52 pub fn set_voice_activity_flag(this: &RtcRtpSourceEntry, val: Option<bool>);
53 #[cfg(feature = "RtcRtpSourceEntryType")]
54 #[doc = "Get the `sourceType` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"]
57 #[wasm_bindgen(method, getter = "sourceType")]
58 pub fn get_source_type(this: &RtcRtpSourceEntry) -> RtcRtpSourceEntryType;
59 #[cfg(feature = "RtcRtpSourceEntryType")]
60 #[doc = "Change the `sourceType` field of this object."]
61 #[doc = ""]
62 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"]
63 #[wasm_bindgen(method, setter = "sourceType")]
64 pub fn set_source_type(this: &RtcRtpSourceEntry, val: RtcRtpSourceEntryType);
65}
66impl RtcRtpSourceEntry {
67 #[cfg(feature = "RtcRtpSourceEntryType")]
68 #[doc = "Construct a new `RtcRtpSourceEntry`."]
69 #[doc = ""]
70 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSourceEntry`, `RtcRtpSourceEntryType`*"]
71 pub fn new(source: u32, timestamp: f64, source_type: RtcRtpSourceEntryType) -> Self {
72 #[allow(unused_mut)]
73 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
74 ret.set_source(source);
75 ret.set_timestamp(timestamp);
76 ret.set_source_type(source_type);
77 ret
78 }
79 #[deprecated = "Use `set_audio_level()` instead."]
80 pub fn audio_level(&mut self, val: f64) -> &mut Self {
81 self.set_audio_level(val);
82 self
83 }
84 #[deprecated = "Use `set_source()` instead."]
85 pub fn source(&mut self, val: u32) -> &mut Self {
86 self.set_source(val);
87 self
88 }
89 #[deprecated = "Use `set_timestamp()` instead."]
90 pub fn timestamp(&mut self, val: f64) -> &mut Self {
91 self.set_timestamp(val);
92 self
93 }
94 #[deprecated = "Use `set_voice_activity_flag()` instead."]
95 pub fn voice_activity_flag(&mut self, val: Option<bool>) -> &mut Self {
96 self.set_voice_activity_flag(val);
97 self
98 }
99 #[cfg(feature = "RtcRtpSourceEntryType")]
100 #[deprecated = "Use `set_source_type()` instead."]
101 pub fn source_type(&mut self, val: RtcRtpSourceEntryType) -> &mut Self {
102 self.set_source_type(val);
103 self
104 }
105}