Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from cloudflare:main #36

Merged
merged 6 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions app/components/ParticipantsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ export const ParticipantsDialog: FC<ParticipantDialogProps> = ({
onOpenChange,
}) => {
const { userMedia } = useRoomContext()
const allParticipants = [identity, ...otherUsers]
.filter((x): x is User => x !== undefined)
.sort((a, b) => {
const nameA = a.name.toLowerCase()
const nameB = b.name.toLowerCase()

if (nameA < nameB) return -1
if (nameA > nameB) return 1
return 0
})
return (
<Dialog open={open} onOpenChange={onOpenChange}>
{children}
Expand All @@ -102,17 +112,19 @@ export const ParticipantsDialog: FC<ParticipantDialogProps> = ({
{participantCount(otherUsers.length + 1)}
</h2>
<ul className="space-y-2">
{identity && (
<UserListItem
user={identity}
audioTrack={userMedia.audioStreamTrack}
>
{identity.name}
</UserListItem>
{allParticipants.map((p) =>
p === identity ? (
<UserListItem
user={identity}
audioTrack={userMedia.audioStreamTrack}
key={identity.id}
>
{identity.name}
</UserListItem>
) : (
<OtherUser user={p} key={p.id} />
)
)}
{otherUsers.map((u) => (
<OtherUser user={u} key={u.id} />
))}
</ul>
</div>
</DialogContent>
Expand Down
4 changes: 3 additions & 1 deletion app/utils/rxjs/inaudibleAudioTrack$.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export const inaudibleAudioTrack$ = new Observable<MediaStreamTrack>(

const oscillator = audioContext.createOscillator()
oscillator.type = 'triangle'
// roughly sounds like a box fan
oscillator.frequency.setValueAtTime(20, audioContext.currentTime)

const gainNode = audioContext.createGain()
gainNode.gain.setValueAtTime(0.02, audioContext.currentTime)
// even w/ gain at 0 some packets are sent
gainNode.gain.setValueAtTime(0, audioContext.currentTime)

oscillator.connect(gainNode)

Expand Down