Skip to main content

web_sys/features/
gen_MediaKeySession.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        extends = "EventTarget",
9        extends = "::js_sys::Object",
10        js_name = "MediaKeySession",
11        typescript_type = "MediaKeySession"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `MediaKeySession` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
19    pub type MediaKeySession;
20    #[cfg(feature = "MediaKeyError")]
21    #[wasm_bindgen(method, getter, js_class = "MediaKeySession", js_name = "error")]
22    #[doc = "Getter for the `error` field of this object."]
23    #[doc = ""]
24    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/error)"]
25    #[doc = ""]
26    #[doc = "*This API requires the following crate features to be activated: `MediaKeyError`, `MediaKeySession`*"]
27    pub fn error(this: &MediaKeySession) -> Option<MediaKeyError>;
28    #[wasm_bindgen(method, getter, js_class = "MediaKeySession", js_name = "sessionId")]
29    #[doc = "Getter for the `sessionId` field of this object."]
30    #[doc = ""]
31    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/sessionId)"]
32    #[doc = ""]
33    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
34    pub fn session_id(this: &MediaKeySession) -> ::alloc::string::String;
35    #[wasm_bindgen(method, getter, js_class = "MediaKeySession", js_name = "expiration")]
36    #[doc = "Getter for the `expiration` field of this object."]
37    #[doc = ""]
38    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/expiration)"]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
41    pub fn expiration(this: &MediaKeySession) -> f64;
42    #[wasm_bindgen(method, getter, js_class = "MediaKeySession", js_name = "closed")]
43    #[doc = "Getter for the `closed` field of this object."]
44    #[doc = ""]
45    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/closed)"]
46    #[doc = ""]
47    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
48    pub fn closed(this: &MediaKeySession) -> ::js_sys::Promise;
49    #[cfg(feature = "MediaKeyStatusMap")]
50    #[wasm_bindgen(method, getter, js_class = "MediaKeySession", js_name = "keyStatuses")]
51    #[doc = "Getter for the `keyStatuses` field of this object."]
52    #[doc = ""]
53    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/keyStatuses)"]
54    #[doc = ""]
55    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`, `MediaKeyStatusMap`*"]
56    pub fn key_statuses(this: &MediaKeySession) -> MediaKeyStatusMap;
57    #[wasm_bindgen(
58        method,
59        getter,
60        js_class = "MediaKeySession",
61        js_name = "onkeystatuseschange"
62    )]
63    #[doc = "Getter for the `onkeystatuseschange` field of this object."]
64    #[doc = ""]
65    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onkeystatuseschange)"]
66    #[doc = ""]
67    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
68    pub fn onkeystatuseschange(this: &MediaKeySession) -> Option<::js_sys::Function>;
69    #[wasm_bindgen(
70        method,
71        setter,
72        js_class = "MediaKeySession",
73        js_name = "onkeystatuseschange"
74    )]
75    #[doc = "Setter for the `onkeystatuseschange` field of this object."]
76    #[doc = ""]
77    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onkeystatuseschange)"]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
80    pub fn set_onkeystatuseschange(this: &MediaKeySession, value: Option<&::js_sys::Function>);
81    #[wasm_bindgen(method, getter, js_class = "MediaKeySession", js_name = "onmessage")]
82    #[doc = "Getter for the `onmessage` field of this object."]
83    #[doc = ""]
84    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onmessage)"]
85    #[doc = ""]
86    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
87    pub fn onmessage(this: &MediaKeySession) -> Option<::js_sys::Function>;
88    #[wasm_bindgen(method, setter, js_class = "MediaKeySession", js_name = "onmessage")]
89    #[doc = "Setter for the `onmessage` field of this object."]
90    #[doc = ""]
91    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onmessage)"]
92    #[doc = ""]
93    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
94    pub fn set_onmessage(this: &MediaKeySession, value: Option<&::js_sys::Function>);
95    #[wasm_bindgen(method, js_class = "MediaKeySession")]
96    #[doc = "The `close()` method."]
97    #[doc = ""]
98    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/close)"]
99    #[doc = ""]
100    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
101    pub fn close(this: &MediaKeySession) -> ::js_sys::Promise;
102    #[wasm_bindgen(method, js_class = "MediaKeySession", js_name = "generateRequest")]
103    #[doc = "The `generateRequest()` method."]
104    #[doc = ""]
105    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/generateRequest)"]
106    #[doc = ""]
107    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
108    pub fn generate_request_with_buffer_source(
109        this: &MediaKeySession,
110        init_data_type: &str,
111        init_data: &::js_sys::Object,
112    ) -> ::js_sys::Promise;
113    #[wasm_bindgen(method, js_class = "MediaKeySession", js_name = "generateRequest")]
114    #[doc = "The `generateRequest()` method."]
115    #[doc = ""]
116    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/generateRequest)"]
117    #[doc = ""]
118    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
119    pub fn generate_request_with_u8_array(
120        this: &MediaKeySession,
121        init_data_type: &str,
122        init_data: &mut [u8],
123    ) -> ::js_sys::Promise;
124    #[wasm_bindgen(method, js_class = "MediaKeySession", js_name = "generateRequest")]
125    #[doc = "The `generateRequest()` method."]
126    #[doc = ""]
127    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/generateRequest)"]
128    #[doc = ""]
129    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
130    pub fn generate_request_with_js_u8_array(
131        this: &MediaKeySession,
132        init_data_type: &str,
133        init_data: &::js_sys::Uint8Array,
134    ) -> ::js_sys::Promise;
135    #[wasm_bindgen(method, js_class = "MediaKeySession")]
136    #[doc = "The `load()` method."]
137    #[doc = ""]
138    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/load)"]
139    #[doc = ""]
140    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
141    pub fn load(this: &MediaKeySession, session_id: &str) -> ::js_sys::Promise;
142    #[wasm_bindgen(method, js_class = "MediaKeySession")]
143    #[doc = "The `remove()` method."]
144    #[doc = ""]
145    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/remove)"]
146    #[doc = ""]
147    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
148    pub fn remove(this: &MediaKeySession) -> ::js_sys::Promise;
149    #[wasm_bindgen(method, js_class = "MediaKeySession", js_name = "update")]
150    #[doc = "The `update()` method."]
151    #[doc = ""]
152    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/update)"]
153    #[doc = ""]
154    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
155    pub fn update_with_buffer_source(
156        this: &MediaKeySession,
157        response: &::js_sys::Object,
158    ) -> ::js_sys::Promise;
159    #[wasm_bindgen(method, js_class = "MediaKeySession", js_name = "update")]
160    #[doc = "The `update()` method."]
161    #[doc = ""]
162    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/update)"]
163    #[doc = ""]
164    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
165    pub fn update_with_u8_array(this: &MediaKeySession, response: &mut [u8]) -> ::js_sys::Promise;
166    #[wasm_bindgen(method, js_class = "MediaKeySession", js_name = "update")]
167    #[doc = "The `update()` method."]
168    #[doc = ""]
169    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/update)"]
170    #[doc = ""]
171    #[doc = "*This API requires the following crate features to be activated: `MediaKeySession`*"]
172    pub fn update_with_js_u8_array(
173        this: &MediaKeySession,
174        response: &::js_sys::Uint8Array,
175    ) -> ::js_sys::Promise;
176}