-
Notifications
You must be signed in to change notification settings - Fork 22.8k
fix: Add details for createDTMFSender() method in RTCPeerConnection interface #33955
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Josh-Cena
merged 10 commits into
mdn:main
from
bc-lee:feature/add-peerconnection-createdtmfsender
Sep 23, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
aede702
fix: Add details for createDTMFSender() method in RTCPeerConnection i…
bc-lee 443a382
Apply suggestions from code review
bc-lee 031eb3e
Update files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md
bc-lee 4077b9a
Merge branch 'main' into feature/add-peerconnection-createdtmfsender
wbamberg c6d859c
Merge branch 'main' into feature/add-peerconnection-createdtmfsender
wbamberg 7124d31
Apply suggestions from code review
Josh-Cena d29d776
Update index.md
Josh-Cena 983bd43
Not non-standard
Josh-Cena 52846f5
Update index.md
Josh-Cena 8ce8936
Merge branch 'main' into feature/add-peerconnection-createdtmfsender
Josh-Cena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: "RTCPeerConnection: createDTMFSender() method" | ||
short-title: createDTMFSender() | ||
slug: Web/API/RTCPeerConnection/createDTMFSender | ||
page-type: web-api-instance-method | ||
status: | ||
- deprecated | ||
- non-standard | ||
browser-compat: api.RTCPeerConnection.createDTMFSender | ||
--- | ||
|
||
{{APIRef("WebRTC")}}{{Deprecated_Header}}{{non-standard_header}} | ||
|
||
The **`createDTMFSender()`** method of the {{domxref("RTCPeerConnection")}} interface creates a new {{domxref("RTCDTMFSender")}} object associated with the specified {{domxref("MediaStreamTrack")}}, which can be used to send DTMF tones over the connection. | ||
|
||
This method is deprecated and should not be used. Instead, use the {{domxref("RTCRtpSender.dtmf")}} property to access the DTMF sender associated with a specific sender. | ||
|
||
## Syntax | ||
|
||
```js-nolint | ||
createDTMFSender(track) | ||
Josh-Cena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
### Parameters | ||
|
||
- `track` | ||
- : A {{domxref("MediaStreamTrack")}} object representing the track to associate with the new DTMF sender. | ||
|
||
### Return value | ||
|
||
A new {{domxref("RTCDTMFSender")}} object. | ||
|
||
## Examples | ||
|
||
This example creates a new DTMF sender associated with the specified track. | ||
|
||
```js | ||
navigator.getUserMedia({ audio: true }, (stream) => { | ||
const pc = new RTCPeerConnection(); | ||
const track = stream.getAudioTracks()[0]; | ||
const dtmfSender = pc.createDTMFSender(track); | ||
}); | ||
``` | ||
|
||
This could be rewritten using the {{domxref("RTCRtpSender.dtmf")}} property: | ||
|
||
```js | ||
navigator.getUserMedia({ audio: true }, (stream) => { | ||
const pc = new RTCPeerConnection(); | ||
const track = stream.getAudioTracks()[0]; | ||
const sender = pc.addTrack(track, stream); | ||
const dtmfSender = sender.dtmf; | ||
}); | ||
``` | ||
|
||
## Specifications | ||
|
||
This feature is non-standard and not part of any specification. | ||
|
||
## Browser compatibility | ||
Josh-Cena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- [WebRTC](/en-US/docs/Web/API/WebRTC_API) | ||
- {{domxref("RTCDTMFSender")}} | ||
- {{domxref("RTCRtpSender")}} | ||
- {{domxref("RTCPeerConnection")}} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.