web_sys/features/
gen_MediaKeys.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 = MediaKeys , typescript_type = "MediaKeys")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `MediaKeys` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"]
14 pub type MediaKeys;
15 # [wasm_bindgen (structural , method , getter , js_class = "MediaKeys" , js_name = keySystem)]
16 #[doc = "Getter for the `keySystem` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/keySystem)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"]
21 pub fn key_system(this: &MediaKeys) -> ::alloc::string::String;
22 #[cfg(feature = "MediaKeySession")]
23 # [wasm_bindgen (catch , method , structural , js_class = "MediaKeys" , js_name = createSession)]
24 #[doc = "The `createSession()` method."]
25 #[doc = ""]
26 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/createSession)"]
27 #[doc = ""]
28 #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`, `MediaKeys`*"]
29 pub fn create_session(this: &MediaKeys) -> Result<MediaKeySession, JsValue>;
30 #[cfg(all(feature = "MediaKeySession", feature = "MediaKeySessionType",))]
31 # [wasm_bindgen (catch , method , structural , js_class = "MediaKeys" , js_name = createSession)]
32 #[doc = "The `createSession()` method."]
33 #[doc = ""]
34 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/createSession)"]
35 #[doc = ""]
36 #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`, `MediaKeySessionType`, `MediaKeys`*"]
37 pub fn create_session_with_session_type(
38 this: &MediaKeys,
39 session_type: MediaKeySessionType,
40 ) -> Result<MediaKeySession, JsValue>;
41 # [wasm_bindgen (method , structural , js_class = "MediaKeys" , js_name = getStatusForPolicy)]
42 #[doc = "The `getStatusForPolicy()` method."]
43 #[doc = ""]
44 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/getStatusForPolicy)"]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"]
47 pub fn get_status_for_policy(this: &MediaKeys) -> ::js_sys::Promise;
48 #[cfg(feature = "MediaKeysPolicy")]
49 # [wasm_bindgen (method , structural , js_class = "MediaKeys" , js_name = getStatusForPolicy)]
50 #[doc = "The `getStatusForPolicy()` method."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/getStatusForPolicy)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`, `MediaKeysPolicy`*"]
55 pub fn get_status_for_policy_with_policy(
56 this: &MediaKeys,
57 policy: &MediaKeysPolicy,
58 ) -> ::js_sys::Promise;
59 # [wasm_bindgen (method , structural , js_class = "MediaKeys" , js_name = setServerCertificate)]
60 #[doc = "The `setServerCertificate()` method."]
61 #[doc = ""]
62 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/setServerCertificate)"]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"]
65 pub fn set_server_certificate_with_buffer_source(
66 this: &MediaKeys,
67 server_certificate: &::js_sys::Object,
68 ) -> ::js_sys::Promise;
69 # [wasm_bindgen (method , structural , js_class = "MediaKeys" , js_name = setServerCertificate)]
70 #[doc = "The `setServerCertificate()` method."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/setServerCertificate)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"]
75 pub fn set_server_certificate_with_u8_array(
76 this: &MediaKeys,
77 server_certificate: &mut [u8],
78 ) -> ::js_sys::Promise;
79 # [wasm_bindgen (method , structural , js_class = "MediaKeys" , js_name = setServerCertificate)]
80 #[doc = "The `setServerCertificate()` method."]
81 #[doc = ""]
82 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys/setServerCertificate)"]
83 #[doc = ""]
84 #[doc = "*This API requires the following crate features to be activated: `MediaKeys`*"]
85 pub fn set_server_certificate_with_js_u8_array(
86 this: &MediaKeys,
87 server_certificate: &::js_sys::Uint8Array,
88 ) -> ::js_sys::Promise;
89}