added events for webrtc, restructured media classes