Created
May 24, 2013 21:29
-
-
Save andreafortuna/5646642 to your computer and use it in GitHub Desktop.
HTML5: accedere alla videocamera e alla galleria di foto dei dispositivi mobili
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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