Fix up atEnd function
Merge pull request #13 from bartvde/issue-13

playback does not stop at the end