finished migrating javascript from html to player.js