WebAPI/SpeakerManager: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 10: Line 10:
   attribute boolean forcespeaker;
   attribute boolean forcespeaker;
   /* this event will be fired when force speaker status change */
   /* this event will be fired when force speaker status change */
   attribute EventHandler onforcespeakerchange;
   attribute EventHandler onspeakerforcedchange;
  };
  };


Line 17: Line 17:
  var sm = new MozSpeakerManager();
  var sm = new MozSpeakerManager();
  // fired anytime when device's speaker status changed
  // fired anytime when device's speaker status changed
  sm.onforcespeakerchange = function() {
  sm.onspeakerforcedchange = function() {
   bool enabled = sm.speakerforced;
   bool enabled = sm.speakerforced;
   // Refresh UI
   // Refresh UI
Line 38: Line 38:
*If a background app calls forcespeaker=true that doesn't change anything. 'speakerforced' remains false everywhere.
*If a background app calls forcespeaker=true that doesn't change anything. 'speakerforced' remains false everywhere.
*If an app that has called forcespeaker=true, but no audio is currently playing in the app itself, is switched to the background we switch 'speakerforced' to false in all apps.
*If an app that has called forcespeaker=true, but no audio is currently playing in the app itself, is switched to the background we switch 'speakerforced' to false in all apps.
*If an app that has called forcespeaker(true), and audio is currently playing in the app itself, is switched to the background 'speakerforced' remains true in all apps. *If/when the app stops playing audio, 'speakerforced' switches to false in all apps.
*If an app that has called forcespeaker=true, and audio is currently playing in the app itself, is switched to the background 'speakerforced' remains true in all apps. If/when the app stops playing audio, 'speakerforced' switches to false in all apps.
 
*If an app that has called forcespeaker=true is switched from the background to the foreground 'speakerforced' switches to true in all apps. I.e. the app doesn't have to call forcespeaker=true again when it comes into foreground.
*If an app that has called forcespeaker=true is switched from the background to the foreground 'speakerforced' switches to true in all apps. I.e. the app doesn't have to call forcespeaker(true) again when it comes into foreground.


=== Permissions Table===
=== Permissions Table===
Confirmed users
716

edits

Navigation menu