Added start and end event listeners to codec. They're from lines 27 to 49.