Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Keep track of senders to allow unmutung with Safari" #10954

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/utils/webrtc/simplewebrtc/peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function Peer(options) {
this._pendingReplaceTracksQueue = []
this._processPendingReplaceTracksPromise = null
this._initialStreamSetup = false
this._localSenders = []
this.sid = options.sid || Date.now().toString()
this.pc = new RTCPeerConnection(this.parent.config.peerConnectionConfig)
this.pc.addEventListener('icecandidate', this.onIceCandidate.bind(this))
Expand Down Expand Up @@ -675,7 +674,6 @@ Peer.prototype.end = function() {
}
this.pc.close()
this.handleStreamRemoved()
this._localSenders = []
this.parent.off('sentTrackReplaced', this.handleSentTrackReplacedBound)
this.parent.off('sentTrackEnabledChanged', this.handleSentTrackEnabledChangedBound)

Expand Down Expand Up @@ -772,10 +770,7 @@ Peer.prototype._replaceTrack = async function(newTrack, oldTrack, stream) {
// is used to be on the safe side.
const replaceTrackPromises = []

for (const sender of this.pc.getSenders()) {
// Keep reference, so that safari does not remove the tracks
this._localSenders.push(sender)

this.pc.getSenders().forEach(sender => {
if (sender.track !== oldTrack && sender.trackDisabled !== oldTrack) {
return
}
Expand Down Expand Up @@ -854,7 +849,7 @@ Peer.prototype._replaceTrack = async function(newTrack, oldTrack, stream) {
})

replaceTrackPromises.push(replaceTrackPromise)
}
})

// If the call started when the audio or video device was not active there
// will be no sender for that type. In that case the track needs to be added
Expand Down
Loading