When I use the html5 API 'getUserMedia' to access acamera on an Android phone (4.0), it displays "front camera", but I want to open the "rear camera". Code example:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> <title>Html5 Mobile Carema</title> <script src="js/jquery.js"></script> <script> $(document).ready(init); function init() { try { window.URL = window.URL || window.webkitURL || window.msURL || window.oURL; navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; navigator.getUserMedia({ video : true }, successsCallback, errorCallback); } catch (err) { </script> </head> <body> <video id="myVideo" autoplay="autoplay"></video> <br> <input type="button" value="capture" /> <br><div id="result" style="width: 145px"></div> <div> <p id="resultMsg" style="color: red"></p> <p id="decodeTime" style="color: green"></p> </div> </body> </html>
I don’t know how to access a specific camera on an Android phone, who knows? thanks
source share