From aede7022b06695e272105b3a26e9b55ebe333c61 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Thu, 6 Jun 2024 15:54:09 +0900 Subject: [PATCH 1/7] fix: Add details for createDTMFSender() method in RTCPeerConnection interface Fixes #33954 --- .../createdtmfsender/index.md | 66 +++++++++++++++++++ .../en-us/web/api/rtcpeerconnection/index.md | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md new file mode 100644 index 000000000000000..46636de42be20dc --- /dev/null +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -0,0 +1,66 @@ +--- +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 +const dtmfSender = pc.createDTMFSender(track); +``` + +### Parameters + +- `track` + - : A {{domxref("MediaStreamTrack")}} object representing the track to associate with the new DTMF sender. + +### Return value + +A new {{domxref("RTCDTMFSender")}} object. + +## Example + +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); +}); +``` + +## Migrating to RTCRtpSender.dtmf + +Above example can be rewritten using the `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; +}); +``` + +## Browser compatibility + +{{Compat}} + +## See also + +- [WebRTC](/en-US/docs/Web/API/WebRTC_API) +- {{domxref("RTCDTMFSender")}} +- {{domxref("RTCRtpSender")}} +- {{domxref("RTCPeerConnection")}} diff --git a/files/en-us/web/api/rtcpeerconnection/index.md b/files/en-us/web/api/rtcpeerconnection/index.md index 779409c78928502..96ff821d8d7f673 100644 --- a/files/en-us/web/api/rtcpeerconnection/index.md +++ b/files/en-us/web/api/rtcpeerconnection/index.md @@ -129,7 +129,7 @@ _Also inherits methods from {{DOMxRef("EventTarget")}}._ - {{DOMxRef("RTCPeerConnection.addStream", "addStream()")}} {{Deprecated_Inline}} {{Non-standard_Inline}} - : Adds a {{DOMxRef("MediaStream")}} as a local source of audio or video. Instead of using this obsolete method, you should instead use {{DOMxRef("RTCPeerConnection.addTrack", "addTrack()")}} once for each track you wish to send to the remote peer. -- {{DOMxRef("RTCPeerConnection.createDTMFSender", "createDTMFSender()")}} {{Deprecated_Inline}} +- {{DOMxRef("RTCPeerConnection.createDTMFSender", "createDTMFSender()")}} {{Deprecated_Inline}} {{Non-standard_Inline}} - : Creates a new {{DOMxRef("RTCDTMFSender")}}, associated to a specific {{DOMxRef("MediaStreamTrack")}}, that will be able to send {{Glossary("DTMF")}} phone signaling over the connection. - {{DOMxRef("RTCPeerConnection.removeStream", "removeStream()")}} {{Deprecated_Inline}} {{Non-standard_Inline}} - : Removes a {{DOMxRef("MediaStream")}} as a local source of audio or video. From 443a382585bbb520fd99fac84fbc23f215280f5a Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Thu, 6 Jun 2024 17:34:41 +0900 Subject: [PATCH 2/7] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../web/api/rtcpeerconnection/createdtmfsender/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md index 46636de42be20dc..710f59da68c0f60 100644 --- a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -14,6 +14,7 @@ browser-compat: api.RTCPeerConnection.createDTMFSender 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 @@ -34,7 +35,7 @@ A new {{domxref("RTCDTMFSender")}} object. This example creates a new DTMF sender associated with the specified track. ```js -navigator.getUserMedia({audio: true }, (stream) => { +navigator.getUserMedia({ audio: true }, (stream) => { const pc = new RTCPeerConnection(); const track = stream.getAudioTracks()[0]; const dtmfSender = pc.createDTMFSender(track); @@ -46,7 +47,7 @@ navigator.getUserMedia({audio: true }, (stream) => { Above example can be rewritten using the `RTCRtpSender.dtmf` property: ```js -navigator.getUserMedia({audio: true }, (stream) => { +navigator.getUserMedia({ audio: true }, (stream) => { const pc = new RTCPeerConnection(); const track = stream.getAudioTracks()[0]; const sender = pc.addTrack(track, stream); From 031eb3e530cb62a9fd5b0790b29046ad461aa95f Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Sat, 8 Jun 2024 03:32:33 +0900 Subject: [PATCH 3/7] Update files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md Co-authored-by: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> --- files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md index 710f59da68c0f60..38ed5a027e851f9 100644 --- a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -30,7 +30,7 @@ const dtmfSender = pc.createDTMFSender(track); A new {{domxref("RTCDTMFSender")}} object. -## Example +## Examples This example creates a new DTMF sender associated with the specified track. From 7124d31d6438bac7a922e5ee1c8906f34073f208 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sun, 15 Sep 2024 18:33:03 -0400 Subject: [PATCH 4/7] Apply suggestions from code review Co-authored-by: wbamberg --- .../web/api/rtcpeerconnection/createdtmfsender/index.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md index 38ed5a027e851f9..21c95f6c0b0f25b 100644 --- a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -1,7 +1,7 @@ --- title: "RTCPeerConnection: createDTMFSender() method" short-title: createDTMFSender() -slug: Web/API/RTCPeerConnection/createdtmfsender +slug: Web/API/RTCPeerConnection/createDTMFSender page-type: web-api-instance-method status: - deprecated @@ -18,7 +18,7 @@ This method is deprecated and should not be used. Instead, use the {{domxref("RT ## Syntax ```js -const dtmfSender = pc.createDTMFSender(track); +createDTMFSender(track) ``` ### Parameters @@ -42,9 +42,7 @@ navigator.getUserMedia({ audio: true }, (stream) => { }); ``` -## Migrating to RTCRtpSender.dtmf - -Above example can be rewritten using the `RTCRtpSender.dtmf` property: +This could be rewritten using the `RTCRtpSender.dtmf` property: ```js navigator.getUserMedia({ audio: true }, (stream) => { From d29d776b7fcd2614631a1674215279cfc45c2e3b Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sun, 15 Sep 2024 18:35:04 -0400 Subject: [PATCH 5/7] Update index.md --- .../web/api/rtcpeerconnection/createdtmfsender/index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md index 21c95f6c0b0f25b..001b7bdcd79483b 100644 --- a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -17,7 +17,7 @@ This method is deprecated and should not be used. Instead, use the {{domxref("RT ## Syntax -```js +```js-nolint createDTMFSender(track) ``` @@ -53,6 +53,10 @@ navigator.getUserMedia({ audio: true }, (stream) => { }); ``` +## Specifications + +This feature is non-standard and not part of any specification. + ## Browser compatibility {{Compat}} From 983bd4379b6892db4c64b39b95c29f2866347f92 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sun, 15 Sep 2024 18:36:14 -0400 Subject: [PATCH 6/7] Not non-standard --- .../web/api/rtcpeerconnection/createdtmfsender/index.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md index 001b7bdcd79483b..04d0e0f74a30b55 100644 --- a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -5,11 +5,10 @@ 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}} +{{APIRef("WebRTC")}}{{Deprecated_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. @@ -42,7 +41,7 @@ navigator.getUserMedia({ audio: true }, (stream) => { }); ``` -This could be rewritten using the `RTCRtpSender.dtmf` property: +This could be rewritten using the {{domxref("RTCRtpSender.dtmf")}} property: ```js navigator.getUserMedia({ audio: true }, (stream) => { @@ -55,7 +54,7 @@ navigator.getUserMedia({ audio: true }, (stream) => { ## Specifications -This feature is non-standard and not part of any specification. +{{Specifications}} ## Browser compatibility From 52846f5313c1c1d6d711636798a68a368d8b11e6 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Sun, 15 Sep 2024 18:39:10 -0400 Subject: [PATCH 7/7] Update index.md --- .../web/api/rtcpeerconnection/createdtmfsender/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md index 04d0e0f74a30b55..dfc9ae6119233a8 100644 --- a/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md +++ b/files/en-us/web/api/rtcpeerconnection/createdtmfsender/index.md @@ -5,10 +5,11 @@ slug: Web/API/RTCPeerConnection/createDTMFSender page-type: web-api-instance-method status: - deprecated + - non-standard browser-compat: api.RTCPeerConnection.createDTMFSender --- -{{APIRef("WebRTC")}}{{Deprecated_Header}} +{{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. @@ -54,7 +55,7 @@ navigator.getUserMedia({ audio: true }, (stream) => { ## Specifications -{{Specifications}} +This feature is non-standard and not part of any specification. ## Browser compatibility