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

@livepeer/core-web

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livepeer/core-web - npm Package Compare versions

Comparing version 4.2.8 to 5.0.0

27

dist/broadcast/index.js

@@ -81,4 +81,31 @@ // src/broadcast.ts

}
function preferCodec(sdp, codec) {
const lines = sdp.split("\r\n");
const mLineIndex = lines.findIndex((line) => line.startsWith("m=video"));
if (mLineIndex === -1) return sdp;
const codecRegex = new RegExp(`a=rtpmap:(\\d+) ${codec}(/\\d+)+`);
const codecLine = lines.find((line) => codecRegex.test(line));
if (!codecLine) return sdp;
const codecPayload = codecRegex.exec(codecLine)[1];
const mLineElements = lines[mLineIndex].split(" ");
const reorderedMLine = [
...mLineElements.slice(0, 3),
codecPayload,
...mLineElements.slice(3).filter((payload) => payload !== codecPayload)
];
lines[mLineIndex] = reorderedMLine.join(" ");
return lines.join("\r\n");
}
async function constructClientOffer(peerConnection, endpoint) {
if (peerConnection && endpoint) {
const originalCreateOffer = peerConnection.createOffer.bind(peerConnection);
peerConnection.createOffer = async function(...args) {
const originalOffer = await originalCreateOffer.apply(this, args);
return new RTCSessionDescription({
// @ts-ignore (TODO: fix this)
type: originalOffer.type,
// @ts-ignore (TODO: fix this)
sdp: preferCodec(originalOffer.sdp, "H264")
});
};
const offer = await peerConnection.createOffer();

@@ -85,0 +112,0 @@ await peerConnection.setLocalDescription(offer);

@@ -218,4 +218,31 @@ // src/media/controls/controller.ts

}
function preferCodec(sdp, codec) {
const lines = sdp.split("\r\n");
const mLineIndex = lines.findIndex((line) => line.startsWith("m=video"));
if (mLineIndex === -1) return sdp;
const codecRegex = new RegExp(`a=rtpmap:(\\d+) ${codec}(/\\d+)+`);
const codecLine = lines.find((line) => codecRegex.test(line));
if (!codecLine) return sdp;
const codecPayload = codecRegex.exec(codecLine)[1];
const mLineElements = lines[mLineIndex].split(" ");
const reorderedMLine = [
...mLineElements.slice(0, 3),
codecPayload,
...mLineElements.slice(3).filter((payload) => payload !== codecPayload)
];
lines[mLineIndex] = reorderedMLine.join(" ");
return lines.join("\r\n");
}
async function constructClientOffer(peerConnection, endpoint) {
if (peerConnection && endpoint) {
const originalCreateOffer = peerConnection.createOffer.bind(peerConnection);
peerConnection.createOffer = async function(...args) {
const originalOffer = await originalCreateOffer.apply(this, args);
return new RTCSessionDescription({
// @ts-ignore (TODO: fix this)
type: originalOffer.type,
// @ts-ignore (TODO: fix this)
sdp: preferCodec(originalOffer.sdp, "H264")
});
};
const offer = await peerConnection.createOffer();

@@ -222,0 +249,0 @@ await peerConnection.setLocalDescription(offer);

@@ -59,4 +59,31 @@ // src/webrtc/shared.ts

}
function preferCodec(sdp, codec) {
const lines = sdp.split("\r\n");
const mLineIndex = lines.findIndex((line) => line.startsWith("m=video"));
if (mLineIndex === -1) return sdp;
const codecRegex = new RegExp(`a=rtpmap:(\\d+) ${codec}(/\\d+)+`);
const codecLine = lines.find((line) => codecRegex.test(line));
if (!codecLine) return sdp;
const codecPayload = codecRegex.exec(codecLine)[1];
const mLineElements = lines[mLineIndex].split(" ");
const reorderedMLine = [
...mLineElements.slice(0, 3),
codecPayload,
...mLineElements.slice(3).filter((payload) => payload !== codecPayload)
];
lines[mLineIndex] = reorderedMLine.join(" ");
return lines.join("\r\n");
}
async function constructClientOffer(peerConnection, endpoint) {
if (peerConnection && endpoint) {
const originalCreateOffer = peerConnection.createOffer.bind(peerConnection);
peerConnection.createOffer = async function(...args) {
const originalOffer = await originalCreateOffer.apply(this, args);
return new RTCSessionDescription({
// @ts-ignore (TODO: fix this)
type: originalOffer.type,
// @ts-ignore (TODO: fix this)
sdp: preferCodec(originalOffer.sdp, "H264")
});
};
const offer = await peerConnection.createOffer();

@@ -63,0 +90,0 @@ await peerConnection.setLocalDescription(offer);

2

package.json

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "4.2.8",
"version": "5.0.0",
"type": "module",

@@ -8,0 +8,0 @@ "repository": {

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

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

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