I have created webrtc based video chat suing peerjs.
The local and remote video element is created using control:
local: \'video id= [local_peer_id] autoplay=\"t
calling mediaStream.stop() will stop the camera where mediaStream is the stream that you got when calling getUserMedia
mediaStream.stop()
mediaStream
getUserMedia
Here is a working example