adding video ended event and socket comm