added track iteration on ended event, moved resize() to init()