sdp
Advanced tools
Comparing version 1.4.1 to 1.5.0
{ | ||
"name": "sdp", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "SDP parsing and serialization utilities", | ||
@@ -5,0 +5,0 @@ "main": "sdp.js", |
@@ -225,2 +225,11 @@ /* eslint-env node */ | ||
// Extracts the MID (RFC 5888) from a media section. | ||
// returns the MID or undefined if no mid line was found. | ||
SDPUtils.getMid = function(mediaSection) { | ||
var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:')[0]; | ||
if (mid) { | ||
return mid.substr(6); | ||
} | ||
} | ||
// Extracts DTLS parameters from SDP media section or sessionpart. | ||
@@ -227,0 +236,0 @@ // FIXME: for consistency with other functions this should only |
@@ -229,1 +229,9 @@ /* jshint node: true */ | ||
}); | ||
test('getMid', function(t) { | ||
var mediaSection = 'm=video 9 UDP/TLS/RTP/SAVPF 120 126 97\r\n' + | ||
'c=IN IP4 0.0.0.0\r\na=sendrecv\r\n'; | ||
t.ok(SDPUtils.getMid(mediaSection + 'a=mid:foo\r\n') === 'foo', 'returns the mid'); | ||
t.ok(SDPUtils.getMid(mediaSection) === undefined, 'returns undefined when no a=mid is present'); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
29089
746