Skip to content

Commit d6c565b

Browse files
itsazzadtgabi333
authored andcommitted
new line compatibility fix (#94)
1 parent dd0598b commit d6c565b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rtcpeerconnection.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ PeerConnection.prototype.offer = function (constraints, cb) {
423423

424424
expandedOffer.jingle = jingle;
425425
}
426-
expandedOffer.sdp.split('\r\n').forEach(function (line) {
426+
expandedOffer.sdp.split(/\r?\n/).forEach(function (line) {
427427
if (line.indexOf('a=candidate:') === 0) {
428428
self._checkLocalCandidate(line);
429429
}
@@ -519,7 +519,7 @@ PeerConnection.prototype.handleOffer = function (offer, cb) {
519519
});
520520
self.remoteDescription = offer.jingle;
521521
}
522-
offer.sdp.split('\r\n').forEach(function (line) {
522+
offer.sdp.split(/\r?\n/).forEach(function (line) {
523523
if (line.indexOf('a=candidate:') === 0) {
524524
self._checkRemoteCandidate(line);
525525
}
@@ -591,7 +591,7 @@ PeerConnection.prototype.handleAnswer = function (answer, cb) {
591591
}
592592
});
593593
}
594-
answer.sdp.split('\r\n').forEach(function (line) {
594+
answer.sdp.split(/\r?\n/).forEach(function (line) {
595595
if (line.indexOf('a=candidate:') === 0) {
596596
self._checkRemoteCandidate(line);
597597
}
@@ -736,7 +736,7 @@ PeerConnection.prototype._answer = function (constraints, cb) {
736736
direction: 'outgoing'
737737
});
738738
}
739-
expandedAnswer.sdp.split('\r\n').forEach(function (line) {
739+
expandedAnswer.sdp.split(/\r?\n/).forEach(function (line) {
740740
if (line.indexOf('a=candidate:') === 0) {
741741
self._checkLocalCandidate(line);
742742
}

0 commit comments

Comments
 (0)