|
|
@@ -1972,20 +1972,18 @@ TraceablePeerConnection.prototype.findSenderForTrack = function(track) {
|
|
1972
|
1972
|
* <tt>oldTrack</tt> with a null <tt>newTrack</tt> effectively just removes
|
|
1973
|
1973
|
* <tt>oldTrack</tt>
|
|
1974
|
1974
|
*
|
|
1975
|
|
- * @param {JitsiLocalTrack|null} oldTrack - The current track in use to be
|
|
1976
|
|
- * replaced
|
|
1977
|
|
- * @param {JitsiLocalTrack|null} newTrack - The new track to use
|
|
1978
|
|
- * @returns {Promise<boolean>} - If the promise resolves with true,
|
|
1979
|
|
- * renegotiation will be needed. Otherwise no renegotiation is needed.
|
|
|
1975
|
+ * @param {JitsiLocalTrack|null} oldTrack - The current track in use to be replaced on the pc.
|
|
|
1976
|
+ * @param {JitsiLocalTrack|null} newTrack - The new track to be used.
|
|
|
1977
|
+ *
|
|
|
1978
|
+ * @returns {Promise<boolean>} - If the promise resolves with true, renegotiation will be needed.
|
|
|
1979
|
+ * Otherwise no renegotiation is needed.
|
|
1980
|
1980
|
*/
|
|
1981
|
1981
|
TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
|
|
1982
|
1982
|
if (this._usesUnifiedPlan) {
|
|
1983
|
1983
|
logger.debug(`${this} TPC.replaceTrack using unified plan`);
|
|
1984
|
1984
|
|
|
1985
|
|
- return this.tpcUtils.replaceTrack(oldTrack, newTrack)
|
|
1986
|
|
-
|
|
1987
|
|
- // Renegotiate when SDP is used for simulcast munging or when in p2p mode.
|
|
1988
|
|
- .then(() => (this.isSimulcastOn() && browser.usesSdpMungingForSimulcast()) || this.isP2P);
|
|
|
1985
|
+ // Renegotiate only in the case of P2P. We rely on 'negotiationeeded' to be fired for JVB.
|
|
|
1986
|
+ return this.tpcUtils.replaceTrack(oldTrack, newTrack).then(() => this.isP2P);
|
|
1989
|
1987
|
}
|
|
1990
|
1988
|
|
|
1991
|
1989
|
logger.debug(`${this} TPC.replaceTrack using plan B`);
|