New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mediasoup-client

Package Overview
Dependencies
Maintainers
2
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mediasoup-client - npm Package Compare versions

Comparing version 3.7.6 to 3.7.7

11

lib/Device.js

@@ -332,3 +332,2 @@ "use strict";

logger.debug('load() [routerRtpCapabilities:%o]', routerRtpCapabilities);
routerRtpCapabilities = utils.clone(routerRtpCapabilities);
// Temporal handler to get its capabilities.

@@ -340,11 +339,15 @@ let handler;

}
// Clone given router RTP capabilities to not modify input data.
const clonedRouterRtpCapabilities = utils.clone(routerRtpCapabilities);
// This may throw.
ortc.validateRtpCapabilities(routerRtpCapabilities);
ortc.validateRtpCapabilities(clonedRouterRtpCapabilities);
handler = this._handlerFactory();
const nativeRtpCapabilities = await handler.getNativeRtpCapabilities();
logger.debug('load() | got native RTP capabilities:%o', nativeRtpCapabilities);
// Clone obtained native RTP capabilities to not modify input data.
const clonedNativeRtpCapabilities = utils.clone(nativeRtpCapabilities);
// This may throw.
ortc.validateRtpCapabilities(nativeRtpCapabilities);
ortc.validateRtpCapabilities(clonedNativeRtpCapabilities);
// Get extended RTP capabilities.
this._extendedRtpCapabilities = ortc.getExtendedRtpCapabilities(nativeRtpCapabilities, routerRtpCapabilities);
this._extendedRtpCapabilities = ortc.getExtendedRtpCapabilities(clonedNativeRtpCapabilities, clonedRouterRtpCapabilities);
logger.debug('load() | got extended RTP capabilities:%o', this._extendedRtpCapabilities);

@@ -351,0 +354,0 @@ // Check whether we can produce audio/video.

@@ -11,3 +11,3 @@ import debug from 'debug';

*/
export declare const version = "3.7.6";
export declare const version = "3.7.7";
/**

@@ -14,0 +14,0 @@ * Expose Device class and detectDevice() helper.

@@ -40,3 +40,3 @@ "use strict";

*/
exports.version = '3.7.6';
exports.version = '3.7.7';
/**

@@ -43,0 +43,0 @@ * Expose parseScalabilityMode() function.

@@ -470,3 +470,3 @@ "use strict";

for (let idx = 0; idx < codecs.length; ++idx) {
if (matchCodecs(codecs[idx], capCodec)) {
if (matchCodecs(codecs[idx], capCodec, { strict: true })) {
filteredCodecs.push(codecs[idx]);

@@ -473,0 +473,0 @@ if (isRtxCodec(codecs[idx + 1])) {

@@ -32,3 +32,3 @@ "use strict";

function generateRouterRtpCapabilities() {
return {
return utils.deepFreeze({
codecs: [

@@ -195,7 +195,7 @@ {

],
};
});
}
exports.generateRouterRtpCapabilities = generateRouterRtpCapabilities;
function generateNativeRtpCapabilities() {
return {
return utils.deepFreeze({
codecs: [

@@ -314,13 +314,13 @@ {

],
};
});
}
exports.generateNativeRtpCapabilities = generateNativeRtpCapabilities;
function generateNativeSctpCapabilities() {
return {
return utils.deepFreeze({
numStreams: { OS: 2048, MIS: 2048 },
};
});
}
exports.generateNativeSctpCapabilities = generateNativeSctpCapabilities;
function generateLocalDtlsParameters() {
return {
return utils.deepFreeze({
fingerprints: [

@@ -333,3 +333,3 @@ {

role: 'auto',
};
});
}

@@ -340,8 +340,8 @@ exports.generateLocalDtlsParameters = generateLocalDtlsParameters;

id: generateFakeUuid(),
iceParameters: {
iceParameters: utils.deepFreeze({
iceLite: true,
password: 'yku5ej8nvfaor28lvtrabcx0wkrpkztz',
usernameFragment: 'h3hk1iz6qqlnqlne',
},
iceCandidates: [
}),
iceCandidates: utils.deepFreeze([
{

@@ -367,4 +367,4 @@ foundation: 'udpcandidate',

},
],
dtlsParameters: {
]),
dtlsParameters: utils.deepFreeze({
fingerprints: [

@@ -385,4 +385,4 @@ {

role: 'auto',
},
sctpParameters: {
}),
sctpParameters: utils.deepFreeze({
port: 5000,

@@ -392,3 +392,3 @@ OS: 2048,

maxMessageSize: 2000000,
},
}),
};

@@ -398,5 +398,5 @@ }

function generateProducerRemoteParameters() {
return {
return utils.deepFreeze({
id: generateFakeUuid(),
};
});
}

@@ -411,3 +411,3 @@ exports.generateProducerRemoteParameters = generateProducerRemoteParameters;

kind: 'audio',
rtpParameters: {
rtpParameters: utils.deepFreeze({
codecs: [

@@ -450,3 +450,3 @@ {

},
},
}),
};

@@ -459,3 +459,3 @@ }

kind: 'audio',
rtpParameters: {
rtpParameters: utils.deepFreeze({
codecs: [

@@ -491,3 +491,3 @@ {

},
},
}),
};

@@ -500,3 +500,3 @@ }

kind: 'video',
rtpParameters: {
rtpParameters: utils.deepFreeze({
codecs: [

@@ -563,3 +563,3 @@ {

},
},
}),
};

@@ -572,3 +572,3 @@ }

kind: 'video',
rtpParameters: {
rtpParameters: utils.deepFreeze({
codecs: [

@@ -637,7 +637,7 @@ {

},
},
}),
};
}
default: {
throw new TypeError(`unknown codecMimeType "${codecMimeType}"`);
throw new TypeError(`unknown codecMimeType '${codecMimeType}'`);
}

@@ -648,5 +648,5 @@ }

function generateDataProducerRemoteParameters() {
return {
return utils.deepFreeze({
id: generateFakeUuid(),
};
});
}

@@ -658,9 +658,9 @@ exports.generateDataProducerRemoteParameters = generateDataProducerRemoteParameters;

dataProducerId: generateFakeUuid(),
sctpStreamParameters: {
sctpStreamParameters: utils.deepFreeze({
streamId: 666,
maxPacketLifeTime: 5000,
maxRetransmits: undefined,
},
}),
};
}
exports.generateDataConsumerRemoteParameters = generateDataConsumerRemoteParameters;

@@ -99,8 +99,8 @@ "use strict";

// Clone and sanitize additionalSettings.
additionalSettings = utils.clone(additionalSettings) || {};
delete additionalSettings.iceServers;
delete additionalSettings.iceTransportPolicy;
delete additionalSettings.bundlePolicy;
delete additionalSettings.rtcpMuxPolicy;
delete additionalSettings.sdpSemantics;
const clonedAdditionalSettings = utils.clone(additionalSettings) || {};
delete clonedAdditionalSettings.iceServers;
delete clonedAdditionalSettings.iceTransportPolicy;
delete clonedAdditionalSettings.bundlePolicy;
delete clonedAdditionalSettings.rtcpMuxPolicy;
delete clonedAdditionalSettings.sdpSemantics;
this._handler = handlerFactory();

@@ -115,3 +115,3 @@ this._handler.run({

iceTransportPolicy,
additionalSettings,
additionalSettings: clonedAdditionalSettings,
proprietaryConstraints,

@@ -381,3 +381,2 @@ extendedRtpCapabilities,

logger.debug('consume()');
rtpParameters = utils.clone(rtpParameters);
if (this._closed) {

@@ -405,4 +404,6 @@ throw new errors_1.InvalidStateError('closed');

}
// Clone given RTP parameters to not modify input data.
const clonedRtpParameters = utils.clone(rtpParameters);
// Ensure the device can consume it.
const canConsume = ortc.canReceive(rtpParameters, this._extendedRtpCapabilities);
const canConsume = ortc.canReceive(clonedRtpParameters, this._extendedRtpCapabilities);
if (!canConsume) {

@@ -415,3 +416,3 @@ throw new errors_1.UnsupportedError('cannot consume this Producer');

kind,
rtpParameters,
rtpParameters: clonedRtpParameters,
streamId,

@@ -497,3 +498,2 @@ appData,

logger.debug('consumeData()');
sctpStreamParameters = utils.clone(sctpStreamParameters);
if (this._closed) {

@@ -521,8 +521,10 @@ throw new errors_1.InvalidStateError('closed');

}
// Clone given SCTP stream parameters to not modify input data.
const clonedSctpStreamParameters = utils.clone(sctpStreamParameters);
// This may throw.
ortc.validateSctpStreamParameters(sctpStreamParameters);
ortc.validateSctpStreamParameters(clonedSctpStreamParameters);
// Enqueue command.
return this._awaitQueue.push(async () => {
const { dataChannel } = await this._handler.receiveDataChannel({
sctpStreamParameters,
sctpStreamParameters: clonedSctpStreamParameters,
label,

@@ -535,3 +537,3 @@ protocol,

dataChannel,
sctpStreamParameters,
sctpStreamParameters: clonedSctpStreamParameters,
appData,

@@ -538,0 +540,0 @@ });

@@ -9,2 +9,7 @@ /**

export declare function generateRandomNumber(): number;
/**
* Make an object or array recursively immutable.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze.
*/
export declare function deepFreeze<T>(object: T): T;
//# sourceMappingURL=utils.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateRandomNumber = exports.clone = void 0;
exports.deepFreeze = exports.generateRandomNumber = exports.clone = void 0;
/**

@@ -30,1 +30,18 @@ * Clones the given value.

exports.generateRandomNumber = generateRandomNumber;
/**
* Make an object or array recursively immutable.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze.
*/
function deepFreeze(object) {
// Retrieve the property names defined on object.
const propNames = Reflect.ownKeys(object);
// Freeze properties before freezing self.
for (const name of propNames) {
const value = object[name];
if ((value && typeof value === 'object') || typeof value === 'function') {
deepFreeze(value);
}
}
return Object.freeze(object);
}
exports.deepFreeze = deepFreeze;
{
"name": "mediasoup-client",
"version": "3.7.6",
"version": "3.7.7",
"description": "mediasoup client side TypeScript library",

@@ -83,7 +83,7 @@ "contributors": [

"@types/ua-parser-js": "^0.7.39",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-prettier": "^5.1.3",

@@ -94,4 +94,4 @@ "jest": "^29.7.0",

"ts-jest": "^29.1.2",
"typescript": "^5.3.3"
"typescript": "^5.4.5"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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