diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 069e50779..33644f150 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,16 +1,15 @@ import type { Participant, TrackPublication } from 'livekit-client'; -import { LocalParticipant, RemoteParticipant } from 'livekit-client'; -import type { PinState } from './types'; import type { TrackReference } from './track-reference'; import { isEqualTrackRef } from './track-reference'; +import type { PinState } from './types'; export function isLocal(p: Participant) { - return p instanceof LocalParticipant; + return p.isLocal; } export function isRemote(p: Participant) { - return p instanceof RemoteParticipant; + return !p.isLocal; } export const attachIfSubscribed = ( diff --git a/packages/react/src/components/RoomAudioRenderer.tsx b/packages/react/src/components/RoomAudioRenderer.tsx index d4f9f14c0..3e8ea26fe 100644 --- a/packages/react/src/components/RoomAudioRenderer.tsx +++ b/packages/react/src/components/RoomAudioRenderer.tsx @@ -1,4 +1,4 @@ -import { getTrackReferenceId, isLocal } from '@livekit/components-core'; +import { getTrackReferenceId } from '@livekit/components-core'; import { Track } from 'livekit-client'; import * as React from 'react'; import { useTracks } from '../hooks'; @@ -36,7 +36,7 @@ export function RoomAudioRenderer({ volume, muted }: RoomAudioRendererProps) { updateOnlyOn: [], onlySubscribed: true, }, - ).filter((ref) => !isLocal(ref.participant) && ref.publication.kind === Track.Kind.Audio); + ).filter((ref) => !ref.participant.isLocal && ref.publication.kind === Track.Kind.Audio); return (