refactor playback progress handler into a new onPlayProgress function