Interface RTCDTMFSender
canInsertDTMF: boolean;
ontonechange:
| ((this: RTCDTMFSender, ev: RTCDTMFToneChangeEvent) => any)
| null;
toneBuffer: string;
addEventListener<K extends "tonechange">(
type: K,
listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;
dispatchEvent(event: Event): boolean;
insertDTMF(tones: string, duration?: number, interToneGap?: number): void;
removeEventListener<K extends "tonechange">(
type: K,
listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
}
Hierarchy
- EventTarget
- RTCDTMFSender
Properties
ReadonlycanInsertDTMF
The canInsertDTMF read-only property of the RTCDTMFSender interface returns a boolean value which indicates whether the RTCDTMFSender is capable of sending DTMF tones over the RTCPeerConnection.
ontonechange
ReadonlytoneBuffer
The RTCDTMFSender interface's toneBuffer property returns a string containing a list of the DTMF tones currently queued for sending to the remote peer over the RTCPeerConnection. To place tones into the buffer, call insertDTMF().
Methods
addEventListener
-
addEventListener<K extends "tonechange">(
type: K,
listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Type Parameters
- K extends "tonechange"
Parameters
- type: K
- listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any
Optionaloptions: boolean | AddEventListenerOptions
Returns void
-
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | AddEventListenerOptions
Returns void
dispatchEvent
-
The
dispatchEvent()method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().Parameters
- event: Event
Returns boolean
insertDTMF
-
The
insertDTMF()method of the RTCDTMFSender interface sends DTMF tones to the remote peer over the RTCPeerConnection.Parameters
- tones: string
Optionalduration: numberOptionalinterToneGap: number
Returns void
removeEventListener
-
removeEventListener<K extends "tonechange">(
type: K,
listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.Type Parameters
- K extends "tonechange"
Parameters
- type: K
- listener: (this: RTCDTMFSender, ev: RTCDTMFSenderEventMap[K]) => any
Optionaloptions: boolean | EventListenerOptions
Returns void
-
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | EventListenerOptions
Returns void
The
RTCDTMFSenderinterface provides a mechanism for transmitting DTMF codes on a WebRTC RTCPeerConnection. You gain access to the connection's RTCDTMFSender through the RTCRtpSender.dtmf property on the audio track you wish to send DTMF with.MDN Reference