Telephony.speakerEnabled

Non-standard
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

This API is available on Firefox OS for internal applications only.

The speakerEnabled property of the Telephony interface indicates whether or not the speakerphone functionality of the phone is enabled.

Syntax

// Is the speaker enabled?
var speakerEnabled = myTelephony.speakerEnabled;
// Turn on the speaker
myTelephony.speakerEnabled = true;                 

Value

 A Booleantrue indicates the speaker is enabled; false indicates that it is not. You may read and write this value.

Examples

// Telephony object
var tel = navigator.mozTelephony;

// Receive a call
tel.onincoming = function (e) {
  var incomingCall = e.call;

  // Answer the call
  incomingCall.answer();
};

// Say we have a button that activates/deactivates the speaker phone
muteButton.onclick = function() {
  if(tel.speakerEnabled) {
    tel.speakerEnabled = false;
  } else {
    tel.speakerEnabled = true;
  }
}

Specifications

Specification Status Comment
Web Telephony Draft Draft

Browser compatibility

For obvious reasons, support is primarily expected on mobile browsers.

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported Not supported Not supported Not supported Not supported
Feature Android Firefox Mobile (Gecko) Firefox OS (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported 12.0 (12.0) 1.0.1 Not supported Not supported Not supported

See also

Document Tags and Contributors

Contributors to this page: chrisdavidmills, fscholz, MHasan, kscarfone, Jeremie, Sheppy
Last updated by: chrisdavidmills,