web_sys/features/
gen_MediaRecorderOptions.rs

1#![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 = MediaRecorderOptions)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `MediaRecorderOptions` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
12    pub type MediaRecorderOptions;
13    #[doc = "Get the `audioBitsPerSecond` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
16    #[wasm_bindgen(method, getter = "audioBitsPerSecond")]
17    pub fn get_audio_bits_per_second(this: &MediaRecorderOptions) -> Option<u32>;
18    #[doc = "Change the `audioBitsPerSecond` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
21    #[wasm_bindgen(method, setter = "audioBitsPerSecond")]
22    pub fn set_audio_bits_per_second(this: &MediaRecorderOptions, val: u32);
23    #[doc = "Get the `bitsPerSecond` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
26    #[wasm_bindgen(method, getter = "bitsPerSecond")]
27    pub fn get_bits_per_second(this: &MediaRecorderOptions) -> Option<u32>;
28    #[doc = "Change the `bitsPerSecond` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
31    #[wasm_bindgen(method, setter = "bitsPerSecond")]
32    pub fn set_bits_per_second(this: &MediaRecorderOptions, val: u32);
33    #[doc = "Get the `mimeType` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
36    #[wasm_bindgen(method, getter = "mimeType")]
37    pub fn get_mime_type(this: &MediaRecorderOptions) -> Option<::alloc::string::String>;
38    #[doc = "Change the `mimeType` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
41    #[wasm_bindgen(method, setter = "mimeType")]
42    pub fn set_mime_type(this: &MediaRecorderOptions, val: &str);
43    #[doc = "Get the `videoBitsPerSecond` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
46    #[wasm_bindgen(method, getter = "videoBitsPerSecond")]
47    pub fn get_video_bits_per_second(this: &MediaRecorderOptions) -> Option<u32>;
48    #[doc = "Change the `videoBitsPerSecond` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
51    #[wasm_bindgen(method, setter = "videoBitsPerSecond")]
52    pub fn set_video_bits_per_second(this: &MediaRecorderOptions, val: u32);
53}
54impl MediaRecorderOptions {
55    #[doc = "Construct a new `MediaRecorderOptions`."]
56    #[doc = ""]
57    #[doc = "*This API requires the following crate features to be activated: `MediaRecorderOptions`*"]
58    pub fn new() -> Self {
59        #[allow(unused_mut)]
60        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
61        ret
62    }
63    #[deprecated = "Use `set_audio_bits_per_second()` instead."]
64    pub fn audio_bits_per_second(&mut self, val: u32) -> &mut Self {
65        self.set_audio_bits_per_second(val);
66        self
67    }
68    #[deprecated = "Use `set_bits_per_second()` instead."]
69    pub fn bits_per_second(&mut self, val: u32) -> &mut Self {
70        self.set_bits_per_second(val);
71        self
72    }
73    #[deprecated = "Use `set_mime_type()` instead."]
74    pub fn mime_type(&mut self, val: &str) -> &mut Self {
75        self.set_mime_type(val);
76        self
77    }
78    #[deprecated = "Use `set_video_bits_per_second()` instead."]
79    pub fn video_bits_per_second(&mut self, val: u32) -> &mut Self {
80        self.set_video_bits_per_second(val);
81        self
82    }
83}
84impl Default for MediaRecorderOptions {
85    fn default() -> Self {
86        Self::new()
87    }
88}