Updated for the use of getUserMedia