PCA prejectino

The goal for PCA, as mentioned in previous videos is to let the length projected to axis Z as varied as possible, preserving the variations. But why in this video, it says the goal is to minimize the distance to axis Z?