# Event objects

The event objects that [`webrtc.EventTarget`](../events.md#webrtc.utils.events.EventTarget) handlers are called with, and their init dictionaries.

### *class* webrtc.models.events.Event(type)

An event of a WebRTC object. Events that carry nothing but their name are of this class.

See [MDN: Event](https://developer.mozilla.org/en-US/docs/Web/API/Event).

* **Parameters:**
  **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event, like `'signalingstatechange'`.

#### type

The name of the event. See [MDN: Event/type](https://developer.mozilla.org/en-US/docs/Web/API/Event/type).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

#### target

The object that emitted the event, or [`None`](https://docs.python.org/3/builtins/constants.html#None) until
it’s dispatched. See [MDN: Event/target](https://developer.mozilla.org/en-US/docs/Web/API/Event/target).

* **Type:**
  [`webrtc.EventTarget`](../events.md#webrtc.utils.events.EventTarget), optional

### *class* webrtc.models.events.RTCPeerConnectionIceEventInit(candidate=None, url=None)

The members of an [`RTCPeerConnectionIceEvent`](#webrtc.models.events.RTCPeerConnectionIceEvent).

See [MDN: RTCPeerConnectionIceEvent/RTCPeerConnectionIceEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceEvent/RTCPeerConnectionIceEvent).

* **Parameters:**
  * **candidate** ([`webrtc.RTCIceCandidate`](rtc_ice_candidate.md#webrtc.models.rtc_ice_candidate.RTCIceCandidate), optional) – The gathered candidate, or [`None`](https://docs.python.org/3/builtins/constants.html#None) when gathering
    has ended.
  * **url** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional) – The address of the STUN or TURN server that found the candidate.

### *class* webrtc.models.events.RTCPeerConnectionIceEvent(type, event_init_dict=None)

An `icecandidate` event of [`webrtc.RTCPeerConnection`](../interfaces/rtc_peer_connection.md#webrtc.interfaces.rtc_peer_connection.RTCPeerConnection) or [`webrtc.RTCIceTransport`](../interfaces/rtc_ice_transport.md#webrtc.interfaces.rtc_ice_transport.RTCIceTransport).

It’s fired when a candidate is gathered and should be sent to the remote peer. The last event has no candidate
and marks the end of gathering.

See [MDN: RTCPeerConnectionIceEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`RTCPeerConnectionIceEventInit`](#webrtc.models.events.RTCPeerConnectionIceEventInit), optional) – The members of the event.

#### candidate *: [webrtc.RTCIceCandidate](rtc_ice_candidate.md#webrtc.models.rtc_ice_candidate.RTCIceCandidate) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The gathered candidate, or [`None`](https://docs.python.org/3/builtins/constants.html#None) when gathering has ended.
See [MDN: RTCPeerConnectionIceEvent/candidate](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceEvent/candidate).

* **Type:**
  [`webrtc.RTCIceCandidate`](rtc_ice_candidate.md#webrtc.models.rtc_ice_candidate.RTCIceCandidate), optional

#### url *: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The address of the STUN or TURN server that found the candidate. Events of an
[`webrtc.RTCIceTransport`](../interfaces/rtc_ice_transport.md#webrtc.interfaces.rtc_ice_transport.RTCIceTransport) don’t set it. See [MDN: RTCPeerConnectionIceEvent/url](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceEvent/url).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional

### *class* webrtc.models.events.RTCPeerConnectionIceErrorEventInit(error_code, address=None, port=None, url='', error_text='')

The members of an [`RTCPeerConnectionIceErrorEvent`](#webrtc.models.events.RTCPeerConnectionIceErrorEvent).

See [MDN: RTCPeerConnectionIceErrorEvent/RTCPeerConnectionIceErrorEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/RTCPeerConnectionIceErrorEvent).

* **Parameters:**
  * **error_code** ([`int`](https://docs.python.org/3/builtins/functions.html#int)) – The STUN or TURN error code, or 701 if the server couldn’t be reached.
  * **address** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional) – The local address the server was contacted from.
  * **port** ([`int`](https://docs.python.org/3/builtins/functions.html#int), optional) – The local port the server was contacted from.
  * **url** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional) – The URL of the server.
  * **error_text** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional) – The reason text of the server’s response.

### *class* webrtc.models.events.RTCPeerConnectionIceErrorEvent(type, event_init_dict)

An `icecandidateerror` event of [`webrtc.RTCPeerConnection`](../interfaces/rtc_peer_connection.md#webrtc.interfaces.rtc_peer_connection.RTCPeerConnection).

It’s fired when gathering from a STUN or TURN server fails. Gathering goes on with the other servers and
interfaces.

See [MDN: RTCPeerConnectionIceErrorEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`RTCPeerConnectionIceErrorEventInit`](#webrtc.models.events.RTCPeerConnectionIceErrorEventInit)) – The members of the event.

#### address *: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The local address the server was contacted from, or [`None`](https://docs.python.org/3/builtins/constants.html#None) if it isn’t known.
See [MDN: RTCPeerConnectionIceErrorEvent/address](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/address).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional

#### port *: [int](https://docs.python.org/3/builtins/functions.html#int) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The local port the server was contacted from, or [`None`](https://docs.python.org/3/builtins/constants.html#None) if it isn’t known.
See [MDN: RTCPeerConnectionIceErrorEvent/port](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/port).

* **Type:**
  [`int`](https://docs.python.org/3/builtins/functions.html#int), optional

#### url *: [str](https://docs.python.org/3/builtins/stdtypes.html#str)*

The URL of the server. See [MDN: RTCPeerConnectionIceErrorEvent/url](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/url).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

#### error_code *: [int](https://docs.python.org/3/builtins/functions.html#int)*

The STUN or TURN error code, or 701 if the server couldn’t be reached.
See [MDN: RTCPeerConnectionIceErrorEvent/errorCode](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorCode).

* **Type:**
  [`int`](https://docs.python.org/3/builtins/functions.html#int)

#### error_text *: [str](https://docs.python.org/3/builtins/stdtypes.html#str)*

The reason text of the server’s response. See [MDN: RTCPeerConnectionIceErrorEvent/errorText](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnectionIceErrorEvent/errorText).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

### *class* webrtc.models.events.MessageEvent(type, data)

A `message` event of [`webrtc.RTCDataChannel`](../interfaces/rtc_data_channel.md#webrtc.interfaces.rtc_data_channel.RTCDataChannel), fired when a message is received.

See [MDN: MessageEvent](https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **data** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes) or [`webrtc.Blob`](blob.md#webrtc.models.blob.Blob)) – The message.

#### data *: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [bytes](https://docs.python.org/3/builtins/stdtypes.html#bytes) | [webrtc.Blob](blob.md#webrtc.models.blob.Blob)*

The message. It’s a [`str`](https://docs.python.org/3/builtins/stdtypes.html#str) if it was sent as text.
Otherwise it’s [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes), or a [`webrtc.Blob`](blob.md#webrtc.models.blob.Blob) with the `blob` binary type.
See [MDN: MessageEvent/data](https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/data).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str), [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes) or [`webrtc.Blob`](blob.md#webrtc.models.blob.Blob)

### *class* webrtc.models.events.RTCDataChannelEventInit(channel)

The members of an [`RTCDataChannelEvent`](#webrtc.models.events.RTCDataChannelEvent).

See [MDN: RTCDataChannelEvent/RTCDataChannelEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannelEvent/RTCDataChannelEvent).

* **Parameters:**
  **channel** ([`webrtc.RTCDataChannel`](../interfaces/rtc_data_channel.md#webrtc.interfaces.rtc_data_channel.RTCDataChannel)) – The channel the remote peer created.

### *class* webrtc.models.events.RTCDataChannelEvent(type, event_init_dict)

A `datachannel` event of [`webrtc.RTCPeerConnection`](../interfaces/rtc_peer_connection.md#webrtc.interfaces.rtc_peer_connection.RTCPeerConnection), fired when the remote peer creates a channel.

See [MDN: RTCDataChannelEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannelEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`RTCDataChannelEventInit`](#webrtc.models.events.RTCDataChannelEventInit)) – The members of the event.

#### channel *: [webrtc.RTCDataChannel](../interfaces/rtc_data_channel.md#webrtc.interfaces.rtc_data_channel.RTCDataChannel)*

The channel the remote peer created. See [MDN: RTCDataChannelEvent/channel](https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannelEvent/channel).

* **Type:**
  [`webrtc.RTCDataChannel`](../interfaces/rtc_data_channel.md#webrtc.interfaces.rtc_data_channel.RTCDataChannel)

### *class* webrtc.models.events.MediaStreamTrackEventInit(track)

The members of a [`MediaStreamTrackEvent`](#webrtc.models.events.MediaStreamTrackEvent).

See [MDN: MediaStreamTrackEvent/MediaStreamTrackEvent](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackEvent/MediaStreamTrackEvent).

* **Parameters:**
  **track** ([`webrtc.MediaStreamTrack`](../interfaces/media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)) – The track added to or removed from the stream.

### *class* webrtc.models.events.MediaStreamTrackEvent(type, event_init_dict)

An `addtrack` or `removetrack` event of [`webrtc.MediaStream`](../interfaces/media_stream.md#webrtc.interfaces.media_stream.MediaStream).

It’s fired when the remote peer changes the tracks of the stream.

See [MDN: MediaStreamTrackEvent](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`MediaStreamTrackEventInit`](#webrtc.models.events.MediaStreamTrackEventInit)) – The members of the event.

#### track *: [webrtc.MediaStreamTrack](../interfaces/media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)*

The track added to or removed from the stream.
See [MDN: MediaStreamTrackEvent/track](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrackEvent/track).

* **Type:**
  [`webrtc.MediaStreamTrack`](../interfaces/media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)

### *class* webrtc.models.events.RTCDTMFToneChangeEventInit(tone='')

The members of an [`RTCDTMFToneChangeEvent`](#webrtc.models.events.RTCDTMFToneChangeEvent).

See [MDN: RTCDTMFToneChangeEvent/RTCDTMFToneChangeEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFToneChangeEvent/RTCDTMFToneChangeEvent).

* **Parameters:**
  **tone** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional) – The tone that started playing, or empty when the queue ran out.

### *class* webrtc.models.events.RTCDTMFToneChangeEvent(type, event_init_dict=None)

A `tonechange` event of [`webrtc.RTCDTMFSender`](../interfaces/rtc_dtmf_sender.md#webrtc.interfaces.rtc_dtmf_sender.RTCDTMFSender), fired when a tone starts playing or the queue runs out.

See [MDN: RTCDTMFToneChangeEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFToneChangeEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`RTCDTMFToneChangeEventInit`](#webrtc.models.events.RTCDTMFToneChangeEventInit), optional) – The members of the event.

#### tone *: [str](https://docs.python.org/3/builtins/stdtypes.html#str)*

The tone that started playing, like `'1'`, or `','` for a pause. It’s empty when the queue
ran out. See [MDN: RTCDTMFToneChangeEvent/tone](https://developer.mozilla.org/en-US/docs/Web/API/RTCDTMFToneChangeEvent/tone).

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str)

### *class* webrtc.models.events.DeviceChangeEventInit(devices=<factory>)

The members of a [`DeviceChangeEvent`](#webrtc.models.events.DeviceChangeEvent).

* **Parameters:**
  **devices** ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.MediaDeviceInfo`](../interfaces/media_devices.md#webrtc.interfaces.media_devices.MediaDeviceInfo), optional) – The devices after the change.

### *class* webrtc.models.events.DeviceChangeEvent(type, event_init_dict=None)

A `devicechange` event of [`webrtc.MediaDevices`](../interfaces/media_devices.md#webrtc.interfaces.media_devices.MediaDevices).

It’s never fired, because the devices of this library are fixed.

See [MDN: MediaDevices/devicechange_event](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/devicechange_event).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`DeviceChangeEventInit`](#webrtc.models.events.DeviceChangeEventInit), optional) – The members of the event.

#### devices *: [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[webrtc.MediaDeviceInfo](../interfaces/media_devices.md#webrtc.interfaces.media_devices.MediaDeviceInfo)]*

The devices after the change.

* **Type:**
  [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.MediaDeviceInfo`](../interfaces/media_devices.md#webrtc.interfaces.media_devices.MediaDeviceInfo)

#### user_inserted_devices *: [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[webrtc.MediaDeviceInfo](../interfaces/media_devices.md#webrtc.interfaces.media_devices.MediaDeviceInfo)]*

The devices the user connected. It’s always empty.

* **Type:**
  [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.MediaDeviceInfo`](../interfaces/media_devices.md#webrtc.interfaces.media_devices.MediaDeviceInfo)

### *class* webrtc.models.events.RTCErrorEventInit(error)

The members of an [`RTCErrorEvent`](#webrtc.models.events.RTCErrorEvent).

See [MDN: RTCErrorEvent/RTCErrorEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCErrorEvent/RTCErrorEvent).

* **Parameters:**
  **error** ([`webrtc.RTCError`](../exceptions.md#webrtc.exceptions.RTCError)) – The error that occurred.

### *class* webrtc.models.events.RTCErrorEvent(type, event_init_dict)

An `error` event of [`webrtc.RTCDataChannel`](../interfaces/rtc_data_channel.md#webrtc.interfaces.rtc_data_channel.RTCDataChannel) or [`webrtc.RTCDtlsTransport`](../interfaces/rtc_dtls_transport.md#webrtc.interfaces.rtc_dtls_transport.RTCDtlsTransport).

See [MDN: RTCErrorEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCErrorEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`RTCErrorEventInit`](#webrtc.models.events.RTCErrorEventInit)) – The members of the event.

#### error *: [webrtc.RTCError](../exceptions.md#webrtc.exceptions.RTCError)*

The error that occurred, with its detail. See [MDN: RTCErrorEvent/error](https://developer.mozilla.org/en-US/docs/Web/API/RTCErrorEvent/error).

* **Type:**
  [`webrtc.RTCError`](../exceptions.md#webrtc.exceptions.RTCError)

### *class* webrtc.models.events.RTCTrackEventInit(receiver, track, transceiver, streams=<factory>)

The members of an [`RTCTrackEvent`](#webrtc.models.events.RTCTrackEvent).

See [MDN: RTCTrackEvent/RTCTrackEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent/RTCTrackEvent).

* **Parameters:**
  * **receiver** ([`webrtc.RTCRtpReceiver`](../interfaces/rtc_rtp_receiver.md#webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver)) – The receiver of the track.
  * **track** ([`webrtc.MediaStreamTrack`](../interfaces/media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)) – The remote track.
  * **transceiver** ([`webrtc.RTCRtpTransceiver`](../interfaces/rtc_rtp_transceiver.md#webrtc.interfaces.rtc_rtp_transceiver.RTCRtpTransceiver)) – The transceiver of the receiver.
  * **streams** ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.MediaStream`](../interfaces/media_stream.md#webrtc.interfaces.media_stream.MediaStream), optional) – The remote streams the track is in.

### *class* webrtc.models.events.RTCTrackEvent(type, event_init_dict)

A `track` event of [`webrtc.RTCPeerConnection`](../interfaces/rtc_peer_connection.md#webrtc.interfaces.rtc_peer_connection.RTCPeerConnection), fired when a remote description adds a track to receive.

See [MDN: RTCTrackEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`RTCTrackEventInit`](#webrtc.models.events.RTCTrackEventInit)) – The members of the event.

#### receiver *: [webrtc.RTCRtpReceiver](../interfaces/rtc_rtp_receiver.md#webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver)*

The receiver of the track. See [MDN: RTCTrackEvent/receiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent/receiver).

* **Type:**
  [`webrtc.RTCRtpReceiver`](../interfaces/rtc_rtp_receiver.md#webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver)

#### track *: [webrtc.MediaStreamTrack](../interfaces/media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)*

The remote track. See [MDN: RTCTrackEvent/track](https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent/track).

* **Type:**
  [`webrtc.MediaStreamTrack`](../interfaces/media_stream_track.md#webrtc.interfaces.media_stream_track.MediaStreamTrack)

#### streams *: [list](https://docs.python.org/3/builtins/stdtypes.html#list)[[webrtc.MediaStream](../interfaces/media_stream.md#webrtc.interfaces.media_stream.MediaStream)]*

The remote streams the track is in. See [MDN: RTCTrackEvent/streams](https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent/streams).

* **Type:**
  [`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of [`webrtc.MediaStream`](../interfaces/media_stream.md#webrtc.interfaces.media_stream.MediaStream)

#### transceiver *: [webrtc.RTCRtpTransceiver](../interfaces/rtc_rtp_transceiver.md#webrtc.interfaces.rtc_rtp_transceiver.RTCRtpTransceiver)*

The transceiver of the receiver. See [MDN: RTCTrackEvent/transceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCTrackEvent/transceiver).

* **Type:**
  [`webrtc.RTCRtpTransceiver`](../interfaces/rtc_rtp_transceiver.md#webrtc.interfaces.rtc_rtp_transceiver.RTCRtpTransceiver)

### *class* webrtc.models.events.RTCTransformEvent(type, transformer)

The `rtctransform` event the worker of a [`webrtc.RTCRtpScriptTransform`](../interfaces/rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransform) is called with.

The worker is a Python callable that runs on the event loop. There is no worker script.

See [MDN: RTCTransformEvent](https://developer.mozilla.org/en-US/docs/Web/API/RTCTransformEvent).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **transformer** ([`webrtc.RTCRtpScriptTransformer`](../interfaces/rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransformer)) – The transformer of the transform.

#### transformer *: [webrtc.RTCRtpScriptTransformer](../interfaces/rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransformer)*

The transformer, with the streams of frames to transform.
See [MDN: RTCTransformEvent/transformer](https://developer.mozilla.org/en-US/docs/Web/API/RTCTransformEvent/transformer).

* **Type:**
  [`webrtc.RTCRtpScriptTransformer`](../interfaces/rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransformer)

### *class* webrtc.models.events.KeyFrameRequestEvent(type, rid=None)

A `keyframerequest` event of [`webrtc.RTCRtpScriptTransformer`](../interfaces/rtc_rtp_script_transform.md#webrtc.interfaces.rtc_rtp_script_transform.RTCRtpScriptTransformer).

It’s fired when the remote peer asks for a key frame.

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **rid** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional) – The `rid` of the layer the key frame is asked for, or [`None`](https://docs.python.org/3/builtins/constants.html#None) for any layer.

#### rid *: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The `rid` of the layer the key frame is asked for, or [`None`](https://docs.python.org/3/builtins/constants.html#None) for any layer.

* **Type:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str), optional

### *class* webrtc.models.events.SFrameTransformErrorEventInit(error_type, frame, key_id=None)

The members of an [`SFrameTransformErrorEvent`](#webrtc.models.events.SFrameTransformErrorEvent).

* **Parameters:**
  * **error_type** ([`webrtc.SFrameTransformErrorEventType`](../enums.md#webrtc.enums.SFrameTransformErrorEventType)) – Why the frame didn’t decrypt, as a member or its
    string value.
  * **frame** ([`webrtc.RTCEncodedVideoFrame`](rtc_encoded_frame.md#webrtc.models.rtc_encoded_frame.RTCEncodedVideoFrame), [`webrtc.RTCEncodedAudioFrame`](rtc_encoded_frame.md#webrtc.models.rtc_encoded_frame.RTCEncodedAudioFrame) or [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes)) – The frame
    that didn’t decrypt. For a buffer written to an [`webrtc.SFrameDecryptorStream`](../interfaces/sframe_transform.md#webrtc.interfaces.sframe_transform.SFrameDecryptorStream), it’s the chunk.
  * **key_id** ([`int`](https://docs.python.org/3/builtins/functions.html#int), optional) – The unknown key id, for a `keyID` error.
* **Raises:**
  [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – If the error type isn’t a member of [`webrtc.SFrameTransformErrorEventType`](../enums.md#webrtc.enums.SFrameTransformErrorEventType).

### *class* webrtc.models.events.SFrameTransformErrorEvent(type, event_init_dict)

An `error` event of an SFrame decryptor, fired when a frame doesn’t decrypt and is dropped.

It’s an event of [`webrtc.RTCRtpSFrameDecryptor`](../interfaces/sframe_transform.md#webrtc.interfaces.sframe_transform.RTCRtpSFrameDecryptor) and [`webrtc.SFrameDecryptorStream`](../interfaces/sframe_transform.md#webrtc.interfaces.sframe_transform.SFrameDecryptorStream).

* **Parameters:**
  * **type** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str)) – The name of the event.
  * **event_init_dict** ([`SFrameTransformErrorEventInit`](#webrtc.models.events.SFrameTransformErrorEventInit)) – The members of the event.

#### error_type *: [SFrameTransformErrorEventType](../enums.md#webrtc.enums.SFrameTransformErrorEventType)*

Why the frame didn’t decrypt.

* **Type:**
  [`webrtc.SFrameTransformErrorEventType`](../enums.md#webrtc.enums.SFrameTransformErrorEventType)

#### key_id *: [int](https://docs.python.org/3/builtins/functions.html#int) | [None](https://docs.python.org/3/builtins/constants.html#None)*

The unknown key id for a `keyID` error, or [`None`](https://docs.python.org/3/builtins/constants.html#None) otherwise.

* **Type:**
  [`int`](https://docs.python.org/3/builtins/functions.html#int), optional

#### frame *: [webrtc.RTCEncodedVideoFrame](rtc_encoded_frame.md#webrtc.models.rtc_encoded_frame.RTCEncodedVideoFrame) | [webrtc.RTCEncodedAudioFrame](rtc_encoded_frame.md#webrtc.models.rtc_encoded_frame.RTCEncodedAudioFrame) | [bytes](https://docs.python.org/3/builtins/stdtypes.html#bytes)*

The dropped frame.
For a buffer written to an [`webrtc.SFrameDecryptorStream`](../interfaces/sframe_transform.md#webrtc.interfaces.sframe_transform.SFrameDecryptorStream), it’s the chunk.

* **Type:**
  [`webrtc.RTCEncodedVideoFrame`](rtc_encoded_frame.md#webrtc.models.rtc_encoded_frame.RTCEncodedVideoFrame), [`webrtc.RTCEncodedAudioFrame`](rtc_encoded_frame.md#webrtc.models.rtc_encoded_frame.RTCEncodedAudioFrame) or [`bytes`](https://docs.python.org/3/builtins/stdtypes.html#bytes)
