17
edits
JamesCheng (talk | contribs) (→HDMI/DisplayPort: sync with current design) |
JamesCheng (talk | contribs) (sync with current design) |
||
Line 65: | Line 65: | ||
This will be an object in <code>window.navigator</code> named <code>InputPortManager</code> with the following interface: | This will be an object in <code>window.navigator</code> named <code>InputPortManager</code> with the following interface: | ||
partial interface Navigator { | partial interface Navigator { | ||
[Throws, Pref="dom.inputport.enabled", CheckPermissions="inputport", AvailableIn=CertifiedApps] | |||
readonly attribute InputPortManager inputPortManager; | readonly attribute InputPortManager inputPortManager; | ||
}; | }; | ||
[Pref="dom.inputport.enabled", CheckPermissions="inputport", AvailableIn=CertifiedApps] | |||
interface InputPortManager { | interface InputPortManager { | ||
Promise<sequence<InputPort>> getInputPorts (); | [Throws] | ||
Promise<sequence<InputPort>> getInputPorts(); | |||
}; | }; | ||
Line 78: | Line 80: | ||
== Examples == | == Examples == | ||
var inputPortMgr = navigator.inputPortManager; | |||
inputPortMgr.getInputPorts().then( | |||
function(aPorts) { | |||
for (var i=0; i < aPorts.length; ++i) { | |||
var port = aPorts[i]; | |||
if(port instanceof HDMIInputPort) { | |||
//.... | |||
} | |||
} | |||
}, | |||
function(aError) { | |||
//error | |||
} | |||
); |
edits