added pause events and tick events to update playing times