Refactored and simplified example from http://belelros.github.io/videojs