-
Notifications
You must be signed in to change notification settings - Fork 0
/
MediaKeySession.cljs
234 lines (166 loc) · 7.45 KB
/
MediaKeySession.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
(ns web.audio.MediaKeySession
"The MediaKeySession interface of the EncryptedMediaExtensions
represents a context for message exchange with a content decryption
(CDM)."
(:refer-clojure :exclude [load remove update]))
(defn close
"Method.
The MediaKeySession.close() method notifies that the current
session is no longer needed, and that the content decryption
should release any resources associated with this object and
it. Then, it returns a `js.Promise`.
`mediaKeySession.close().then(function() { ... });`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/close`"
[this & args]
(-> this .-close (.apply this (clj->js args))))
(defn generate-request
"Method.
The MediaKeySession.generateRequest() method returns a `js.Promise`
generating a media request based on initialization data.
`mediaKeySession.generateRequest().then(function) { ... });`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/generateRequest`"
[this & args]
(-> this .-generateRequest (.apply this (clj->js args))))
(defn load
"Method.
The MediaKeySession.load() method returns a `js.Promise` that
to a boolean value after loading data for a specified session
`mediaKeySession.load(sessionId).then(function(booleanValue) { ... });`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/load`"
[this session-id]
(-> this (.load session-id)))
(defn remove
"Method.
The MediaKeySession.remove() method returns a `js.Promise` after
any session data associated with the current object.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/remove`"
[this & args]
(-> this .-remove (.apply this (clj->js args))))
(defn update
"Method.
The MediaKeySession.update() method loads messages and licenses
the CDM, and then returns a `js.Promise` .
`mediaKeySession.update(response).then(function() { ... });`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/update`"
[this response]
(-> this (.update response)))
(defn closed
"Property.
The MediaKeySession.closed read-only property returns a `js.Promise`
when a `web.audio.MediaKeySession` closes. This promise can only
fulfilled and is never rejected. Closing a session means that
and keys associated with it are no longer valid for decrypting
data.
`var promise = mediaKeySessionObj.closed;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/closed`"
[this]
(-> this (.-closed)))
(defn set-closed!
"Property.
The MediaKeySession.closed read-only property returns a `js.Promise`
when a `web.audio.MediaKeySession` closes. This promise can only
fulfilled and is never rejected. Closing a session means that
and keys associated with it are no longer valid for decrypting
data.
`var promise = mediaKeySessionObj.closed;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/closed`"
[this val]
(aset this "closed" val))
(defn expiration
"Property.
The MediaKeySession.expiration read-only property returns the
after which the keys in the current session can no longer be
to decrypt media data, or NaN if no such time exists. This value
determined by the CDM and measured in milliseconds since January
1970, UTC. This value may change during a session lifetime, such
when an action triggers the start of a window.
`var expirationTime = mediaKeySessionObj.expiration;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/expiration`"
[this]
(-> this (.-expiration)))
(defn set-expiration!
"Property.
The MediaKeySession.expiration read-only property returns the
after which the keys in the current session can no longer be
to decrypt media data, or NaN if no such time exists. This value
determined by the CDM and measured in milliseconds since January
1970, UTC. This value may change during a session lifetime, such
when an action triggers the start of a window.
`var expirationTime = mediaKeySessionObj.expiration;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/expiration`"
[this val]
(aset this "expiration" val))
(defn key-statuses
"Property.
The MediaKeySession.keyStatuses read-only property returns a
to a read-only `web.media.MediaKeyStatusMap` of the current session's
and their statuses.
`var mediaKeyStatusMapObj = mediaKeySessionObj.keyStatuses;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/keyStatuses`"
[this]
(-> this (.-keyStatuses)))
(defn set-key-statuses!
"Property.
The MediaKeySession.keyStatuses read-only property returns a
to a read-only `web.media.MediaKeyStatusMap` of the current session's
and their statuses.
`var mediaKeyStatusMapObj = mediaKeySessionObj.keyStatuses;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/keyStatuses`"
[this val]
(aset this "keyStatuses" val))
(defn session-id
"Property.
The MediaKeySession.sessionId read-only property contains a unique
generated by the CDM for the current media object and its associated
or licenses.
`var sessionId = mediaKeySessionObj.sessionId;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/sessionId`"
[this]
(-> this (.-sessionId)))
(defn set-session-id!
"Property.
The MediaKeySession.sessionId read-only property contains a unique
generated by the CDM for the current media object and its associated
or licenses.
`var sessionId = mediaKeySessionObj.sessionId;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/sessionId`"
[this val]
(aset this "sessionId" val))
(defn onkeystatuseschange
"Property.
The onkeystatuseschange property of the `web.audio.MediaKeySession`
an event handler, fired whenever a keystatuschange event ocurrs,
there has been a change in the keys or their statuses within
session.
`MediaKeySession.onkeystatuseschange = function(keystatuschange) { ... }`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onkeystatuseschange`"
[this]
(-> this (.-onkeystatuseschange)))
(defn set-onkeystatuseschange!
"Property.
The onkeystatuseschange property of the `web.audio.MediaKeySession`
an event handler, fired whenever a keystatuschange event ocurrs,
there has been a change in the keys or their statuses within
session.
`MediaKeySession.onkeystatuseschange = function(keystatuschange) { ... }`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onkeystatuseschange`"
[this val]
(aset this "onkeystatuseschange" val))
(defn onmessage
"Property.
The onmessage property of the `web.audio.MediaKeySession` is
event handler, fired whenever a `web.media.MediaKeyMessageEvent`
denoting a message is generated by the content decryption module.
`MediaKeySession.onmessage = function(MediaKeyMessageEvent) { ... }`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onmessage`"
[this]
(-> this (.-onmessage)))
(defn set-onmessage!
"Property.
The onmessage property of the `web.audio.MediaKeySession` is
event handler, fired whenever a `web.media.MediaKeyMessageEvent`
denoting a message is generated by the content decryption module.
`MediaKeySession.onmessage = function(MediaKeyMessageEvent) { ... }`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/MediaKeySession/onmessage`"
[this val]
(aset this "onmessage" val))