peerConnection.removeStream(streamA) // __o_j_sep... in Screenshots below
peerCon
To answer your first question, when modifying the MediaStream in an active peerconnection, the peerconnection object will fire an onnegotiationneeded
event. You need to handle that event and re-exchange your SDPs. The main reason behind this is so that both parties know what streams are being sent between them. When the SDPs are exchanged, the mediaStream ID is included, and if there is a new stream with a new ID(event with all other things being equal), a re-negotiation must take place.
For you second question(about SSTREAM
). It does indeed contain video tracks but there is no videotrack attribute for webkitMediaStreams
. You can grab tracks via their ID, however.
Since there is the possibility of having numerous tracks for each media type, there is no single attribute for a videotrack or audiotrack but instead an array of such. The .getVideoTracks()
call returns an array of the current videoTracks. So, you COULD grab a particular video track through indicating its index .getVideoTracks()[0]
.