Skip to content

Commit 1116548

Browse files
committed
Add API to SFrameTransform to set the crypto key
1 parent f9e6dc1 commit 1116548

File tree

2 files changed

+92
-6
lines changed

2 files changed

+92
-6
lines changed

index.bs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Similarly, if a web application sets the transform synchronously at creation of
219219

220220
# SFrameTransform # {#sframe}
221221

222-
<pre class="idl">
222+
<xmp class="idl">
223223
enum SFrameTransformRole {
224224
"encrypt",
225225
"decrypt"
@@ -232,10 +232,11 @@ dictionary SFrameTransformOptions {
232232
[Exposed=(Window,DedicatedWorker)]
233233
interface SFrameTransform {
234234
constructor(optional SFrameTransformOptions options);
235-
// FIXME: add key handling methods.
235+
236+
Promise<undefined> setEncryptionKey(CryptoKey key, optional unsigned long long keyID);
236237
};
237238
SFrameTransform includes GenericTransformStream;
238-
</pre>
239+
</xmp>
239240

240241
The <dfn constructor for="SFrameTransform" lt="SFrameTransform(options)"><code>new SFrameTransform(<var>options</var>)</code></dfn> constructor steps are:
241242
1. Let |transformAlgorithm| be an algorithm which takes a |frame| as input and runs the <a href="#sframe-transform-algorithm">SFrame transform algorithm</a> with |this| and |frame|.
@@ -262,6 +263,15 @@ The SFrame transform algorithm, given |sframe| as a SFrameTransform object and |
262263
12. If |frame| is an {{RTCEncodedVideoFrame}}, set |frame|.{{RTCEncodedVideoFrame/data}} to |buffer|.
263264
13. [=ReadableStream/Enqueue=] |frame| in |sframe|.`[[transform]]`.
264265

266+
## Methods
267+
The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> method steps are:
268+
1. Let |promise| be [=a new promise=].
269+
2. [=In parallel=], run the following steps:
270+
1. Set |key| with its optional |keyID| as key material to use for the SFrame transform algorithm, as defined by the <a href="https://datatracker.ietf.org/doc/draft-omara-sframe/">SFrame specification</a>.
271+
2. [=Resolve=] |promise| with undefined.
272+
3. Return |promise|.
273+
274+
265275
# RTCRtpScriptTransform # {#scriptTransform}
266276

267277
<pre class="idl">

0 commit comments

Comments
 (0)