Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Fix my own PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stasiak committed Aug 31, 2023
1 parent 4be7afb commit e6420ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
10 changes: 9 additions & 1 deletion examples/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ List of examples:
- receive media from other peers
- almost no UI

// todo add description
- [useCameraAndMicrophone hook](https://github.com/jellyfish-dev/react-client-sdk/tree/main/examples/use-camera-and-microphone) - minimal
example of usage of `useCameraAndMicrophone` hook

- TypeScript with React Client
- connect to Jellyfish server
- join room
- set up audio and video devices separately
- decide whether to send them automatically
- almost no UI
19 changes: 4 additions & 15 deletions examples/use-camera-and-microphone-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ import { AUDIO_TRACK_CONSTRAINTS, VIDEO_TRACK_CONSTRAINTS } from "@jellyfish-dev
import { Fragment } from "react";
import { Badge } from "./Badge";

// todo fix error
// webRTCEndpoint.js:991 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getSenders')
// at WebRTCEndpoint2.findSender (webRTCEndpoint.js:991:32
// {
// streamWhenConnected: false,
// startStreamingWhenDeviceReady: true,
// startOnMount: false,
// storage: true,
// }
// Click connect -> start devices
// Jeżeli zaczniesz streamować urządzenia bardzo szybko to wybucha.
const tokenAtom = atomWithStorage("token", "");

const videoAutoStreamingAtom = atomWithStorage<boolean | undefined>("videoAutoStreaming", undefined);
Expand Down Expand Up @@ -74,10 +63,10 @@ export const App = () => {
autoStreaming: videoAutoStreaming,
preview: videoPreview,
defaultTrackMetadata: DEFAULT_VIDEO_TRACK_METADATA,
// defaultSimulcastConfig: {
// enabled: true,
// active_encodings: ["l", "m", "h"]
// }
defaultSimulcastConfig: {
enabled: true,
active_encodings: ["l", "m", "h"]
}
},
microphone: {
trackConstraints: AUDIO_TRACK_CONSTRAINTS,
Expand Down
4 changes: 0 additions & 4 deletions src/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,6 @@ const onConnect = <PeerMetadata, TrackMetadata>(
action.dispatch({ type: "onDisconnected" });
});

// important jeżeli użytkownik zapnie się na eventy z JellyfishClient
// to one mogą się odpalić wcześniej niż te tutaj zasetupowane metody
// tak się dzieje na przykład z eventem joined gdy chcę od razu zacząć
// przesyłać tracki zaraz po dołączeniu
client.on("joined", (peerId: string, peersInRoom: Endpoint[]) => {
action.dispatch({ type: "onJoinSuccess", peersInRoom, peerId, peerMetadata });
});
Expand Down

0 comments on commit e6420ef

Please sign in to comment.