[webrtc-pc] Inconsistent behaviors of addTrack compared to addTranseiver and sender.replaceTrack

soareschen has just created a new issue for https://github.com/w3c/webrtc-pc:

== Inconsistent behaviors of addTrack compared to addTranseiver and sender.replaceTrack ==
- `addTrack` verifies that given track is not not found in any existing sender, and otherwise throws `InvalidAccessError`. However the same checking is not done in `addTransceiver(track)` and `sender.replaceTrack`.

- `addTrack` tries to reuse existing sender that is compatible and with null track, `addTransceiver(track)` creates new transceiver regardless.

- `addTrack` mentions about checking the origin of track, `addTransceiver(track)` doesn't.

- Some (informational?) descriptions in `addTransceiver`, e.g. effects on creating offer and session descriptions, are not found in `addTrack`.

I see quite some overlaps between `addTrack` and `addTransceiver`. Is it correct that `addTrack` is there for legacy reasons? Does it make sense to factor out the common steps and put them in a common section?

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1386 using your GitHub account

Received on Thursday, 15 June 2017 03:50:36 UTC