The read-only property RTCDTMFToneChangeEvent.tone returns the DTMF character which has just begun to play, or an empty string ( "" ). if all queued tones have finished playing (that is, RTCDTMFSender.toneBuffer is empty).

句法

 var tone = dtmfToneChangeEvent.tone;
					

范例

This example establishes a handler for the tonechange event which updates an element to display the currently playing tone in its content, or, if all tones have played, the string "<none>".

dtmfSender.ontonechange = function( ev ) {
  let tone = ev.tone;
  if (tone === "") {
    tone = "<none>"
  }
  document.getElementById("playingTone").innerText = tone;
};
					

规范

规范 状态 注释
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCDTMFToneChangeEvent.tone' in that specification.
候选推荐 最初的规范。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
tone Chrome 27 Edge 12 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

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

另请参阅

元数据

  • 最后修改: