Talk by Shwetank.
Using getUserMedia you can now access the camera and microphone using just plain old JavaScript! In this talk, we'll take a look at the various use cases for it and what all possibilities it opens up for web applications in the future.
15. getUserMedia
//Create audio context and media stream source
var audioContext = new AudioContext(); // Prefix it for various
browsers
// Create an AudioNode from the stream.
var mediaStreamSource =
audioContext.createMediaStreamSource( stream );
16. getUserMedia
//Create audio context and media stream source
var audioContext = new AudioContext(); // Prefix it for various
browsers
// Create an AudioNode from the stream.
var mediaStreamSource =
audioContext.createMediaStreamSource( stream );
// Connect audio loop to hear your own voice
mediaStreamSource.connect(context.destination);
22. Use camera with
getusermedia
// In the HTML
var video = document.querySelector('video');
....
.....
// In the JS Code
function v_success(stream){
video.src = window.URL.createObjectURL(stream) || stream;
}
23. Use camera + Video +
Canvas for new tricks
var button = document.querySelector('#button');
button.addEventListener('click',snapshot, false);
...
...
function snapshot(){
var c = document.querySelector('canvas');
var ctx = c.getContext('2d');
var cw = c.clientWidth;
var ch = c.clientHeight;
ctx.drawImage(video_element, 0, 0, cw, ch);
}
24. Demo
Notice you can click on a polaroid
and save that image.
You can create data URIs of canvases
35. Voice driven apps
Voice modulation apps
Native photo capture in web apps
Live image manipulation and effects
Video conferencing (using WebRTC)
Accessibility enhancements to apps
Possible use cases