The new law comes after viral videos on social media were shared by Tesla employees, showing videos captured unbeknown to the car owner.