Completely rewritten for VideoJS 4.1