1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/webidl/AudioChannelManager.webidl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 + */ 1.9 + 1.10 +interface AudioChannelManager : EventTarget { 1.11 + /** 1.12 + * Indicates whether the headphones are plugged in or not. 1.13 + */ 1.14 + readonly attribute boolean headphones; 1.15 + 1.16 + /** 1.17 + * Fired when the headphones are plugged or unplugged. 1.18 + * 1.19 + * When the headphones are unplugged, we may start playing audio through the 1.20 + * system's speakers. Similarly, when headphones are plugged in, we may 1.21 + * switch audio from speakers to headphones. 1.22 + * 1.23 + * If audio is currently playing in this window or in one of its children, we 1.24 + * will fire this event before we switch the audio output from headphones to 1.25 + * speakers (or vice versa). This allows you to, for example, pause your 1.26 + * window's audio when the headphones are unplugged. 1.27 + */ 1.28 + attribute EventHandler onheadphoneschange; 1.29 + 1.30 + /** 1.31 + * Indicates which audio channel is used to adjust volume when pressing HW 1.32 + * volume keys. 1.33 + */ 1.34 + attribute DOMString volumeControlChannel; 1.35 +};