Is it better to go to class, or watch the recorded lectures?
A combination may be best. Go to the lectures. During the lecture, if you miss something, or have trouble understanding, make a note of the time. Afterwards, before attempting the coursework, bring up the recorded lecture and view the places you missed during the live lecture.

That way, you get the keep-on-track benefit of the live lectures. You spend your viewing time in a very focused mode, looking only at the difficult parts of the lecture, which may reduce the tendency to get distracted.