Socket
Socket
Sign inDemoInstall

sdp

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sdp - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

2

package.json
{
"name": "sdp",
"version": "1.3.0",
"version": "1.4.0",
"description": "SDP parsing and serialization utilities",

@@ -5,0 +5,0 @@ "main": "sdp.js",

@@ -435,2 +435,35 @@ /* eslint-env node */

// parses http://draft.ortc.org/#rtcrtcpparameters*
SDPUtils.parseRtcpParameters = function(mediaSection) {
var rtcpParameters = {};
var cname;
// Gets the first SSRC. Note that with RTX there might be multiple
// SSRCs.
var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')
.map(function(line) {
return SDPUtils.parseSsrcMedia(line);
})
.filter(function(obj) {
return obj.attribute === 'cname';
})[0];
if (remoteSsrc) {
rtcpParameters.cname = remoteSsrc.value;
rtcpParameters.ssrc = remoteSsrc.ssrc;
}
// Edge uses the compound attribute instead of reducedSize
// compound is !reducedSize
var rsize = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-rsize');
rtcpParameters.reducedSize = rsize.length > 0;
rtcpParameters.compound = rsize.length === 0;
// parses the rtcp-mux attrŅ–bute.
// Note that Edge does not support unmuxed RTCP.
var mux = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-mux');
rtcpParameters.mux = mux.length > 0;
return rtcpParameters;
};
// parses either a=msid: or a=ssrc:... msid lines an returns

@@ -437,0 +470,0 @@ // the id of the MediaStream and MediaStreamTrack.

@@ -205,1 +205,11 @@ /* jshint node: true */

});
test('parseRtcpParameters', function(t) {
var rtcp = SDPUtils.parseRtcpParameters(videoSDP);
t.ok(rtcp.cname === 'VrveQctHgkwqDKj6', 'parsed RTCP cname');
t.ok(rtcp.ssrc === 1734522595, 'parsed RTCP ssrc');
t.ok(rtcp.reducedSize === true, 'parsed RTCP reducedSize');
t.ok(rtcp.compound === false, 'parsed RTCP compound');
t.ok(rtcp.mux === true, 'parse RTCP mux');
t.end();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡ïļ by Socket Inc