My audiobook player has a sleep timer that after it expires, will gradually fade out to nothing.
Best part is if you're still awake enough that you notice it happening you can just shake your phone (with an adjustable intensity) without turning the screen on or anything and it resets the sleep timer.