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