Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinwhereby committed Dec 6, 2024
1 parent 7ed6942 commit 2203425
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"dist/**/*.d.cts"
],
"dependencies": {
"@types/ua-parser-js": "^0.7.39",
"check-ip": "^1.1.1",
"events": "^3.3.0",
"ip-address": "^9.0.5",
Expand All @@ -67,6 +66,7 @@
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@types/ua-parser-js": "^0.7.39",
"jest-websocket-mock": "^2.5.0",
"process": "^0.11.10"
},
Expand Down
30 changes: 22 additions & 8 deletions packages/media/src/utils/Safari17Handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export class Safari17 extends HandlerInterface {
rtcpMuxPolicy: "require",
...additionalSettings,
},
proprietaryConstraints
proprietaryConstraints,
);

this._pc.addEventListener("icegatheringstatechange", () => {
Expand Down Expand Up @@ -329,18 +329,32 @@ export class Safari17 extends HandlerInterface {
}

const sendingRemoteRtpParameters = utils.clone<RtpParameters>(
this._sendingRemoteRtpParametersByKind![track.kind]
this._sendingRemoteRtpParametersByKind![track.kind],
);

// This may throw.
sendingRemoteRtpParameters.codecs = ortc.reduceCodecs(sendingRemoteRtpParameters.codecs, codec);

const mediaSectionIdx = this._remoteSdp!.getNextMediaSectionIdx();
const transceiver = this._pc.addTransceiver(track, {
direction: "sendonly",
streams: [this._sendStream],
sendEncodings: encodings,
});
let transceiver: RTCRtpTransceiver;
try {
transceiver = this._pc.addTransceiver(track, {
direction: "sendonly",
streams: [this._sendStream],
sendEncodings: encodings,
});
} catch (e) {
if ((e as Error).message === "Type Error") {
console.warn("Failed to add transceiver with encodings, retrying without");
transceiver = this._pc.addTransceiver(track, {
direction: "sendonly",
streams: [this._sendStream],
});
} else {
console.error(e, (e as Error).message, typeof e);
throw e;
}
}

if (onRtpSender) {
onRtpSender(transceiver.sender);
Expand All @@ -363,7 +377,7 @@ export class Safari17 extends HandlerInterface {
await this._pc.setLocalDescription(offer);

// We can now get the transceiver.mid.
const localId = transceiver.mid;
const localId = transceiver.mid!;

// Set MID.
sendingRtpParameters.mid = localId;
Expand Down
1 change: 1 addition & 0 deletions packages/media/src/webrtc/VegaRtcManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export default class VegaRtcManager implements RtcManager {
const handlerName = getHandler();

if (handlerName === "Safari17" && !deviceHandlerFactory) {
console.log("Using Safari17 Handler");

Check failure on line 132 in packages/media/src/webrtc/VegaRtcManager/index.ts

View workflow job for this annotation

GitHub Actions / Test

Unexpected console statement
// Patched Safari12 handler to fix simulcast bandwith limits
deviceHandlerFactory = Safari17.createFactory();
}
Expand Down
7 changes: 7 additions & 0 deletions test-results/.last-run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"status": "failed",
"failedTests": [
"ba7277a94dc460ce76d7-3301ec8463f8e6360ab6",
"ba7277a94dc460ce76d7-7404d123d279f2feff97"
]
}
31 changes: 18 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4697,11 +4697,11 @@
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@playwright/test@^1.38.1":
version "1.41.1"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.41.1.tgz#6954139ed4a67999f1b17460aa3d184f4b334f18"
integrity sha512-9g8EWTjiQ9yFBXc6HjCWe41msLpxEX0KhmfmPl9RPLJdfzL4F0lg2BdJ91O9azFdl11y1pmpwdjBiSxvqc+btw==
version "1.49.0"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.49.0.tgz#74227385b58317ee076b86b56d0e1e1b25cff01e"
integrity sha512-DMulbwQURa8rNIQrf94+jPJQ4FmOVdpE5ZppRNvWVjvhC+6sOeo28r8MgIpQRYouXRtt/FCCXU7zn20jnHR4Qw==
dependencies:
playwright "1.41.1"
playwright "1.49.0"

"@popperjs/core@^2.9.3":
version "2.11.8"
Expand Down Expand Up @@ -14492,17 +14492,17 @@ pkg-up@^3.1.0:
dependencies:
find-up "^3.0.0"

playwright-core@1.41.1:
version "1.41.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.41.1.tgz#9c152670010d9d6f970f34b68e3e935d3c487431"
integrity sha512-/KPO5DzXSMlxSX77wy+HihKGOunh3hqndhqeo/nMxfigiKzogn8kfL0ZBDu0L1RKgan5XHCPmn6zXd2NUJgjhg==
playwright-core@1.49.0:
version "1.49.0"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.49.0.tgz#8e69ffed3f41855b854982f3632f2922c890afcb"
integrity sha512-R+3KKTQF3npy5GTiKH/T+kdhoJfJojjHESR1YEWhYuEKRVfVaxH3+4+GvXE5xyCngCxhxnykk0Vlah9v8fs3jA==

playwright@1.41.1:
version "1.41.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.41.1.tgz#83325f34165840d019355c2a78a50f21ed9b9c85"
integrity sha512-gdZAWG97oUnbBdRL3GuBvX3nDDmUOuqzV/D24dytqlKt+eI5KbwusluZRGljx1YoJKZ2NRPaeWiFTeGZO7SosQ==
playwright@1.49.0:
version "1.49.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.49.0.tgz#df6b9e05423377a99658202844a294a8afb95d0a"
integrity sha512-eKpmys0UFDnfNb3vfsf8Vx2LEOtflgRebl0Im2eQQnYMA4Aqd+Zw8bEOB+7ZKvN76901mRnqdsiOGKxzVTbi7A==
dependencies:
playwright-core "1.41.1"
playwright-core "1.49.0"
optionalDependencies:
fsevents "2.3.2"

Expand Down Expand Up @@ -17282,6 +17282,11 @@ ua-parser-js@^1.0.35:
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.38.tgz#66bb0c4c0e322fe48edfe6d446df6042e62f25e2"
integrity sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==

ua-parser-js@^1.0.38:
version "1.0.39"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.39.tgz#bfc07f361549bf249bd8f4589a4cccec18fd2018"
integrity sha512-k24RCVWlEcjkdOxYmVJgeD/0a1TiSpqLg+ZalVGV9lsnr4yqu0w7tX/x2xX6G4zpkgQnRf89lxuZ1wsbjXM8lw==

ua-parser-js@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-2.0.0.tgz#fae88e352510198bd29a6dd41624c7cd0d2c7ade"
Expand Down

0 comments on commit 2203425

Please sign in to comment.