I'm using MediaStream API in a web app which allow multiple user to make à conf call based on webrtc. When I use MediaStream.addTracks() the id of my track (MediaStreamTrack) change.
Here is a concrete example :
getUserMedia.call(navigator, {audio:true,video:false}, function(stream) {
console.log(stream.getAudioTracks()); //(1)
rtc.streams[0].addTrack(stream.getAudioTracks()[0]); //rtc object managed by webrtc.io
console.log(rtc.streams[0].getAudioTracks()); //(2)
}, function() {
console.log("Could not connect stream.");
onFail();
});
(1) : At this point my audio track is
enabled: true
id: "0eKd3T3arsIgrnLsIplvfA69feDzxvwEnu8ga0"
kind: "audio"
label: "0eKd3T3arsIgrnLsIplvfA69feDzxvwEnu8ga0"
onended: null
onmute: null
onunmute: null
readyState: "live"
(2) : At this point my audio track is
enabled: true
id: "bd3ba276-8804-4c6e-8dd7-f1bd316150e8"
kind: "audio"
label: "0eKd3T3arsIgrnLsIplvfA69feDzxvwEnu8ga0"
onended: null
onmute: null
onunmute: null
readyState: "live"
As you can see the id
has changed. Is this the normal behaviour ?