window.requestAnimationFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
window.msRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60); };
})();
and it will work in Opera 12 too.Anyway, I limited myself to trying out the various vendors' prefixes; this being mainly an experiment/preview I'd rather keep the code clean than support non-cutting-edge browsers.
I'll update the paragraph about the compatibility though; thanks for the heads up!
Just thought it may be of interest ;)
a simple (cross browser) wrapper to make getUserMedia really simple, you call
Sinne.getUserVideo(success, error[, options])
//https://github.com/franzenzenhofer/Sinne
and get back a nice HTML5 video element with the webcam as the inputhere is a simple demo using the `Sinne` http://www.backpacker.io/ - an HTML5 mirror
I was thinking of libifying my thingy, in a quite minimalistic way (at a minumum, the user would just pass two functions, one "update" and one "draw", which would receive a the current frame and, in the first case, the delta time).
This way you could just get freaky with the canvas effects and composing capabilities and stop caring about the low-level stuff.
I see you know your way around building nice, clean APIs; could you suggest me article/book about it? I'm kind of a newbie to that sort of things.
You had me excited for a second there because something like this with a flash fallback mechanism would be really, really useful.
i raised the issue here https://github.com/addyosmani/getUserMedia.js/issues/2#issue... (and suggested a possible solution), but for this we would need the help of a flash megamind-ninja.
For WebRTC p2p video streaming in general, it seems promising. At the moment, though, there's little to no browser support and getting a full system (there's also a server involved, to initiate the connections) is not automated or abstracted yet.
For more info, check out this page: http://www.webrtc.org/running-the-demos
Anyway the backstory is that me and jayniz used to work together, and he usually adds a gif to each of his readme files.