17
edits
JamesCheng (talk | contribs) (sync with current design) |
JamesCheng (talk | contribs) (→Examples: fix indent) |
||
Line 79: | Line 79: | ||
This method makes a request to retrieve all the available input ports on a device. It returns a new Promise that will be used to notify the caller about the result of the operation, which is an array of InputPort elements belong to the InputPortManager. | This method makes a request to retrieve all the available input ports on a device. It returns a new Promise that will be used to notify the caller about the result of the operation, which is an array of InputPort elements belong to the InputPortManager. | ||
== Examples == | '''Bold text'''== 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