Add support for video panning

Fixes #2005