r M e d i a c o n s t r a i n t s - Must for getusermedia, specifies Media type, resolution, etc. v i d e o - An HTML5 DOM element capable of playing live feed v a r c o n s t r a i n t s = { v i d e o : t r u e , a u d i o : t r u e } ; n a v i g a t o r . g e t U s e r M e d i a ( c o n s t r a i n t s , s u c c e s s C a l l b a c k , e r r o r C a l l b a c k ) ; f u n c t i o n s u c c e s s C a l l b a c k ( s t r e a m ) { v a r v i d e o = d o c u m e n t . q u e r y S e l e c t o r ( " v i d e o " ) ; v i d e o . s r c = w i n d o w . U R L . c r e a t e O b j e c t U R L ( s t r e a m ) ; } f u n c t i o n e r r o r C a l l b a c k ( e r r o r ) { a l e r t ( " E r r o r : " , e r r o r ) ; }