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()
.
Tones are removed from the string as they're played, so only upcoming tones are listed.
vartoneBuffer=RTCDTMFSender.toneBuffer;
A
DOMString
listing the tones to be played. If the string is empty, there are no tones pending.
The tone buffer is a string which can contain any combination of the characters that are permitted by the DTMF standard.
These characters represent the digit keys on a telephone keypad.
These correspond to the similarly-labeled keys which are typically on the bottom row of the telephone keypad.
This character instructs the dialing process to pause for two seconds before sending the next character in the buffer.
All other characters are unrecognized and will cause
insertDTMF()
to throw an
InvalidCharacterError
异常。
For example, if you're writing code to control a voicemail system by sending DTMF codes, you might use a string such as "*,1,5555". In this example, we would send "*" to request access to the VM system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a PIN number to open the messages.
Settting the tone buffer to an empty string (
""
) cancels any pending DTMF codes.
tbd
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDTMFSender.toneBuffer' in that specification. |
候选推荐 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
toneBuffer
|
Chrome 27 | Edge ≤79 | Firefox 52 | IE 不支持 No | Opera Yes | Safari ? | WebView Android 4.4 | Chrome Android 27 | Firefox Android 52 | Opera Android Yes | Safari iOS ? | Samsung Internet Android 1.5 |
完整支持
不支持
兼容性未知
RTCDTMFSender.insertDTMF()
RTCPeerConnection
RTCDTMFSender
RTCRtpSender
RTCDTMFSender
ontonechange
toneBuffer
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent