Why are safety demonstrations done while taxiing?
Many passengers don't reach the gate until seconds before the gate closes for a variety of reasons. They won't get the pre-boarding briefing. 

Taxiing is the only time before takeoff where the crew knows for sure that all passengers that will be on the plane are there.