RTCRtpScriptTransformer: writable property

Baseline 2025
Newly available

Since October 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The writable read-only property of the RTCRtpScriptTransformer interface returns a WritableStream instance that can be used as a sink for encoded media frames enqueued on the corresponding RTCRtpScriptTransformer.readable.

When the corresponding RTCRtpScriptTransform is inserted into the WebRTC sender and receiver pipelines, encoded media frames (RTCEncodedVideoFrame or RTCEncodedAudioFrame) may be enqueued on the RTCRtpScriptTransformer.readable. A WebRTC encoded transform can read the frames from readable, modify them as needed, and then send them back into the WebRTC pipeline by sending them to this writable. A common way to perform this operation is to pipe the frames through a TransformStream.

Value

A WritableStream.

Examples

The following example shows how RTCRtpScriptTransformer.readable is piped through a TransformStream to RTCRtpScriptTransformer.writable.

js
addEventListener("rtctransform", (event) => {
  let transform;
  // Select a transform based on passed options
  if (event.transformer.options.name === "senderTransform")
    transform = createSenderTransform(); // A TransformStream
  else if (event.transformer.options.name === "receiverTransform")
    transform = createReceiverTransform(); // A TransformStream
  else return;

  // Pipe frames from the readable to writeable through TransformStream
  event.transformer.readable
    .pipeThrough(transform)
    .pipeTo(event.transformer.writable);
});

The code implements a handler for the rtctransform event, which is fired at the global worker object on construction of the corresponding RTCRtpScriptTransform, and when new frames are enqueued for processing. event.transformer is the RTCRtpScriptTransformer that has the writable and readable properties.

A different TransformStream is created to process outgoing and incoming frames, using createSenderTransform() or createReceiverTransform(), respectively (implementations not shown). The event handler chooses the correct transform stream to use based on options passed through from the RTCRtpScriptTransform constructor and assigns it to transform.

The code calls ReadableStream.pipeThrough() on the readable to pipe encoded frames through the selected TransformStream, and then ReadableStream.pipeTo() to pipe them to the RTCRtpScriptTransformer.writable.

Specifications

Specification
WebRTC Encoded Transform
# dom-rtcrtpscripttransformer-writable

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
writable
Chrome – Full support
Chrome 141 (Release date: 2025-09-30)
footnote Full support
Edge – Full support
Edge 141 (Release date: 2025-10-03)
footnote Full support
Firefox – Full support
Firefox 117 (Release date: 2023-08-29)
footnote Full support
Opera – Full support
Opera 125 (Release date: 2025-12-04)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Full support
Chrome Android 141 (Release date: 2025-09-30)
footnote Full support
Firefox for Android – Full support
Firefox for Android 117 (Release date: 2023-08-29)
footnote Full support
Opera Android – Full support
Opera Android 93 (Release date: 2025-11-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – Full support
WebView Android 141 (Release date: 2025-09-30)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support