[webrtc-pc] Section 11.7: DTMF Examples

aboba has just created a new issue for https://github.com/w3c/webrtc-pc:

== Section 11.7: DTMF Examples ==
Looking at Section 11.7 there are a number of problems with the DTMF examples:

1. Example 17: 

The example does not append to the toneBuffer. 

2. Example 18 should be: 

if (sender.dtmf) {
  var duration = 500; 
  sender.dtmf.ontonechange = function (e) {
      if (!e.tone)
          return;
      // light up the key when playout starts
      lightKey(e.tone);
      // turn off the light after tone duration
      setTimeout(lightKey, duration, "");
  };
  sender.dtmf.insertDTMF(sender.dtmf.toneBuffer + "1234", duration);
} else
    log("DTMF function not available");

3. Example 19 should be: 

if (sender.dtmf) {
  sender.dtmf.ontonechange = function (e) {
      if (e.tone == "1")
          sender.dtmf.insertDTMF(sender.dtmf.toneBuffer + "2", 2000);
  };
  sender.dtmf.insertDTMF("1", 1000);
} else
    log("DTMF function not available");

4. Example 20: 

sender.dtmf.insertDTMF(sender.toneBuffer + "456");

Should be: sender.dtmf.insertDTMF(sender.dtmf.toneBuffer + "456");

sender.dtmf.insertDTMF(sender.toneBuffer + "789");

Should be: sender.dtmf.insertDTMF(sender.dtmf.toneBuffer + "789");

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1336 using your GitHub account

Received on Monday, 5 June 2017 20:07:49 UTC