web_sys/features/
gen_RtcRtpSynchronizationSource.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 = RTCRtpSynchronizationSource)]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `RtcRtpSynchronizationSource` dictionary."]
10 #[doc = ""]
11 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"]
12 pub type RtcRtpSynchronizationSource;
13 #[doc = "Get the `audioLevel` field of this object."]
14 #[doc = ""]
15 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"]
16 #[wasm_bindgen(method, getter = "audioLevel")]
17 pub fn get_audio_level(this: &RtcRtpSynchronizationSource) -> 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: `RtcRtpSynchronizationSource`*"]
21 #[wasm_bindgen(method, setter = "audioLevel")]
22 pub fn set_audio_level(this: &RtcRtpSynchronizationSource, 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: `RtcRtpSynchronizationSource`*"]
26 #[wasm_bindgen(method, getter = "source")]
27 pub fn get_source(this: &RtcRtpSynchronizationSource) -> u32;
28 #[doc = "Change the `source` field of this object."]
29 #[doc = ""]
30 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"]
31 #[wasm_bindgen(method, setter = "source")]
32 pub fn set_source(this: &RtcRtpSynchronizationSource, 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: `RtcRtpSynchronizationSource`*"]
36 #[wasm_bindgen(method, getter = "timestamp")]
37 pub fn get_timestamp(this: &RtcRtpSynchronizationSource) -> f64;
38 #[doc = "Change the `timestamp` field of this object."]
39 #[doc = ""]
40 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"]
41 #[wasm_bindgen(method, setter = "timestamp")]
42 pub fn set_timestamp(this: &RtcRtpSynchronizationSource, 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: `RtcRtpSynchronizationSource`*"]
46 #[wasm_bindgen(method, getter = "voiceActivityFlag")]
47 pub fn get_voice_activity_flag(this: &RtcRtpSynchronizationSource) -> 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: `RtcRtpSynchronizationSource`*"]
51 #[wasm_bindgen(method, setter = "voiceActivityFlag")]
52 pub fn set_voice_activity_flag(this: &RtcRtpSynchronizationSource, val: Option<bool>);
53}
54impl RtcRtpSynchronizationSource {
55 #[doc = "Construct a new `RtcRtpSynchronizationSource`."]
56 #[doc = ""]
57 #[doc = "*This API requires the following crate features to be activated: `RtcRtpSynchronizationSource`*"]
58 pub fn new(source: u32, timestamp: f64) -> Self {
59 #[allow(unused_mut)]
60 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
61 ret.set_source(source);
62 ret.set_timestamp(timestamp);
63 ret
64 }
65 #[deprecated = "Use `set_audio_level()` instead."]
66 pub fn audio_level(&mut self, val: f64) -> &mut Self {
67 self.set_audio_level(val);
68 self
69 }
70 #[deprecated = "Use `set_source()` instead."]
71 pub fn source(&mut self, val: u32) -> &mut Self {
72 self.set_source(val);
73 self
74 }
75 #[deprecated = "Use `set_timestamp()` instead."]
76 pub fn timestamp(&mut self, val: f64) -> &mut Self {
77 self.set_timestamp(val);
78 self
79 }
80 #[deprecated = "Use `set_voice_activity_flag()` instead."]
81 pub fn voice_activity_flag(&mut self, val: Option<bool>) -> &mut Self {
82 self.set_voice_activity_flag(val);
83 self
84 }
85}