Initially working version (for videos)