In this video, the counter shaft is not rotating while a gear slides into place. But if the counter shaft was rotating, wouldn't the gear sliding over have a difficult time engaging with a gear on the counter shaft?
Yes if the shafts were rotating then it would be difficult - this is why the gears are engaged when the shafts are not transmitting torque or rotating.
If you want to change gears during operation then a constant mesh gearbox is clearly a better option. Usually the gears are not locked to the shaft and they have dogs on their sides. These gears transmit torque by engaging with a hub (that also has dogs) that slides along the shaft but is splined with the shaft.
See the video below starting from 3:00. The purple components are the sliding hubs I'm talking about. They have dog teeth that interact with the dog teeth on the sides of the gears.