Change javascript logic for playback.