Update to work with HTML5 player

Clean up code