convert play recording to use a postgres function

with this change there is no automatic removal of plays
older than 20-25s if a new play is sent