Skip to content

Commit

Permalink
safari: keep audio-video order in legacy addStream
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed May 31, 2019
1 parent bc33e29 commit c1da730
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/safari/safari_shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ export function shimLocalStreamsAPI(window) {
if (!this._localStreams.includes(stream)) {
this._localStreams.push(stream);
}
stream.getTracks().forEach(track => _addTrack.call(this, track, stream));
// Try to emulate Chrome's behaviour of adding in audio-video order.
// Safari orders by track id.
stream.getAudioTracks().forEach(track => _addTrack.call(this, track,
stream));
stream.getVideoTracks().forEach(track => _addTrack.call(this, track,
stream));
};

window.RTCPeerConnection.prototype.addTrack = function(track, stream) {
Expand Down

0 comments on commit c1da730

Please sign in to comment.