Skip to content

Commit

Permalink
Editorial: Update WebRTC endpoint pair example
Browse files Browse the repository at this point in the history
Closes #1317.
  • Loading branch information
jan-ivar committed Jul 12, 2024
1 parent 53f7c7d commit f63ec41
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7464,14 +7464,13 @@ web developer code insert [=transform streams=] into the middle of them.

<xmp highlight="js">
const { readable, writable } = createEndpointPair();
readable.pipeThrough(new TransformStream(...)).pipeTo(writable);
await readable.pipeThrough(new TransformStream(...)).pipeTo(writable);
</xmp>
</div>

<p class="example" id="example-endpoint-pair-webrtc"><cite>WebRTC Insertable Media using
Streams</cite> is an example of this technique, with its `sender.createEncodedStreams()` and
`receiver.createEncodedStreams()` methods.
<!-- TODO cite it and cross-link to it https://github.com/tobie/specref/issues/620 -->
<p class="example" id="example-endpoint-pair-webrtc"><cite>WebRTC Encoded Transform</cite>
is an example of this technique, with its {{RTCRtpScriptTransformer}} interface which has
both `readable` and `writable` attributes.

Despite such endpoint pairs obeying the `readable`/`writable` property contract, it never makes
sense to pass them to {{ReadableStream/pipeThrough()}}.
Expand Down

0 comments on commit f63ec41

Please sign in to comment.