Skip to content

Instantly share code, notes, and snippets.

@andreafortuna
Created May 24, 2013 21:29
Show Gist options
  • Save andreafortuna/5646642 to your computer and use it in GitHub Desktop.
Save andreafortuna/5646642 to your computer and use it in GitHub Desktop.
HTML5: accedere alla videocamera e alla galleria di foto dei dispositivi mobili
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>HTML5 Media Capture Demo</title>
<script type="text/javascript" charset="utf-8" src="jquery-2.0.0.min.js"></script>
</head>
<body>
<p>Choose Image: <input type="file" accept="image/*" id="captureImage" capture="camera"> </p>
<h4>Captured image:</h4>
<p><img src="" id="immagine" style="width:300px;"/></p>
<script>
$(document).ready(function() {
$("#captureImage").on("change",function(event) {
$("#immagine").attr("src",window.webkitURL.createObjectURL(event.target.files[0]));
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment