moved playback code to player.js