Put getUserMedia call further away from onReady code, to prevent possible race condition