Skip to content

Commit

Permalink
Merge pull request #499 from whereby/kevinhanna/cob-1331-mediasoup-sa…
Browse files Browse the repository at this point in the history
…fari-handler-not-using-simulcast-bandwidth

media: add Safari17 device handler
  • Loading branch information
kevinwhereby authored Jan 6, 2025
2 parents 40e2d27 + 8124373 commit 67c8ea2
Show file tree
Hide file tree
Showing 15 changed files with 1,196 additions and 79 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-crabs-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@whereby.com/media": patch
---

Add custom Safari17 mediasoup device hanlder
3 changes: 1 addition & 2 deletions packages/core/src/redux/slices/rtcConnection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { createReactor, startAppListening } from "../../listenerMiddleware";
import { selectRemoteClients, streamStatusUpdated } from "../remoteParticipants";
import { StreamState } from "../../../RoomParticipant";
import { selectAppIsNodeSdk, selectAppIsActive, doAppStop } from "../app";
import { Safari12 as MediasoupDeviceHandler } from "mediasoup-client/lib/handlers/Safari12.js";

import {
selectIsCameraEnabled,
selectIsMicrophoneEnabled,
Expand Down Expand Up @@ -197,7 +197,6 @@ export const doConnectRtc = createAppThunk(() => (dispatch, getState) => {
vp9On: false,
h264On: false,
simulcastScreenshareOn: false,
deviceHandlerFactory: isNodeSdk ? MediasoupDeviceHandler.createFactory() : undefined,
},
});

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/redux/tests/store/rtcConnection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("actions", () => {
});

describe("when isNodeSdk is true", () => {
it("uses a custom mediasoup device", () => {
it("initializes the RtcManagerDispatcher with that feature", () => {
const store = createStore({
withSignalConnection: true,
initialState: {
Expand All @@ -97,7 +97,7 @@ describe("actions", () => {
expect(RtcManagerDispatcher).toHaveBeenCalledTimes(1);
expect(RtcManagerDispatcher).toHaveBeenCalledWith(
expect.objectContaining({
features: expect.objectContaining({ deviceHandlerFactory: expect.any(Function) }),
features: expect.objectContaining({ isNodeSdk: true }),
}),
);
expect(diff(before, after)).toEqual({
Expand Down
2 changes: 2 additions & 0 deletions packages/media/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"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 @@ -58,6 +59,7 @@
"sdp-transform": "^2.14.2",
"socket.io-client": "4.7.2",
"typescript": "^5.3.3",
"ua-parser-js": "^1.0.38",
"uuid": "^9.0.1",
"uuid-validate": "^0.0.3",
"webrtc-adapter": "^9.0.1"
Expand Down
Loading

0 comments on commit 67c8ea2

Please sign in to comment.