@werxt/livekit-components-react 2.9.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +36 -0
- package/dist/assets/icons/CameraDisabledIcon.d.ts +11 -0
- package/dist/assets/icons/CameraDisabledIcon.d.ts.map +1 -0
- package/dist/assets/icons/CameraIcon.d.ts +11 -0
- package/dist/assets/icons/CameraIcon.d.ts.map +1 -0
- package/dist/assets/icons/ChatCloseIcon.d.ts +11 -0
- package/dist/assets/icons/ChatCloseIcon.d.ts.map +1 -0
- package/dist/assets/icons/ChatIcon.d.ts +11 -0
- package/dist/assets/icons/ChatIcon.d.ts.map +1 -0
- package/dist/assets/icons/Chevron.d.ts +11 -0
- package/dist/assets/icons/Chevron.d.ts.map +1 -0
- package/dist/assets/icons/FocusToggleIcon.d.ts +11 -0
- package/dist/assets/icons/FocusToggleIcon.d.ts.map +1 -0
- package/dist/assets/icons/GearIcon.d.ts +11 -0
- package/dist/assets/icons/GearIcon.d.ts.map +1 -0
- package/dist/assets/icons/LeaveIcon.d.ts +11 -0
- package/dist/assets/icons/LeaveIcon.d.ts.map +1 -0
- package/dist/assets/icons/LockLockedIcon.d.ts +11 -0
- package/dist/assets/icons/LockLockedIcon.d.ts.map +1 -0
- package/dist/assets/icons/MicDisabledIcon.d.ts +11 -0
- package/dist/assets/icons/MicDisabledIcon.d.ts.map +1 -0
- package/dist/assets/icons/MicIcon.d.ts +11 -0
- package/dist/assets/icons/MicIcon.d.ts.map +1 -0
- package/dist/assets/icons/QualityExcellentIcon.d.ts +11 -0
- package/dist/assets/icons/QualityExcellentIcon.d.ts.map +1 -0
- package/dist/assets/icons/QualityGoodIcon.d.ts +11 -0
- package/dist/assets/icons/QualityGoodIcon.d.ts.map +1 -0
- package/dist/assets/icons/QualityPoorIcon.d.ts +11 -0
- package/dist/assets/icons/QualityPoorIcon.d.ts.map +1 -0
- package/dist/assets/icons/QualityUnknownIcon.d.ts +11 -0
- package/dist/assets/icons/QualityUnknownIcon.d.ts.map +1 -0
- package/dist/assets/icons/ScreenShareIcon.d.ts +11 -0
- package/dist/assets/icons/ScreenShareIcon.d.ts.map +1 -0
- package/dist/assets/icons/ScreenShareStopIcon.d.ts +11 -0
- package/dist/assets/icons/ScreenShareStopIcon.d.ts.map +1 -0
- package/dist/assets/icons/SpinnerIcon.d.ts +11 -0
- package/dist/assets/icons/SpinnerIcon.d.ts.map +1 -0
- package/dist/assets/icons/UnfocusToggleIcon.d.ts +11 -0
- package/dist/assets/icons/UnfocusToggleIcon.d.ts.map +1 -0
- package/dist/assets/icons/index.d.ts +20 -0
- package/dist/assets/icons/index.d.ts.map +1 -0
- package/dist/assets/icons/util.d.ts +11 -0
- package/dist/assets/icons/util.d.ts.map +1 -0
- package/dist/assets/images/ParticipantPlaceholder.d.ts +11 -0
- package/dist/assets/images/ParticipantPlaceholder.d.ts.map +1 -0
- package/dist/assets/images/index.d.ts +2 -0
- package/dist/assets/images/index.d.ts.map +1 -0
- package/dist/components/ChatEntry.d.ts +35 -0
- package/dist/components/ChatEntry.d.ts.map +1 -0
- package/dist/components/ConnectionState.d.ts +23 -0
- package/dist/components/ConnectionState.d.ts.map +1 -0
- package/dist/components/ConnectionStateToast.d.ts +13 -0
- package/dist/components/ConnectionStateToast.d.ts.map +1 -0
- package/dist/components/LiveKitRoom.d.ts +92 -0
- package/dist/components/LiveKitRoom.d.ts.map +1 -0
- package/dist/components/ParticipantLoop.d.ts +28 -0
- package/dist/components/ParticipantLoop.d.ts.map +1 -0
- package/dist/components/RoomAudioRenderer.d.ts +29 -0
- package/dist/components/RoomAudioRenderer.d.ts.map +1 -0
- package/dist/components/RoomName.d.ts +20 -0
- package/dist/components/RoomName.d.ts.map +1 -0
- package/dist/components/SessionProvider.d.ts +13 -0
- package/dist/components/SessionProvider.d.ts.map +1 -0
- package/dist/components/Toast.d.ts +14 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/TrackLoop.d.ts +26 -0
- package/dist/components/TrackLoop.d.ts.map +1 -0
- package/dist/components/controls/ChatToggle.d.ts +19 -0
- package/dist/components/controls/ChatToggle.d.ts.map +1 -0
- package/dist/components/controls/ClearPinButton.d.ts +20 -0
- package/dist/components/controls/ClearPinButton.d.ts.map +1 -0
- package/dist/components/controls/DisconnectButton.d.ts +19 -0
- package/dist/components/controls/DisconnectButton.d.ts.map +1 -0
- package/dist/components/controls/FocusToggle.d.ts +21 -0
- package/dist/components/controls/FocusToggle.d.ts.map +1 -0
- package/dist/components/controls/MediaDeviceSelect.d.ts +40 -0
- package/dist/components/controls/MediaDeviceSelect.d.ts.map +1 -0
- package/dist/components/controls/PaginationControl.d.ts +9 -0
- package/dist/components/controls/PaginationControl.d.ts.map +1 -0
- package/dist/components/controls/PaginationIndicator.d.ts +7 -0
- package/dist/components/controls/PaginationIndicator.d.ts.map +1 -0
- package/dist/components/controls/SettingsMenuToggle.d.ts +13 -0
- package/dist/components/controls/SettingsMenuToggle.d.ts.map +1 -0
- package/dist/components/controls/StartAudio.d.ts +24 -0
- package/dist/components/controls/StartAudio.d.ts.map +1 -0
- package/dist/components/controls/StartMediaButton.d.ts +22 -0
- package/dist/components/controls/StartMediaButton.d.ts.map +1 -0
- package/dist/components/controls/TrackToggle.d.ts +32 -0
- package/dist/components/controls/TrackToggle.d.ts.map +1 -0
- package/dist/components/index.d.ts +30 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/layout/CarouselLayout.d.ts +27 -0
- package/dist/components/layout/CarouselLayout.d.ts.map +1 -0
- package/dist/components/layout/FocusLayout.d.ts +25 -0
- package/dist/components/layout/FocusLayout.d.ts.map +1 -0
- package/dist/components/layout/GridLayout.d.ts +26 -0
- package/dist/components/layout/GridLayout.d.ts.map +1 -0
- package/dist/components/layout/LayoutContextProvider.d.ts +12 -0
- package/dist/components/layout/LayoutContextProvider.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +4 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/participant/AudioTrack.d.ts +33 -0
- package/dist/components/participant/AudioTrack.d.ts.map +1 -0
- package/dist/components/participant/AudioVisualizer.d.ts +22 -0
- package/dist/components/participant/AudioVisualizer.d.ts.map +1 -0
- package/dist/components/participant/BarVisualizer.d.ts +77 -0
- package/dist/components/participant/BarVisualizer.d.ts.map +1 -0
- package/dist/components/participant/ConnectionQualityIndicator.d.ts +16 -0
- package/dist/components/participant/ConnectionQualityIndicator.d.ts.map +1 -0
- package/dist/components/participant/ParticipantAudioTile.d.ts +14 -0
- package/dist/components/participant/ParticipantAudioTile.d.ts.map +1 -0
- package/dist/components/participant/ParticipantName.d.ts +17 -0
- package/dist/components/participant/ParticipantName.d.ts.map +1 -0
- package/dist/components/participant/ParticipantTile.d.ts +49 -0
- package/dist/components/participant/ParticipantTile.d.ts.map +1 -0
- package/dist/components/participant/TrackMutedIndicator.d.ts +19 -0
- package/dist/components/participant/TrackMutedIndicator.d.ts.map +1 -0
- package/dist/components/participant/VideoTrack.d.ts +23 -0
- package/dist/components/participant/VideoTrack.d.ts.map +1 -0
- package/dist/components/participant/animationSequences/connectingSequence.d.ts +2 -0
- package/dist/components/participant/animationSequences/connectingSequence.d.ts.map +1 -0
- package/dist/components/participant/animationSequences/listeningSequence.d.ts +2 -0
- package/dist/components/participant/animationSequences/listeningSequence.d.ts.map +1 -0
- package/dist/components/participant/animationSequences/thinkingSequence.d.ts +2 -0
- package/dist/components/participant/animationSequences/thinkingSequence.d.ts.map +1 -0
- package/dist/components/participant/animators/useBarAnimator.d.ts +3 -0
- package/dist/components/participant/animators/useBarAnimator.d.ts.map +1 -0
- package/dist/components-lNrIMTWQ.mjs +1051 -0
- package/dist/components-lNrIMTWQ.mjs.map +1 -0
- package/dist/context/chat-context.d.ts +23 -0
- package/dist/context/chat-context.d.ts.map +1 -0
- package/dist/context/feature-context.d.ts +14 -0
- package/dist/context/feature-context.d.ts.map +1 -0
- package/dist/context/index.d.ts +10 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/layout-context.d.ts +32 -0
- package/dist/context/layout-context.d.ts.map +1 -0
- package/dist/context/participant-context.d.ts +22 -0
- package/dist/context/participant-context.d.ts.map +1 -0
- package/dist/context/pin-context.d.ts +17 -0
- package/dist/context/pin-context.d.ts.map +1 -0
- package/dist/context/room-context.d.ts +22 -0
- package/dist/context/room-context.d.ts.map +1 -0
- package/dist/context/session-context.d.ts +22 -0
- package/dist/context/session-context.d.ts.map +1 -0
- package/dist/context/track-reference-context.d.ts +25 -0
- package/dist/context/track-reference-context.d.ts.map +1 -0
- package/dist/contexts-D4V9wQRc.mjs +4026 -0
- package/dist/contexts-D4V9wQRc.mjs.map +1 -0
- package/dist/hooks/cloud/krisp/useKrispNoiseFilter.d.ts +42 -0
- package/dist/hooks/cloud/krisp/useKrispNoiseFilter.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +54 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/internal/index.d.ts +10 -0
- package/dist/hooks/internal/index.d.ts.map +1 -0
- package/dist/hooks/internal/useMediaQuery.d.ts +7 -0
- package/dist/hooks/internal/useMediaQuery.d.ts.map +1 -0
- package/dist/hooks/internal/useObservableState.d.ts +6 -0
- package/dist/hooks/internal/useObservableState.d.ts.map +1 -0
- package/dist/hooks/internal/useResizeObserver.d.ts +14 -0
- package/dist/hooks/internal/useResizeObserver.d.ts.map +1 -0
- package/dist/hooks/useAgent.d.ts +219 -0
- package/dist/hooks/useAgent.d.ts.map +1 -0
- package/dist/hooks/useAudioPlayback.d.ts +15 -0
- package/dist/hooks/useAudioPlayback.d.ts.map +1 -0
- package/dist/hooks/useChat.d.ts +43 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useChatToggle.d.ts +21 -0
- package/dist/hooks/useChatToggle.d.ts.map +1 -0
- package/dist/hooks/useClearPinButton.d.ts +15 -0
- package/dist/hooks/useClearPinButton.d.ts.map +1 -0
- package/dist/hooks/useConnectionQualityIndicator.d.ts +20 -0
- package/dist/hooks/useConnectionQualityIndicator.d.ts.map +1 -0
- package/dist/hooks/useConnectionStatus.d.ts +12 -0
- package/dist/hooks/useConnectionStatus.d.ts.map +1 -0
- package/dist/hooks/useDataChannel.d.ts +38 -0
- package/dist/hooks/useDataChannel.d.ts.map +1 -0
- package/dist/hooks/useDisconnectButton.d.ts +21 -0
- package/dist/hooks/useDisconnectButton.d.ts.map +1 -0
- package/dist/hooks/useEvents.d.ts +9 -0
- package/dist/hooks/useEvents.d.ts.map +1 -0
- package/dist/hooks/useFacingMode.d.ts +10 -0
- package/dist/hooks/useFacingMode.d.ts.map +1 -0
- package/dist/hooks/useFocusToggle.d.ts +26 -0
- package/dist/hooks/useFocusToggle.d.ts.map +1 -0
- package/dist/hooks/useGridLayout.d.ts +27 -0
- package/dist/hooks/useGridLayout.d.ts.map +1 -0
- package/dist/hooks/useIsEncrypted.d.ts +12 -0
- package/dist/hooks/useIsEncrypted.d.ts.map +1 -0
- package/dist/hooks/useIsMuted.d.ts +22 -0
- package/dist/hooks/useIsMuted.d.ts.map +1 -0
- package/dist/hooks/useIsRecording.d.ts +11 -0
- package/dist/hooks/useIsRecording.d.ts.map +1 -0
- package/dist/hooks/useIsSpeaking.d.ts +11 -0
- package/dist/hooks/useIsSpeaking.d.ts.map +1 -0
- package/dist/hooks/useLiveKitRoom.d.ts +19 -0
- package/dist/hooks/useLiveKitRoom.d.ts.map +1 -0
- package/dist/hooks/useLocalParticipant.d.ts +29 -0
- package/dist/hooks/useLocalParticipant.d.ts.map +1 -0
- package/dist/hooks/useLocalParticipantPermissions.d.ts +12 -0
- package/dist/hooks/useLocalParticipantPermissions.d.ts.map +1 -0
- package/dist/hooks/useMediaDeviceSelect.d.ts +41 -0
- package/dist/hooks/useMediaDeviceSelect.d.ts.map +1 -0
- package/dist/hooks/useMediaDevices.d.ts +15 -0
- package/dist/hooks/useMediaDevices.d.ts.map +1 -0
- package/dist/hooks/useMediaTrackBySourceOrName.d.ts +18 -0
- package/dist/hooks/useMediaTrackBySourceOrName.d.ts.map +1 -0
- package/dist/hooks/usePagination.d.ts +24 -0
- package/dist/hooks/usePagination.d.ts.map +1 -0
- package/dist/hooks/useParticipantAttributes.d.ts +30 -0
- package/dist/hooks/useParticipantAttributes.d.ts.map +1 -0
- package/dist/hooks/useParticipantInfo.d.ts +21 -0
- package/dist/hooks/useParticipantInfo.d.ts.map +1 -0
- package/dist/hooks/useParticipantPermissions.d.ts +17 -0
- package/dist/hooks/useParticipantPermissions.d.ts.map +1 -0
- package/dist/hooks/useParticipantTile.d.ts +22 -0
- package/dist/hooks/useParticipantTile.d.ts.map +1 -0
- package/dist/hooks/useParticipantTracks.d.ts +14 -0
- package/dist/hooks/useParticipantTracks.d.ts.map +1 -0
- package/dist/hooks/useParticipants.d.ts +30 -0
- package/dist/hooks/useParticipants.d.ts.map +1 -0
- package/dist/hooks/usePersistentUserChoices.d.ts +35 -0
- package/dist/hooks/usePersistentUserChoices.d.ts.map +1 -0
- package/dist/hooks/usePinnedTracks.d.ts +14 -0
- package/dist/hooks/usePinnedTracks.d.ts.map +1 -0
- package/dist/hooks/useRemoteParticipant.d.ts +35 -0
- package/dist/hooks/useRemoteParticipant.d.ts.map +1 -0
- package/dist/hooks/useRemoteParticipants.d.ts +30 -0
- package/dist/hooks/useRemoteParticipants.d.ts.map +1 -0
- package/dist/hooks/useRoomInfo.d.ts +21 -0
- package/dist/hooks/useRoomInfo.d.ts.map +1 -0
- package/dist/hooks/useSequentialRoomConnectDisconnect.d.ts +27 -0
- package/dist/hooks/useSequentialRoomConnectDisconnect.d.ts.map +1 -0
- package/dist/hooks/useSession.d.ts +130 -0
- package/dist/hooks/useSession.d.ts.map +1 -0
- package/dist/hooks/useSessionMessages.d.ts +29 -0
- package/dist/hooks/useSessionMessages.d.ts.map +1 -0
- package/dist/hooks/useSettingsToggle.d.ts +20 -0
- package/dist/hooks/useSettingsToggle.d.ts.map +1 -0
- package/dist/hooks/useSortedParticipants.d.ts +7 -0
- package/dist/hooks/useSortedParticipants.d.ts.map +1 -0
- package/dist/hooks/useSpeakingParticipants.d.ts +16 -0
- package/dist/hooks/useSpeakingParticipants.d.ts.map +1 -0
- package/dist/hooks/useStartAudio.d.ts +27 -0
- package/dist/hooks/useStartAudio.d.ts.map +1 -0
- package/dist/hooks/useStartVideo.d.ts +26 -0
- package/dist/hooks/useStartVideo.d.ts.map +1 -0
- package/dist/hooks/useSwipe.d.ts +24 -0
- package/dist/hooks/useSwipe.d.ts.map +1 -0
- package/dist/hooks/useTextStream.d.ts +20 -0
- package/dist/hooks/useTextStream.d.ts.map +1 -0
- package/dist/hooks/useToken.d.ts +20 -0
- package/dist/hooks/useToken.d.ts.map +1 -0
- package/dist/hooks/useTrack.d.ts +4 -0
- package/dist/hooks/useTrack.d.ts.map +1 -0
- package/dist/hooks/useTrackByName.d.ts +10 -0
- package/dist/hooks/useTrackByName.d.ts.map +1 -0
- package/dist/hooks/useTrackMutedIndicator.d.ts +18 -0
- package/dist/hooks/useTrackMutedIndicator.d.ts.map +1 -0
- package/dist/hooks/useTrackRefBySourceOrName.d.ts +7 -0
- package/dist/hooks/useTrackRefBySourceOrName.d.ts.map +1 -0
- package/dist/hooks/useTrackSyncTime.d.ts +10 -0
- package/dist/hooks/useTrackSyncTime.d.ts.map +1 -0
- package/dist/hooks/useTrackToggle.d.ts +27 -0
- package/dist/hooks/useTrackToggle.d.ts.map +1 -0
- package/dist/hooks/useTrackTranscription.d.ts +26 -0
- package/dist/hooks/useTrackTranscription.d.ts.map +1 -0
- package/dist/hooks/useTrackVolume.d.ts +49 -0
- package/dist/hooks/useTrackVolume.d.ts.map +1 -0
- package/dist/hooks/useTracks.d.ts +29 -0
- package/dist/hooks/useTracks.d.ts.map +1 -0
- package/dist/hooks/useTranscriptions.d.ts +21 -0
- package/dist/hooks/useTranscriptions.d.ts.map +1 -0
- package/dist/hooks/useVisualStableUpdate.d.ts +27 -0
- package/dist/hooks/useVisualStableUpdate.d.ts.map +1 -0
- package/dist/hooks/useVoiceAssistant.d.ts +43 -0
- package/dist/hooks/useVoiceAssistant.d.ts.map +1 -0
- package/dist/hooks/useWarnAboutMissingStyles.d.ts +5 -0
- package/dist/hooks/useWarnAboutMissingStyles.d.ts.map +1 -0
- package/dist/hooks-hQJmeINB.mjs +1992 -0
- package/dist/hooks-hQJmeINB.mjs.map +1 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -0
- package/dist/hooks.mjs +64 -0
- package/dist/hooks.mjs.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.docs.d.ts +6 -0
- package/dist/index.docs.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +157 -0
- package/dist/index.mjs.map +1 -0
- package/dist/krisp.d.ts +2 -0
- package/dist/krisp.js +2 -0
- package/dist/krisp.js.map +1 -0
- package/dist/krisp.mjs +45 -0
- package/dist/krisp.mjs.map +1 -0
- package/dist/mergeProps.d.ts +25 -0
- package/dist/mergeProps.d.ts.map +1 -0
- package/dist/prefabs/AudioConference.d.ts +22 -0
- package/dist/prefabs/AudioConference.d.ts.map +1 -0
- package/dist/prefabs/Chat.d.ts +35 -0
- package/dist/prefabs/Chat.d.ts.map +1 -0
- package/dist/prefabs/ControlBar.d.ts +45 -0
- package/dist/prefabs/ControlBar.d.ts.map +1 -0
- package/dist/prefabs/MediaDeviceMenu.d.ts +36 -0
- package/dist/prefabs/MediaDeviceMenu.d.ts.map +1 -0
- package/dist/prefabs/PreJoin.d.ts +59 -0
- package/dist/prefabs/PreJoin.d.ts.map +1 -0
- package/dist/prefabs/VideoConference.d.ts +35 -0
- package/dist/prefabs/VideoConference.d.ts.map +1 -0
- package/dist/prefabs/VoiceAssistantControlBar.d.ts +32 -0
- package/dist/prefabs/VoiceAssistantControlBar.d.ts.map +1 -0
- package/dist/prefabs/index.d.ts +8 -0
- package/dist/prefabs/index.d.ts.map +1 -0
- package/dist/prefabs.d.ts +2 -0
- package/dist/prefabs.js +2 -0
- package/dist/prefabs.js.map +1 -0
- package/dist/prefabs.mjs +579 -0
- package/dist/prefabs.mjs.map +1 -0
- package/dist/room-BP3SCCCd.mjs +191 -0
- package/dist/room-BP3SCCCd.mjs.map +1 -0
- package/dist/shared-88J2fzv7.js +2 -0
- package/dist/shared-88J2fzv7.js.map +1 -0
- package/dist/shared-BDr0qLg4.js +4 -0
- package/dist/shared-BDr0qLg4.js.map +1 -0
- package/dist/shared-CjI_UuOX.js +2 -0
- package/dist/shared-CjI_UuOX.js.map +1 -0
- package/dist/shared-DTHOl3uJ.js +2 -0
- package/dist/shared-DTHOl3uJ.js.map +1 -0
- package/dist/utils.d.ts +19 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +104 -0
- package/src/assets/icons/CameraDisabledIcon.tsx +15 -0
- package/src/assets/icons/CameraIcon.tsx +14 -0
- package/src/assets/icons/ChatCloseIcon.tsx +17 -0
- package/src/assets/icons/ChatIcon.tsx +25 -0
- package/src/assets/icons/Chevron.tsx +19 -0
- package/src/assets/icons/FocusToggleIcon.tsx +16 -0
- package/src/assets/icons/GearIcon.tsx +19 -0
- package/src/assets/icons/LeaveIcon.tsx +25 -0
- package/src/assets/icons/LockLockedIcon.tsx +19 -0
- package/src/assets/icons/MicDisabledIcon.tsx +15 -0
- package/src/assets/icons/MicIcon.tsx +19 -0
- package/src/assets/icons/QualityExcellentIcon.tsx +15 -0
- package/src/assets/icons/QualityGoodIcon.tsx +19 -0
- package/src/assets/icons/QualityPoorIcon.tsx +20 -0
- package/src/assets/icons/QualityUnknownIcon.tsx +17 -0
- package/src/assets/icons/ScreenShareIcon.tsx +25 -0
- package/src/assets/icons/ScreenShareStopIcon.tsx +21 -0
- package/src/assets/icons/SpinnerIcon.tsx +93 -0
- package/src/assets/icons/UnfocusToggleIcon.tsx +16 -0
- package/src/assets/icons/index.ts +19 -0
- package/src/assets/icons/util.tsx +47 -0
- package/src/assets/images/ParticipantPlaceholder.tsx +31 -0
- package/src/assets/images/index.ts +1 -0
- package/src/assets/template.js +21 -0
- package/src/components/ChatEntry.tsx +112 -0
- package/src/components/ConnectionState.tsx +36 -0
- package/src/components/ConnectionStateToast.tsx +47 -0
- package/src/components/LiveKitRoom.tsx +122 -0
- package/src/components/ParticipantLoop.tsx +41 -0
- package/src/components/RoomAudioRenderer.tsx +57 -0
- package/src/components/RoomName.tsx +36 -0
- package/src/components/SessionProvider.tsx +22 -0
- package/src/components/Toast.tsx +18 -0
- package/src/components/TrackLoop.tsx +45 -0
- package/src/components/controls/ChatToggle.tsx +32 -0
- package/src/components/controls/ClearPinButton.tsx +32 -0
- package/src/components/controls/DisconnectButton.tsx +32 -0
- package/src/components/controls/FocusToggle.tsx +54 -0
- package/src/components/controls/MediaDeviceSelect.tsx +144 -0
- package/src/components/controls/PaginationControl.tsx +51 -0
- package/src/components/controls/PaginationIndicator.tsx +26 -0
- package/src/components/controls/SettingsMenuToggle.tsx +26 -0
- package/src/components/controls/StartAudio.tsx +40 -0
- package/src/components/controls/StartMediaButton.tsx +41 -0
- package/src/components/controls/TrackToggle.tsx +54 -0
- package/src/components/index.ts +34 -0
- package/src/components/layout/CarouselLayout.tsx +80 -0
- package/src/components/layout/FocusLayout.tsx +37 -0
- package/src/components/layout/GridLayout.tsx +63 -0
- package/src/components/layout/LayoutContextProvider.tsx +36 -0
- package/src/components/layout/index.ts +3 -0
- package/src/components/participant/AudioTrack.tsx +89 -0
- package/src/components/participant/AudioVisualizer.tsx +67 -0
- package/src/components/participant/BarVisualizer.tsx +164 -0
- package/src/components/participant/ConnectionQualityIndicator.tsx +36 -0
- package/src/components/participant/ParticipantAudioTile.tsx +67 -0
- package/src/components/participant/ParticipantName.tsx +50 -0
- package/src/components/participant/ParticipantTile.tsx +192 -0
- package/src/components/participant/TrackMutedIndicator.tsx +53 -0
- package/src/components/participant/VideoTrack.tsx +92 -0
- package/src/components/participant/animationSequences/connectingSequence.ts +9 -0
- package/src/components/participant/animationSequences/listeningSequence.ts +6 -0
- package/src/components/participant/animationSequences/thinkingSequence.ts +12 -0
- package/src/components/participant/animators/useBarAnimator.ts +55 -0
- package/src/context/chat-context.ts +37 -0
- package/src/context/feature-context.ts +28 -0
- package/src/context/index.ts +27 -0
- package/src/context/layout-context.ts +72 -0
- package/src/context/participant-context.ts +44 -0
- package/src/context/pin-context.ts +27 -0
- package/src/context/room-context.ts +42 -0
- package/src/context/session-context.ts +43 -0
- package/src/context/track-reference-context.ts +47 -0
- package/src/hooks/cloud/krisp/useKrispNoiseFilter.ts +110 -0
- package/src/hooks/index.ts +72 -0
- package/src/hooks/internal/index.ts +10 -0
- package/src/hooks/internal/useMediaQuery.ts +46 -0
- package/src/hooks/internal/useObservableState.ts +24 -0
- package/src/hooks/internal/useResizeObserver.ts +124 -0
- package/src/hooks/useAgent.ts +945 -0
- package/src/hooks/useAudioPlayback.ts +34 -0
- package/src/hooks/useChat.ts +57 -0
- package/src/hooks/useChatToggle.ts +38 -0
- package/src/hooks/useClearPinButton.ts +29 -0
- package/src/hooks/useConnectionQualityIndicator.ts +33 -0
- package/src/hooks/useConnectionStatus.ts +22 -0
- package/src/hooks/useDataChannel.ts +73 -0
- package/src/hooks/useDisconnectButton.ts +36 -0
- package/src/hooks/useEvents.ts +39 -0
- package/src/hooks/useFacingMode.ts +22 -0
- package/src/hooks/useFocusToggle.ts +59 -0
- package/src/hooks/useGridLayout.ts +44 -0
- package/src/hooks/useIsEncrypted.ts +29 -0
- package/src/hooks/useIsMuted.ts +51 -0
- package/src/hooks/useIsRecording.ts +23 -0
- package/src/hooks/useIsSpeaking.ts +21 -0
- package/src/hooks/useLiveKitRoom.ts +186 -0
- package/src/hooks/useLocalParticipant.ts +73 -0
- package/src/hooks/useLocalParticipantPermissions.ts +24 -0
- package/src/hooks/useMediaDeviceSelect.ts +81 -0
- package/src/hooks/useMediaDevices.ts +28 -0
- package/src/hooks/useMediaTrackBySourceOrName.ts +97 -0
- package/src/hooks/usePagination.test.ts +77 -0
- package/src/hooks/usePagination.ts +67 -0
- package/src/hooks/useParticipantAttributes.ts +69 -0
- package/src/hooks/useParticipantInfo.ts +35 -0
- package/src/hooks/useParticipantPermissions.ts +29 -0
- package/src/hooks/useParticipantTile.ts +81 -0
- package/src/hooks/useParticipantTracks.ts +54 -0
- package/src/hooks/useParticipants.ts +42 -0
- package/src/hooks/usePersistentUserChoices.ts +64 -0
- package/src/hooks/usePinnedTracks.ts +24 -0
- package/src/hooks/useRemoteParticipant.ts +79 -0
- package/src/hooks/useRemoteParticipants.ts +45 -0
- package/src/hooks/useRoomInfo.ts +32 -0
- package/src/hooks/useSequentialRoomConnectDisconnect.ts +171 -0
- package/src/hooks/useSession.ts +642 -0
- package/src/hooks/useSessionMessages.ts +158 -0
- package/src/hooks/useSettingsToggle.ts +32 -0
- package/src/hooks/useSortedParticipants.ts +20 -0
- package/src/hooks/useSpeakingParticipants.ts +27 -0
- package/src/hooks/useStartAudio.ts +50 -0
- package/src/hooks/useStartVideo.ts +49 -0
- package/src/hooks/useSwipe.ts +68 -0
- package/src/hooks/useTextStream.ts +35 -0
- package/src/hooks/useToken.ts +54 -0
- package/src/hooks/useTrack.ts +11 -0
- package/src/hooks/useTrackByName.ts +15 -0
- package/src/hooks/useTrackMutedIndicator.ts +44 -0
- package/src/hooks/useTrackRefBySourceOrName.ts +30 -0
- package/src/hooks/useTrackSyncTime.ts +18 -0
- package/src/hooks/useTrackToggle.ts +93 -0
- package/src/hooks/useTrackTranscription.ts +75 -0
- package/src/hooks/useTrackVolume.ts +283 -0
- package/src/hooks/useTracks.test.ts +60 -0
- package/src/hooks/useTracks.ts +154 -0
- package/src/hooks/useTranscriptions.ts +48 -0
- package/src/hooks/useVisualStableUpdate.ts +63 -0
- package/src/hooks/useVoiceAssistant.ts +109 -0
- package/src/hooks/useWarnAboutMissingStyles.ts +11 -0
- package/src/index.docs.ts +12 -0
- package/src/index.ts +32 -0
- package/src/mergeProps.ts +87 -0
- package/src/prefabs/AudioConference.tsx +57 -0
- package/src/prefabs/Chat.tsx +153 -0
- package/src/prefabs/ControlBar.tsx +227 -0
- package/src/prefabs/MediaDeviceMenu.tsx +159 -0
- package/src/prefabs/PreJoin.tsx +439 -0
- package/src/prefabs/VideoConference.tsx +184 -0
- package/src/prefabs/VoiceAssistantControlBar.tsx +109 -0
- package/src/prefabs/index.ts +11 -0
- package/src/utils.ts +78 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: This file was auto-generated by svgr. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import type { SVGProps } from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
const SvgParticipantPlaceholder = (props: SVGProps<SVGSVGElement>) => (
|
|
10
|
+
<svg
|
|
11
|
+
width={320}
|
|
12
|
+
height={320}
|
|
13
|
+
viewBox="0 0 320 320"
|
|
14
|
+
preserveAspectRatio="xMidYMid meet"
|
|
15
|
+
fill="none"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<path
|
|
20
|
+
d="M160 180C204.182 180 240 144.183 240 100C240 55.8172 204.182 20 160 20C115.817 20 79.9997 55.8172 79.9997 100C79.9997 144.183 115.817 180 160 180Z"
|
|
21
|
+
fill="white"
|
|
22
|
+
fillOpacity={0.25}
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M97.6542 194.614C103.267 191.818 109.841 192.481 115.519 195.141C129.025 201.466 144.1 205 159.999 205C175.899 205 190.973 201.466 204.48 195.141C210.158 192.481 216.732 191.818 222.345 194.614C262.703 214.719 291.985 253.736 298.591 300.062C300.15 310.997 291.045 320 280 320H39.9997C28.954 320 19.8495 310.997 21.4087 300.062C28.014 253.736 57.2966 214.72 97.6542 194.614Z"
|
|
26
|
+
fill="white"
|
|
27
|
+
fillOpacity={0.25}
|
|
28
|
+
/>
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
export default SvgParticipantPlaceholder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ParticipantPlaceholder } from './ParticipantPlaceholder';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function is used as a template to generate SVG components with svgr.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
function template(variables, { tpl }) {
|
|
6
|
+
return tpl`
|
|
7
|
+
${'/**\n * WARNING: This file was auto-generated by svgr. Do not edit.\n */\n'}
|
|
8
|
+
${variables.imports};
|
|
9
|
+
|
|
10
|
+
${variables.interfaces};
|
|
11
|
+
|
|
12
|
+
${'/**\n * @internal\n */\n'}
|
|
13
|
+
const ${variables.componentName} = (${variables.props}) => (
|
|
14
|
+
${variables.jsx}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
${variables.exports};
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = template;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { ReceivedChatMessage } from '@livekit/components-core';
|
|
2
|
+
import { tokenize, createDefaultGrammar } from '@livekit/components-core';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export type MessageFormatter = (message: string) => React.ReactNode;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ChatEntry composes the HTML div element under the hood, so you can pass all its props.
|
|
10
|
+
* These are the props specific to the ChatEntry component:
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface ChatEntryProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
14
|
+
/** The chat massage object to display. */
|
|
15
|
+
entry: ReceivedChatMessage;
|
|
16
|
+
/** Hide sender name. Useful when displaying multiple consecutive chat messages from the same person. */
|
|
17
|
+
hideName?: boolean;
|
|
18
|
+
/** Hide message timestamp. */
|
|
19
|
+
hideTimestamp?: boolean;
|
|
20
|
+
/** An optional formatter for the message body. */
|
|
21
|
+
messageFormatter?: MessageFormatter;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The `ChatEntry` component holds and displays one chat message.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Chat>
|
|
30
|
+
* <ChatEntry />
|
|
31
|
+
* </Chat>
|
|
32
|
+
* ```
|
|
33
|
+
* @see `Chat`
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export const ChatEntry: (
|
|
37
|
+
props: ChatEntryProps & React.RefAttributes<HTMLLIElement>,
|
|
38
|
+
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<HTMLLIElement, ChatEntryProps>(
|
|
39
|
+
function ChatEntry(
|
|
40
|
+
{ entry, hideName = false, hideTimestamp = false, messageFormatter, ...props }: ChatEntryProps,
|
|
41
|
+
ref,
|
|
42
|
+
) {
|
|
43
|
+
const formattedMessage = React.useMemo(() => {
|
|
44
|
+
return messageFormatter ? messageFormatter(entry.message) : entry.message;
|
|
45
|
+
}, [entry.message, messageFormatter]);
|
|
46
|
+
const hasBeenEdited = !!entry.editTimestamp;
|
|
47
|
+
const time = new Date(entry.timestamp);
|
|
48
|
+
const locale = typeof navigator !== 'undefined' ? navigator.language : 'en-US';
|
|
49
|
+
|
|
50
|
+
const name = entry.from?.name ?? entry.from?.identity;
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<li
|
|
54
|
+
ref={ref}
|
|
55
|
+
className="lk-chat-entry"
|
|
56
|
+
title={time.toLocaleTimeString(locale, { timeStyle: 'full' })}
|
|
57
|
+
data-lk-message-origin={entry.from?.isLocal ? 'local' : 'remote'}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{(!hideTimestamp || !hideName || hasBeenEdited) && (
|
|
61
|
+
<span className="lk-meta-data">
|
|
62
|
+
{!hideName && <strong className="lk-participant-name">{name}</strong>}
|
|
63
|
+
|
|
64
|
+
{(!hideTimestamp || hasBeenEdited) && (
|
|
65
|
+
<span className="lk-timestamp">
|
|
66
|
+
{hasBeenEdited && 'edited '}
|
|
67
|
+
{time.toLocaleTimeString(locale, { timeStyle: 'short' })}
|
|
68
|
+
</span>
|
|
69
|
+
)}
|
|
70
|
+
</span>
|
|
71
|
+
)}
|
|
72
|
+
|
|
73
|
+
<span className="lk-message-body">{formattedMessage}</span>
|
|
74
|
+
<span className="lk-message-attachements">
|
|
75
|
+
{entry.attachedFiles?.map(
|
|
76
|
+
(file) =>
|
|
77
|
+
file.type.startsWith('image/') && (
|
|
78
|
+
<img
|
|
79
|
+
style={{ maxWidth: '300px', maxHeight: '300px' }}
|
|
80
|
+
key={file.name}
|
|
81
|
+
src={URL.createObjectURL(file)}
|
|
82
|
+
alt={file.name}
|
|
83
|
+
/>
|
|
84
|
+
),
|
|
85
|
+
)}
|
|
86
|
+
</span>
|
|
87
|
+
</li>
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
/** @public */
|
|
93
|
+
export function formatChatMessageLinks(message: string): React.ReactNode {
|
|
94
|
+
return tokenize(message, createDefaultGrammar()).map((tok, i) => {
|
|
95
|
+
if (typeof tok === `string`) {
|
|
96
|
+
return tok;
|
|
97
|
+
} else {
|
|
98
|
+
const content = tok.content.toString();
|
|
99
|
+
const href =
|
|
100
|
+
tok.type === `url`
|
|
101
|
+
? /^http(s?):\/\//.test(content)
|
|
102
|
+
? content
|
|
103
|
+
: `https://${content}`
|
|
104
|
+
: `mailto:${content}`;
|
|
105
|
+
return (
|
|
106
|
+
<a className="lk-chat-link" key={i} href={href} target="_blank" rel="noreferrer">
|
|
107
|
+
{content}
|
|
108
|
+
</a>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Room } from 'livekit-client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useConnectionState } from '../hooks';
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export interface ConnectionStatusProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* The room from which the connection status should be displayed.
|
|
9
|
+
*/
|
|
10
|
+
room?: Room;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `ConnectionState` component displays the connection status of the room as strings
|
|
15
|
+
* (`"connected" | "connecting" | "disconnected" | "reconnecting"`).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <LiveKitRoom>
|
|
20
|
+
* <ConnectionState />
|
|
21
|
+
* </LiveKitRoom>
|
|
22
|
+
* ```
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export const ConnectionState: (
|
|
26
|
+
props: ConnectionStatusProps & React.RefAttributes<HTMLDivElement>,
|
|
27
|
+
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<HTMLDivElement, ConnectionStatusProps>(
|
|
28
|
+
function ConnectionState({ room, ...props }: ConnectionStatusProps, ref) {
|
|
29
|
+
const connectionState = useConnectionState(room);
|
|
30
|
+
return (
|
|
31
|
+
<div ref={ref} {...props}>
|
|
32
|
+
{connectionState}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Room } from 'livekit-client';
|
|
2
|
+
import { ConnectionState } from 'livekit-client';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { SpinnerIcon } from '../assets/icons';
|
|
5
|
+
import { useConnectionState } from '../hooks';
|
|
6
|
+
import { Toast } from './Toast';
|
|
7
|
+
|
|
8
|
+
/** @public */
|
|
9
|
+
export interface ConnectionStateToastProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
room?: Room;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `ConnectionStateToast` component displays a toast
|
|
15
|
+
* notification indicating the current connection state of the room.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export function ConnectionStateToast(props: ConnectionStateToastProps) {
|
|
19
|
+
const [notification, setNotification] = React.useState<React.ReactElement | undefined>(undefined);
|
|
20
|
+
const state = useConnectionState(props.room);
|
|
21
|
+
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
switch (state) {
|
|
24
|
+
case ConnectionState.Reconnecting:
|
|
25
|
+
setNotification(
|
|
26
|
+
<>
|
|
27
|
+
<SpinnerIcon className="lk-spinner" /> Reconnecting
|
|
28
|
+
</>,
|
|
29
|
+
);
|
|
30
|
+
break;
|
|
31
|
+
case ConnectionState.Connecting:
|
|
32
|
+
setNotification(
|
|
33
|
+
<>
|
|
34
|
+
<SpinnerIcon className="lk-spinner" /> Connecting
|
|
35
|
+
</>,
|
|
36
|
+
);
|
|
37
|
+
break;
|
|
38
|
+
case ConnectionState.Disconnected:
|
|
39
|
+
setNotification(<>Disconnected</>);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
setNotification(undefined);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}, [state]);
|
|
46
|
+
return notification ? <Toast className="lk-toast-connection-state">{notification}</Toast> : <></>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AudioCaptureOptions,
|
|
3
|
+
DisconnectReason,
|
|
4
|
+
RoomConnectOptions,
|
|
5
|
+
RoomOptions,
|
|
6
|
+
ScreenShareCaptureOptions,
|
|
7
|
+
VideoCaptureOptions,
|
|
8
|
+
} from 'livekit-client';
|
|
9
|
+
import type { MediaDeviceFailure, Room } from 'livekit-client';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import { type FeatureFlags, LKFeatureContext, RoomContext } from '../context';
|
|
12
|
+
import { useLiveKitRoom } from '../hooks';
|
|
13
|
+
|
|
14
|
+
/** @public */
|
|
15
|
+
export interface LiveKitRoomProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onError'> {
|
|
16
|
+
/**
|
|
17
|
+
* URL to the LiveKit server.
|
|
18
|
+
* For example: `wss://<domain>.livekit.cloud`
|
|
19
|
+
* To simplify the implementation, `undefined` is also accepted as an intermediate value, but only with a valid string url can the connection be established.
|
|
20
|
+
*/
|
|
21
|
+
serverUrl: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A user specific access token for a client to authenticate to the room.
|
|
24
|
+
* This token is necessary to establish a connection to the room.
|
|
25
|
+
* To simplify the implementation, `undefined` is also accepted as an intermediate value, but only with a valid string token can the connection be established.
|
|
26
|
+
*
|
|
27
|
+
* @see https://docs.livekit.io/cloud/project-management/keys-and-tokens/#generating-access-tokens
|
|
28
|
+
*/
|
|
29
|
+
token: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Publish audio immediately after connecting to your LiveKit room.
|
|
32
|
+
* @defaultValue `false`
|
|
33
|
+
* @see https://docs.livekit.io/client-sdk-js/interfaces/AudioCaptureOptions.html
|
|
34
|
+
*/
|
|
35
|
+
audio?: AudioCaptureOptions | boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Publish video immediately after connecting to your LiveKit room.
|
|
38
|
+
* @defaultValue `false`
|
|
39
|
+
* @see https://docs.livekit.io/client-sdk-js/interfaces/VideoCaptureOptions.html
|
|
40
|
+
*/
|
|
41
|
+
video?: VideoCaptureOptions | boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Publish screen share immediately after connecting to your LiveKit room.
|
|
44
|
+
* @defaultValue `false`
|
|
45
|
+
* @see https://docs.livekit.io/client-sdk-js/interfaces/ScreenShareCaptureOptions.html
|
|
46
|
+
*/
|
|
47
|
+
screen?: ScreenShareCaptureOptions | boolean;
|
|
48
|
+
/**
|
|
49
|
+
* If set to true a connection to LiveKit room is initiated.
|
|
50
|
+
* @defaultValue `true`
|
|
51
|
+
*/
|
|
52
|
+
connect?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Options for when creating a new room.
|
|
55
|
+
* When you pass your own room instance to this component, these options have no effect.
|
|
56
|
+
* Instead, set the options directly in the room instance.
|
|
57
|
+
*
|
|
58
|
+
* @see https://docs.livekit.io/client-sdk-js/interfaces/RoomOptions.html
|
|
59
|
+
*/
|
|
60
|
+
options?: RoomOptions;
|
|
61
|
+
/**
|
|
62
|
+
* Define options how to connect to the LiveKit server.
|
|
63
|
+
*
|
|
64
|
+
* @see https://docs.livekit.io/client-sdk-js/interfaces/RoomConnectOptions.html
|
|
65
|
+
*/
|
|
66
|
+
connectOptions?: RoomConnectOptions;
|
|
67
|
+
onConnected?: () => void;
|
|
68
|
+
onDisconnected?: (reason?: DisconnectReason) => void;
|
|
69
|
+
onError?: (error: Error) => void;
|
|
70
|
+
onMediaDeviceFailure?: (failure?: MediaDeviceFailure, kind?: MediaDeviceKind) => void;
|
|
71
|
+
onEncryptionError?: (error: Error) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Optional room instance.
|
|
74
|
+
* By passing your own room instance you overwrite the `options` parameter,
|
|
75
|
+
* make sure to set the options directly on the room instance itself.
|
|
76
|
+
*/
|
|
77
|
+
room?: Room;
|
|
78
|
+
|
|
79
|
+
simulateParticipants?: number | undefined;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
featureFlags?: FeatureFlags;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The `LiveKitRoom` component provides the room context to all its child components.
|
|
89
|
+
* It is generally the starting point of your LiveKit app and the root of the LiveKit component tree.
|
|
90
|
+
* It provides the room state as a React context to all child components, so you don't have to pass it yourself.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <LiveKitRoom
|
|
95
|
+
* token='<livekit-token>'
|
|
96
|
+
* serverUrl='<url-to-livekit-server>'
|
|
97
|
+
* connect={true}
|
|
98
|
+
* >
|
|
99
|
+
* ...
|
|
100
|
+
* </LiveKitRoom>
|
|
101
|
+
* ```
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
export const LiveKitRoom: (
|
|
105
|
+
props: React.PropsWithChildren<LiveKitRoomProps> & React.RefAttributes<HTMLDivElement>,
|
|
106
|
+
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<
|
|
107
|
+
HTMLDivElement,
|
|
108
|
+
React.PropsWithChildren<LiveKitRoomProps>
|
|
109
|
+
>(function LiveKitRoom(props: React.PropsWithChildren<LiveKitRoomProps>, ref) {
|
|
110
|
+
const { room, htmlProps } = useLiveKitRoom(props);
|
|
111
|
+
return (
|
|
112
|
+
<div ref={ref} {...htmlProps}>
|
|
113
|
+
{room && (
|
|
114
|
+
<RoomContext.Provider value={room}>
|
|
115
|
+
<LKFeatureContext.Provider value={props.featureFlags}>
|
|
116
|
+
{props.children}
|
|
117
|
+
</LKFeatureContext.Provider>
|
|
118
|
+
</RoomContext.Provider>
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Participant } from 'livekit-client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ParticipantContext } from '../context';
|
|
4
|
+
import { cloneSingleChild } from '../utils';
|
|
5
|
+
|
|
6
|
+
/** @public */
|
|
7
|
+
export interface ParticipantLoopProps {
|
|
8
|
+
/** The participants to loop over. Use `useParticipants()` hook to get participants. */
|
|
9
|
+
participants: Participant[];
|
|
10
|
+
/** The template component to be used in the loop. */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The `ParticipantLoop` component loops over an array of participants to create a context for every participant.
|
|
16
|
+
* This component takes exactly one child component as a template.
|
|
17
|
+
* By providing your own template as a child you have full control over the look and feel of your participant representations.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* If you want to loop over individual tracks instead of participants, you can use the `TrackLoop` component.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const participants = useParticipants();
|
|
25
|
+
* <ParticipantLoop participants={participants}>
|
|
26
|
+
* <ParticipantName />
|
|
27
|
+
* </ParticipantLoop>
|
|
28
|
+
* ```
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export function ParticipantLoop({ participants, ...props }: ParticipantLoopProps) {
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
{participants.map((participant) => (
|
|
35
|
+
<ParticipantContext.Provider value={participant} key={participant.identity}>
|
|
36
|
+
{cloneSingleChild(props.children)}
|
|
37
|
+
</ParticipantContext.Provider>
|
|
38
|
+
))}
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getTrackReferenceId } from '@livekit/components-core';
|
|
2
|
+
import { Room, Track } from 'livekit-client';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useTracks } from '../hooks';
|
|
5
|
+
import { AudioTrack } from './participant/AudioTrack';
|
|
6
|
+
|
|
7
|
+
/** @public */
|
|
8
|
+
export interface RoomAudioRendererProps {
|
|
9
|
+
room?: Room;
|
|
10
|
+
|
|
11
|
+
/** Sets the volume for all audio tracks rendered by this component. By default, the range is between `0.0` and `1.0`. */
|
|
12
|
+
volume?: number;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* If set to `true`, mutes all audio tracks rendered by the component.
|
|
16
|
+
* @remarks
|
|
17
|
+
* If set to `true`, the server will stop sending audio track data to the client.
|
|
18
|
+
* @alpha
|
|
19
|
+
*/
|
|
20
|
+
muted?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The `RoomAudioRenderer` component is a drop-in solution for adding audio to your LiveKit app.
|
|
25
|
+
* It takes care of handling remote participants’ audio tracks and makes sure that microphones and screen share are audible.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <LiveKitRoom>
|
|
30
|
+
* <RoomAudioRenderer />
|
|
31
|
+
* </LiveKitRoom>
|
|
32
|
+
* ```
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export function RoomAudioRenderer({ room, volume, muted }: RoomAudioRendererProps) {
|
|
36
|
+
const tracks = useTracks(
|
|
37
|
+
[Track.Source.Microphone, Track.Source.ScreenShareAudio, Track.Source.Unknown],
|
|
38
|
+
{
|
|
39
|
+
updateOnlyOn: [],
|
|
40
|
+
onlySubscribed: true,
|
|
41
|
+
room,
|
|
42
|
+
},
|
|
43
|
+
).filter((ref) => !ref.participant.isLocal && ref.publication.kind === Track.Kind.Audio);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div style={{ display: 'none' }}>
|
|
47
|
+
{tracks.map((trackRef) => (
|
|
48
|
+
<AudioTrack
|
|
49
|
+
key={getTrackReferenceId(trackRef)}
|
|
50
|
+
trackRef={trackRef}
|
|
51
|
+
volume={volume}
|
|
52
|
+
muted={muted}
|
|
53
|
+
/>
|
|
54
|
+
))}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRoomInfo } from '../hooks';
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export interface RoomNameProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
childrenPosition?: 'before' | 'after';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The `RoomName` component renders the name of the connected LiveKit room inside a span tag.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <LiveKitRoom>
|
|
15
|
+
* <RoomName />
|
|
16
|
+
* </LiveKitRoom>
|
|
17
|
+
* ```
|
|
18
|
+
* @public
|
|
19
|
+
*
|
|
20
|
+
* @param props - RoomNameProps
|
|
21
|
+
*/
|
|
22
|
+
export const RoomName: React.FC<RoomNameProps & React.RefAttributes<HTMLSpanElement>> =
|
|
23
|
+
/* @__PURE__ */ React.forwardRef<HTMLSpanElement, RoomNameProps>(function RoomName(
|
|
24
|
+
{ childrenPosition = 'before', children, ...htmlAttributes }: RoomNameProps,
|
|
25
|
+
ref,
|
|
26
|
+
) {
|
|
27
|
+
const { name } = useRoomInfo();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<span ref={ref} {...htmlAttributes}>
|
|
31
|
+
{childrenPosition === 'before' && children}
|
|
32
|
+
{name}
|
|
33
|
+
{childrenPosition === 'after' && children}
|
|
34
|
+
</span>
|
|
35
|
+
);
|
|
36
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { UseSessionReturn } from '../hooks';
|
|
3
|
+
import { RoomContext } from '../context';
|
|
4
|
+
import { SessionContext } from '../context/session-context';
|
|
5
|
+
|
|
6
|
+
/** @beta */
|
|
7
|
+
export type SessionProviderProps = {
|
|
8
|
+
session: UseSessionReturn;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The `SessionProvider` component instantiates a SessionContext from the return of useSession
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
export function SessionProvider(props: SessionProviderProps) {
|
|
17
|
+
return (
|
|
18
|
+
<SessionContext.Provider value={props.session}>
|
|
19
|
+
<RoomContext.Provider value={props.session.room}>{props.children}</RoomContext.Provider>
|
|
20
|
+
</SessionContext.Provider>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { mergeProps } from '../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The `Toast` component is a rudimentary way to display a message to the user.
|
|
6
|
+
* This message should be short lived and not require user interaction.
|
|
7
|
+
* For example, displaying the current connection state like `ConnectionStateToast` does.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Toast>Connecting...</Toast>
|
|
12
|
+
* ```
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export function Toast(props: React.HTMLAttributes<HTMLDivElement>) {
|
|
16
|
+
const htmlProps = React.useMemo(() => mergeProps(props, { className: 'lk-toast' }), [props]);
|
|
17
|
+
return <div {...htmlProps}>{props.children}</div>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TrackReference, TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { TrackRefContext } from '../context/track-reference-context';
|
|
4
|
+
import { cloneSingleChild } from '../utils';
|
|
5
|
+
import { getTrackReferenceId } from '@livekit/components-core';
|
|
6
|
+
|
|
7
|
+
/** @public */
|
|
8
|
+
export interface TrackLoopProps {
|
|
9
|
+
/** Track references to loop over. You can the use `useTracks()` hook to get TrackReferences. */
|
|
10
|
+
tracks: TrackReference[] | TrackReferenceOrPlaceholder[];
|
|
11
|
+
/** The template component to be used in the loop. */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The `TrackLoop` component loops over tracks. It is for example a easy way to loop over all participant camera and screen share tracks.
|
|
17
|
+
* `TrackLoop` creates a `TrackRefContext` for each track that you can use to e.g. render the track.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const trackRefs = useTracks([Track.Source.Camera]);
|
|
22
|
+
* <TrackLoop tracks={trackRefs} >
|
|
23
|
+
* <TrackRefContext.Consumer>
|
|
24
|
+
* {(trackRef) => trackRef && <VideoTrack trackRef={trackRef}/>}
|
|
25
|
+
* </TrackRefContext.Consumer>
|
|
26
|
+
* </TrackLoop>
|
|
27
|
+
* ```
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export function TrackLoop({ tracks, ...props }: TrackLoopProps) {
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
{tracks.map((trackReference) => {
|
|
34
|
+
return (
|
|
35
|
+
<TrackRefContext.Provider
|
|
36
|
+
value={trackReference}
|
|
37
|
+
key={getTrackReferenceId(trackReference)}
|
|
38
|
+
>
|
|
39
|
+
{cloneSingleChild(props.children)}
|
|
40
|
+
</TrackRefContext.Provider>
|
|
41
|
+
);
|
|
42
|
+
})}
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useChatToggle } from '../../hooks';
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export interface ChatToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The `ChatToggle` component is a button that toggles the visibility of the `Chat` component.
|
|
9
|
+
* @remarks
|
|
10
|
+
* For the component to have any effect it has to live inside a `LayoutContext` context.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <LiveKitRoom>
|
|
15
|
+
* <ToggleChat />
|
|
16
|
+
* </LiveKitRoom>
|
|
17
|
+
* ```
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export const ChatToggle: (
|
|
21
|
+
props: ChatToggleProps & React.RefAttributes<HTMLButtonElement>,
|
|
22
|
+
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<HTMLButtonElement, ChatToggleProps>(
|
|
23
|
+
function ChatToggle(props: ChatToggleProps, ref) {
|
|
24
|
+
const { mergedProps } = useChatToggle({ props });
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<button ref={ref} {...mergedProps}>
|
|
28
|
+
{props.children}
|
|
29
|
+
</button>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useClearPinButton } from '../../hooks';
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export interface ClearPinButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The `ClearPinButton` is a basic html button with the added ability to signal
|
|
9
|
+
* the `LayoutContext` that it should display the grid view again.
|
|
10
|
+
* @remarks
|
|
11
|
+
* This component works only inside a `LayoutContext`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <LiveKitRoom>
|
|
16
|
+
* <ClearPinButton>Back to grid view</ClearPinButton>
|
|
17
|
+
* </LiveKitRoom>
|
|
18
|
+
* ```
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export const ClearPinButton: (
|
|
22
|
+
props: ClearPinButtonProps & React.RefAttributes<HTMLButtonElement>,
|
|
23
|
+
) => React.ReactNode = /* @__PURE__ */ React.forwardRef<HTMLButtonElement, ClearPinButtonProps>(
|
|
24
|
+
function ClearPinButton(props: ClearPinButtonProps, ref) {
|
|
25
|
+
const { buttonProps } = useClearPinButton(props);
|
|
26
|
+
return (
|
|
27
|
+
<button ref={ref} {...buttonProps}>
|
|
28
|
+
{props.children}
|
|
29
|
+
</button>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|