DedicatedWorkerGlobalScope: rtctransform event

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.

Note: This feature is only available in Dedicated Web Workers.

The rtctransform event is fired at a worker's DedicatedWorkerGlobalScope object when an encoded video or audio frame has been queued for processing by a WebRTC Encoded Transform.

The event's transformer property returns a RTCRtpScriptTransformer that exposes the ReadableStream on which the frame is queued, and a WritableStream where the frame can be written to inject it back into the WebRTC pipeline.

This event is not cancellable and does not bubble.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js
addEventListener("rtctransform", (event) => { })

onrtctransform = (event) => { }

Event type

A RTCTransformEvent. Inherits from Event.

Event RTCTransformEvent

Event properties

This interface also inherits properties from its parent, Event.

RTCTransformEvent.transformer Read only

Returns the RTCRtpScriptTransformer associated with the event.

Example

The following code snippet shows a handler for the rtctransform event in the worker, added to the global scope using addEventListener(). The event.transformer is a RTCRtpScriptTransformer, the worker side counterpart to RTCRtpScriptTransform.

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 rtctransform event is fired when an encoded frame is enqueued on the RTCRtpScriptTransformer and just once when the transformer's corresponding RTCRtpScriptTransformer is constructed. The code first determines what transform to apply using name value passed in the options (this allows RTCRtpScriptTransform instances added to the incoming and outgoing WebRTC pipelines to share a single worker). Encoded frames are then piped from the readable, through the selected transform TransformStream, to a writeable. The actual transforming code is not shown.

Note that this code is part of a more complete example provided in Using WebRTC Encoded Transforms.

Specifications

Specification
WebRTC Encoded Transform
# dom-dedicatedworkerglobalscope-onrtctransform

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
rtctransform event
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

See also