Skip to content

Commit 39f7a63

Browse files
committed
fix: Add workaround for Firefox DTMF compatibility
src/content/peerconnection/dtmf/js/main.js was incompatible with Firefox due to its reliance on the `canInsertDTMF` function, which is not supported in Firefox. This commit implements a workaround by assuming DTMF insertion is always available when `canInsertDTMF` is not present.
1 parent 9db4d1d commit 39f7a63

File tree

1 file changed

+4
-2
lines changed
  • src/content/peerconnection/dtmf/js

1 file changed

+4
-2
lines changed

src/content/peerconnection/dtmf/js/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ function dtmfOnToneChange(tone) {
173173
}
174174

175175
function sendTones(tones) {
176-
if (dtmfSender && dtmfSender.canInsertDTMF) {
176+
// firefox doesn't implement canInsertDTMF, so assume it's always available
177+
// Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1623193
178+
if (dtmfSender && (typeof (dtmfSender.canInsertDTMF) === 'undefined' || dtmfSender.canInsertDTMF)) {
177179
const duration = durationInput.value;
178180
const gap = gapInput.value;
179181
console.log('Tones, duration, gap: ', tones, duration, gap);
@@ -193,4 +195,4 @@ function addDialPadHandlers() {
193195
}
194196
}
195197

196-
main();
198+
main();

0 commit comments

Comments
 (0)