Motion activated security camera using DeviceMotion/Orientation, canvas, WebRTC

Read more about how its done at Web Directions

Grab the code from Github