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
mediaStream.getAudioTracks()[0].stop(); mediaStream.getVideoTracks()[0].stop();
Hope this will work with new standards. Its working fine in my app.