1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = :: js_sys :: Object , js_name = RTCRtpContributingSource)]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `RtcRtpContributingSource` dictionary."]
9     #[doc = ""]
10     #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
11     pub type RtcRtpContributingSource;
12 }
13 impl RtcRtpContributingSource {
14     #[doc = "Construct a new `RtcRtpContributingSource`."]
15     #[doc = ""]
16     #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
new(source: u32, timestamp: f64) -> Self17     pub fn new(source: u32, timestamp: f64) -> Self {
18         #[allow(unused_mut)]
19         let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
20         ret.source(source);
21         ret.timestamp(timestamp);
22         ret
23     }
24     #[doc = "Change the `audioLevel` field of this object."]
25     #[doc = ""]
26     #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
audio_level(&mut self, val: f64) -> &mut Self27     pub fn audio_level(&mut self, val: f64) -> &mut Self {
28         use wasm_bindgen::JsValue;
29         let r = ::js_sys::Reflect::set(
30             self.as_ref(),
31             &JsValue::from("audioLevel"),
32             &JsValue::from(val),
33         );
34         debug_assert!(
35             r.is_ok(),
36             "setting properties should never fail on our dictionary objects"
37         );
38         let _ = r;
39         self
40     }
41     #[doc = "Change the `source` field of this object."]
42     #[doc = ""]
43     #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
source(&mut self, val: u32) -> &mut Self44     pub fn source(&mut self, val: u32) -> &mut Self {
45         use wasm_bindgen::JsValue;
46         let r =
47             ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("source"), &JsValue::from(val));
48         debug_assert!(
49             r.is_ok(),
50             "setting properties should never fail on our dictionary objects"
51         );
52         let _ = r;
53         self
54     }
55     #[doc = "Change the `timestamp` field of this object."]
56     #[doc = ""]
57     #[doc = "*This API requires the following crate features to be activated: `RtcRtpContributingSource`*"]
timestamp(&mut self, val: f64) -> &mut Self58     pub fn timestamp(&mut self, val: f64) -> &mut Self {
59         use wasm_bindgen::JsValue;
60         let r = ::js_sys::Reflect::set(
61             self.as_ref(),
62             &JsValue::from("timestamp"),
63             &JsValue::from(val),
64         );
65         debug_assert!(
66             r.is_ok(),
67             "setting properties should never fail on our dictionary objects"
68         );
69         let _ = r;
70         self
71     }
72 }
73