@mrksbnc/livekit-vue 0.0.3 → 1.0.0
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/README.md +46 -30
- package/dist/background/BackgroundEffectSelect.vue.d.cts +55 -0
- package/dist/background/BackgroundEffectSelect.vue.d.mts +55 -0
- package/dist/background/index.d.cts +3 -0
- package/dist/background/index.d.mts +3 -0
- package/dist/background.cjs +2 -0
- package/dist/background.cjs.map +1 -0
- package/dist/background.js +239 -0
- package/dist/background.js.map +1 -0
- package/dist/components/chat/ChatEntry.vue.d.cts +16 -0
- package/dist/components/chat/ChatEntry.vue.d.mts +16 -0
- package/dist/components/chat/chat.utils.d.cts +3 -0
- package/dist/components/chat/chat.utils.d.mts +3 -0
- package/dist/components/chat/index.d.cts +3 -0
- package/dist/components/chat/index.d.mts +3 -0
- package/dist/components/chat/render-node.d.cts +8 -0
- package/dist/components/chat/render-node.d.mts +8 -0
- package/dist/components/context/ParticipantContextProvider.vue.d.cts +16 -0
- package/dist/components/context/ParticipantContextProvider.vue.d.mts +16 -0
- package/dist/components/context/RoomContextProvider.vue.d.cts +16 -0
- package/dist/components/context/RoomContextProvider.vue.d.mts +16 -0
- package/dist/components/context/SessionProvider.vue.d.cts +16 -0
- package/dist/components/context/SessionProvider.vue.d.mts +16 -0
- package/dist/components/context/TrackRefContextProvider.vue.d.cts +16 -0
- package/dist/components/context/TrackRefContextProvider.vue.d.mts +16 -0
- package/dist/components/context/index.d.cts +4 -0
- package/dist/components/context/index.d.mts +4 -0
- package/dist/components/controls/ChatToggle.vue.d.cts +17 -0
- package/dist/components/controls/ChatToggle.vue.d.mts +17 -0
- package/dist/components/controls/ClearPinButton.vue.d.cts +22 -0
- package/dist/components/controls/ClearPinButton.vue.d.mts +22 -0
- package/dist/components/controls/DisconnectButton.vue.d.cts +18 -0
- package/dist/components/controls/DisconnectButton.vue.d.mts +18 -0
- package/dist/components/controls/FocusToggle.vue.d.cts +19 -0
- package/dist/components/controls/FocusToggle.vue.d.mts +19 -0
- package/dist/components/controls/MediaDeviceSelect.vue.d.cts +45 -0
- package/dist/components/controls/MediaDeviceSelect.vue.d.mts +45 -0
- package/dist/components/controls/PaginationControl.vue.d.cts +18 -0
- package/dist/components/controls/PaginationControl.vue.d.mts +18 -0
- package/dist/components/controls/PaginationIndicator.vue.d.cts +8 -0
- package/dist/components/controls/PaginationIndicator.vue.d.mts +8 -0
- package/dist/components/controls/SettingsMenuToggle.vue.d.cts +16 -0
- package/dist/components/controls/SettingsMenuToggle.vue.d.mts +16 -0
- package/dist/components/controls/StartAudio.vue.d.cts +21 -0
- package/dist/components/controls/StartAudio.vue.d.mts +21 -0
- package/dist/components/controls/StartMediaButton.vue.d.cts +24 -0
- package/dist/components/controls/StartMediaButton.vue.d.mts +24 -0
- package/dist/components/controls/TrackToggle.vue.d.cts +43 -0
- package/dist/components/controls/TrackToggle.vue.d.mts +43 -0
- package/dist/components/controls/VideoQualitySelect.vue.d.cts +33 -0
- package/dist/components/controls/VideoQualitySelect.vue.d.mts +33 -0
- package/dist/components/controls/index.d.cts +24 -0
- package/dist/components/controls/index.d.mts +24 -0
- package/dist/components/icons/CameraDisabledIcon.vue.d.cts +3 -0
- package/dist/components/icons/CameraDisabledIcon.vue.d.mts +3 -0
- package/dist/components/icons/CameraIcon.vue.d.cts +3 -0
- package/dist/components/icons/CameraIcon.vue.d.mts +3 -0
- package/dist/components/icons/ChatCloseIcon.vue.d.cts +3 -0
- package/dist/components/icons/ChatCloseIcon.vue.d.mts +3 -0
- package/dist/components/icons/ChatIcon.vue.d.cts +3 -0
- package/dist/components/icons/ChatIcon.vue.d.mts +3 -0
- package/dist/components/icons/ChevronIcon.vue.d.cts +3 -0
- package/dist/components/icons/ChevronIcon.vue.d.mts +3 -0
- package/dist/components/icons/FocusToggleIcon.vue.d.cts +3 -0
- package/dist/components/icons/FocusToggleIcon.vue.d.mts +3 -0
- package/dist/components/icons/GearIcon.vue.d.cts +3 -0
- package/dist/components/icons/GearIcon.vue.d.mts +3 -0
- package/dist/components/icons/LeaveIcon.vue.d.cts +3 -0
- package/dist/components/icons/LeaveIcon.vue.d.mts +3 -0
- package/dist/components/icons/LockLockedIcon.vue.d.cts +3 -0
- package/dist/components/icons/LockLockedIcon.vue.d.mts +3 -0
- package/dist/components/icons/MicDisabledIcon.vue.d.cts +3 -0
- package/dist/components/icons/MicDisabledIcon.vue.d.mts +3 -0
- package/dist/components/icons/MicIcon.vue.d.cts +3 -0
- package/dist/components/icons/MicIcon.vue.d.mts +3 -0
- package/dist/components/icons/ParticipantPlaceholder.vue.d.cts +3 -0
- package/dist/components/icons/ParticipantPlaceholder.vue.d.mts +3 -0
- package/dist/components/icons/QualityExcellentIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityExcellentIcon.vue.d.mts +3 -0
- package/dist/components/icons/QualityGoodIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityGoodIcon.vue.d.mts +3 -0
- package/dist/components/icons/QualityPoorIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityPoorIcon.vue.d.mts +3 -0
- package/dist/components/icons/QualityUnknownIcon.vue.d.cts +3 -0
- package/dist/components/icons/QualityUnknownIcon.vue.d.mts +3 -0
- package/dist/components/icons/ScreenShareIcon.vue.d.cts +3 -0
- package/dist/components/icons/ScreenShareIcon.vue.d.mts +3 -0
- package/dist/components/icons/ScreenShareStopIcon.vue.d.cts +3 -0
- package/dist/components/icons/ScreenShareStopIcon.vue.d.mts +3 -0
- package/dist/components/icons/SpinnerIcon.vue.d.cts +3 -0
- package/dist/components/icons/SpinnerIcon.vue.d.mts +3 -0
- package/dist/components/icons/UnfocusToggleIcon.vue.d.cts +3 -0
- package/dist/components/icons/UnfocusToggleIcon.vue.d.mts +3 -0
- package/dist/components/icons/index.d.cts +21 -0
- package/dist/components/icons/index.d.mts +21 -0
- package/dist/components/icons/utils.d.cts +4 -0
- package/dist/components/icons/utils.d.mts +4 -0
- package/dist/components/index.d.cts +9 -0
- package/dist/components/index.d.mts +9 -0
- package/dist/components/layout/CarouselLayout.vue.d.cts +24 -0
- package/dist/components/layout/CarouselLayout.vue.d.mts +24 -0
- package/dist/components/layout/FocusLayout.vue.d.cts +16 -0
- package/dist/components/layout/FocusLayout.vue.d.mts +16 -0
- package/dist/components/layout/FocusLayoutContainer.vue.d.cts +14 -0
- package/dist/components/layout/FocusLayoutContainer.vue.d.mts +14 -0
- package/dist/components/layout/GridLayout.vue.d.cts +24 -0
- package/dist/components/layout/GridLayout.vue.d.mts +24 -0
- package/dist/components/layout/LayoutContextProvider.vue.d.cts +27 -0
- package/dist/components/layout/LayoutContextProvider.vue.d.mts +27 -0
- package/dist/components/layout/index.d.cts +10 -0
- package/dist/components/layout/index.d.mts +10 -0
- package/dist/components/participant/AudioTrack.vue.d.cts +17 -0
- package/dist/components/participant/AudioTrack.vue.d.mts +17 -0
- package/dist/components/participant/AudioVisualizer.vue.d.cts +10 -0
- package/dist/components/participant/AudioVisualizer.vue.d.mts +10 -0
- package/dist/components/participant/BarVisualizer.vue.d.cts +46 -0
- package/dist/components/participant/BarVisualizer.vue.d.mts +46 -0
- package/dist/components/participant/ConnectionQualityIndicator.vue.d.cts +19 -0
- package/dist/components/participant/ConnectionQualityIndicator.vue.d.mts +19 -0
- package/dist/components/participant/ParticipantAudioTile.vue.d.cts +23 -0
- package/dist/components/participant/ParticipantAudioTile.vue.d.mts +23 -0
- package/dist/components/participant/ParticipantAvatar.vue.d.cts +10 -0
- package/dist/components/participant/ParticipantAvatar.vue.d.mts +10 -0
- package/dist/components/participant/ParticipantName.vue.d.cts +17 -0
- package/dist/components/participant/ParticipantName.vue.d.mts +17 -0
- package/dist/components/participant/ParticipantTile.vue.d.cts +27 -0
- package/dist/components/participant/ParticipantTile.vue.d.mts +27 -0
- package/dist/components/participant/TrackMutedIndicator.vue.d.cts +22 -0
- package/dist/components/participant/TrackMutedIndicator.vue.d.mts +22 -0
- package/dist/components/participant/VideoTrack.vue.d.cts +17 -0
- package/dist/components/participant/VideoTrack.vue.d.mts +17 -0
- package/dist/components/participant/index.d.cts +19 -0
- package/dist/components/participant/index.d.mts +19 -0
- package/dist/components/prefabs/AudioConference.vue.d.cts +26 -0
- package/dist/components/prefabs/AudioConference.vue.d.mts +26 -0
- package/dist/components/prefabs/Chat.vue.d.cts +36 -0
- package/dist/components/prefabs/Chat.vue.d.mts +36 -0
- package/dist/components/prefabs/ControlBar.vue.d.cts +52 -0
- package/dist/components/prefabs/ControlBar.vue.d.mts +52 -0
- package/dist/components/prefabs/MediaDeviceMenu.vue.d.cts +46 -0
- package/dist/components/prefabs/MediaDeviceMenu.vue.d.mts +46 -0
- package/dist/components/prefabs/PreJoin.vue.d.cts +45 -0
- package/dist/components/prefabs/PreJoin.vue.d.mts +45 -0
- package/dist/components/prefabs/VideoConference.vue.d.cts +28 -0
- package/dist/components/prefabs/VideoConference.vue.d.mts +28 -0
- package/dist/components/prefabs/VoiceAssistantControlBar.vue.d.cts +33 -0
- package/dist/components/prefabs/VoiceAssistantControlBar.vue.d.mts +33 -0
- package/dist/components/prefabs/index.d.cts +14 -0
- package/dist/components/prefabs/index.d.mts +14 -0
- package/dist/components/room/ConnectionStateToast.vue.d.cts +8 -0
- package/dist/components/room/ConnectionStateToast.vue.d.mts +8 -0
- package/dist/components/room/ConnectionStatus.vue.d.cts +19 -0
- package/dist/components/room/ConnectionStatus.vue.d.mts +19 -0
- package/dist/components/room/LiveKitRoom.vue.d.cts +47 -0
- package/dist/components/room/LiveKitRoom.vue.d.mts +47 -0
- package/dist/components/room/ParticipantLoop.vue.d.cts +18 -0
- package/dist/components/room/ParticipantLoop.vue.d.mts +18 -0
- package/dist/components/room/RoomAudioRenderer.vue.d.cts +13 -0
- package/dist/components/room/RoomAudioRenderer.vue.d.mts +13 -0
- package/dist/components/room/RoomName.vue.d.cts +20 -0
- package/dist/components/room/RoomName.vue.d.mts +20 -0
- package/dist/components/room/Toast.vue.d.cts +14 -0
- package/dist/components/room/Toast.vue.d.mts +14 -0
- package/dist/components/room/TrackLoop.vue.d.cts +18 -0
- package/dist/components/room/TrackLoop.vue.d.mts +18 -0
- package/dist/components/room/index.d.cts +16 -0
- package/dist/components/room/index.d.mts +16 -0
- package/dist/components/style.d.cts +11 -0
- package/dist/components/style.d.mts +11 -0
- package/dist/composables/index.d.cts +66 -0
- package/dist/composables/index.d.mts +66 -0
- package/dist/composables/useAgent.d.cts +67 -0
- package/dist/composables/useAgent.d.mts +67 -0
- package/dist/composables/useAgentExpression.d.cts +20 -0
- package/dist/composables/useAgentExpression.d.mts +20 -0
- package/dist/composables/useAudioPlayback.d.cts +10 -0
- package/dist/composables/useAudioPlayback.d.mts +10 -0
- package/dist/composables/useBackgroundEffect.d.cts +43 -0
- package/dist/composables/useBackgroundEffect.d.mts +43 -0
- package/dist/composables/useBarAnimator.d.cts +11 -0
- package/dist/composables/useBarAnimator.d.mts +11 -0
- package/dist/composables/useChat.d.cts +13 -0
- package/dist/composables/useChat.d.mts +13 -0
- package/dist/composables/useChatToggle.d.cts +13 -0
- package/dist/composables/useChatToggle.d.mts +13 -0
- package/dist/composables/useClearPinButton.d.cts +14 -0
- package/dist/composables/useClearPinButton.d.mts +14 -0
- package/dist/composables/useConnectionQualityIndicator.d.cts +9 -0
- package/dist/composables/useConnectionQualityIndicator.d.mts +9 -0
- package/dist/composables/useConnectionState.d.cts +13 -0
- package/dist/composables/useConnectionState.d.mts +13 -0
- package/dist/composables/useConnectionStatus.d.cts +16 -0
- package/dist/composables/useConnectionStatus.d.mts +16 -0
- package/dist/composables/useDataChannel.d.cts +14 -0
- package/dist/composables/useDataChannel.d.mts +14 -0
- package/dist/composables/useDisconnectButton.d.cts +9 -0
- package/dist/composables/useDisconnectButton.d.mts +9 -0
- package/dist/composables/useEvents.d.cts +15 -0
- package/dist/composables/useEvents.d.mts +15 -0
- package/dist/composables/useFacingMode.d.cts +17 -0
- package/dist/composables/useFacingMode.d.mts +17 -0
- package/dist/composables/useFocusToggle.d.cts +14 -0
- package/dist/composables/useFocusToggle.d.mts +14 -0
- package/dist/composables/useGridLayout.d.cts +13 -0
- package/dist/composables/useGridLayout.d.mts +13 -0
- package/dist/composables/useIsEncrypted.d.cts +10 -0
- package/dist/composables/useIsEncrypted.d.mts +10 -0
- package/dist/composables/useIsMuted.d.cts +11 -0
- package/dist/composables/useIsMuted.d.mts +11 -0
- package/dist/composables/useIsRecording.d.cts +9 -0
- package/dist/composables/useIsRecording.d.mts +9 -0
- package/dist/composables/useIsSpeaking.d.cts +9 -0
- package/dist/composables/useIsSpeaking.d.mts +9 -0
- package/dist/composables/useKrispNoiseFilter.d.cts +16 -0
- package/dist/composables/useKrispNoiseFilter.d.mts +16 -0
- package/dist/composables/useLiveKitRoom.d.cts +15 -0
- package/dist/composables/useLiveKitRoom.d.mts +15 -0
- package/dist/composables/useLocalParticipant.d.cts +16 -0
- package/dist/composables/useLocalParticipant.d.mts +16 -0
- package/dist/composables/useLocalParticipantPermissions.d.cts +13 -0
- package/dist/composables/useLocalParticipantPermissions.d.mts +13 -0
- package/dist/composables/useMediaDeviceSelect.d.cts +16 -0
- package/dist/composables/useMediaDeviceSelect.d.mts +16 -0
- package/dist/composables/useMediaDevices.d.cts +12 -0
- package/dist/composables/useMediaDevices.d.mts +12 -0
- package/dist/composables/useMediaTrackBySourceOrName.d.cts +30 -0
- package/dist/composables/useMediaTrackBySourceOrName.d.mts +30 -0
- package/dist/composables/usePagination.d.cts +26 -0
- package/dist/composables/usePagination.d.mts +26 -0
- package/dist/composables/useParticipantAttributes.d.cts +14 -0
- package/dist/composables/useParticipantAttributes.d.mts +14 -0
- package/dist/composables/useParticipantAvatar.d.cts +17 -0
- package/dist/composables/useParticipantAvatar.d.mts +17 -0
- package/dist/composables/useParticipantInfo.d.cts +14 -0
- package/dist/composables/useParticipantInfo.d.mts +14 -0
- package/dist/composables/useParticipantPermissions.d.cts +10 -0
- package/dist/composables/useParticipantPermissions.d.mts +10 -0
- package/dist/composables/useParticipantTile.d.cts +22 -0
- package/dist/composables/useParticipantTile.d.mts +22 -0
- package/dist/composables/useParticipantTracks.d.cts +12 -0
- package/dist/composables/useParticipantTracks.d.mts +12 -0
- package/dist/composables/useParticipants.d.cts +11 -0
- package/dist/composables/useParticipants.d.mts +11 -0
- package/dist/composables/usePersistentUserChoices.d.cts +16 -0
- package/dist/composables/usePersistentUserChoices.d.mts +16 -0
- package/dist/composables/usePinnedTracks.d.cts +10 -0
- package/dist/composables/usePinnedTracks.d.mts +10 -0
- package/dist/composables/usePreviewTracks.d.cts +15 -0
- package/dist/composables/usePreviewTracks.d.mts +15 -0
- package/dist/composables/useRemoteParticipant.d.cts +14 -0
- package/dist/composables/useRemoteParticipant.d.mts +14 -0
- package/dist/composables/useRemoteParticipants.d.cts +10 -0
- package/dist/composables/useRemoteParticipants.d.mts +10 -0
- package/dist/composables/useRoomInfo.d.cts +13 -0
- package/dist/composables/useRoomInfo.d.mts +13 -0
- package/dist/composables/useRpc.d.cts +18 -0
- package/dist/composables/useRpc.d.mts +18 -0
- package/dist/composables/useSequentialRoomConnectDisconnect.d.cts +10 -0
- package/dist/composables/useSequentialRoomConnectDisconnect.d.mts +10 -0
- package/dist/composables/useSession.d.cts +83 -0
- package/dist/composables/useSession.d.mts +83 -0
- package/dist/composables/useSessionMessages.d.cts +22 -0
- package/dist/composables/useSessionMessages.d.mts +22 -0
- package/dist/composables/useSettingsToggle.d.cts +10 -0
- package/dist/composables/useSettingsToggle.d.mts +10 -0
- package/dist/composables/useSortedParticipants.d.cts +9 -0
- package/dist/composables/useSortedParticipants.d.mts +9 -0
- package/dist/composables/useSpeakingParticipants.d.cts +6 -0
- package/dist/composables/useSpeakingParticipants.d.mts +6 -0
- package/dist/composables/useStartAudio.d.cts +10 -0
- package/dist/composables/useStartAudio.d.mts +10 -0
- package/dist/composables/useStartVideo.d.cts +10 -0
- package/dist/composables/useStartVideo.d.mts +10 -0
- package/dist/composables/useSwipe.d.cts +16 -0
- package/dist/composables/useSwipe.d.mts +16 -0
- package/dist/composables/useTextStream.d.cts +27 -0
- package/dist/composables/useTextStream.d.mts +27 -0
- package/dist/composables/useToast.d.cts +9 -0
- package/dist/composables/useToast.d.mts +9 -0
- package/dist/composables/useToken.d.cts +23 -0
- package/dist/composables/useToken.d.mts +23 -0
- package/dist/composables/useTrack.d.cts +12 -0
- package/dist/composables/useTrack.d.mts +12 -0
- package/dist/composables/useTrackByName.d.cts +11 -0
- package/dist/composables/useTrackByName.d.mts +11 -0
- package/dist/composables/useTrackMutedIndicator.d.cts +9 -0
- package/dist/composables/useTrackMutedIndicator.d.mts +9 -0
- package/dist/composables/useTrackRefBySource.d.cts +9 -0
- package/dist/composables/useTrackRefBySource.d.mts +9 -0
- package/dist/composables/useTrackRefBySourceOrName.d.cts +7 -0
- package/dist/composables/useTrackRefBySourceOrName.d.mts +7 -0
- package/dist/composables/useTrackSyncTime.d.cts +13 -0
- package/dist/composables/useTrackSyncTime.d.mts +13 -0
- package/dist/composables/useTrackToggle.d.cts +28 -0
- package/dist/composables/useTrackToggle.d.mts +28 -0
- package/dist/composables/useTrackTranscription.d.cts +15 -0
- package/dist/composables/useTrackTranscription.d.mts +15 -0
- package/dist/composables/useTrackVolume.d.cts +39 -0
- package/dist/composables/useTrackVolume.d.mts +39 -0
- package/dist/composables/useTracks.d.cts +18 -0
- package/dist/composables/useTracks.d.mts +18 -0
- package/dist/composables/useTranscriptions.d.cts +12 -0
- package/dist/composables/useTranscriptions.d.mts +12 -0
- package/dist/composables/useVideoQuality.d.cts +29 -0
- package/dist/composables/useVideoQuality.d.mts +29 -0
- package/dist/composables/useVisualStableUpdate.d.cts +13 -0
- package/dist/composables/useVisualStableUpdate.d.mts +13 -0
- package/dist/composables/useVoiceAssistant.d.cts +16 -0
- package/dist/composables/useVoiceAssistant.d.mts +16 -0
- package/dist/context/connection-state.context.d.cts +18 -0
- package/dist/context/connection-state.context.d.mts +18 -0
- package/dist/context/error.d.cts +3 -0
- package/dist/context/error.d.mts +3 -0
- package/dist/context/feature.context.d.cts +8 -0
- package/dist/context/feature.context.d.mts +8 -0
- package/dist/context/index.d.cts +9 -0
- package/dist/context/index.d.mts +9 -0
- package/dist/context/layout.context.d.cts +15 -0
- package/dist/context/layout.context.d.mts +15 -0
- package/dist/context/participant.context.d.cts +8 -0
- package/dist/context/participant.context.d.mts +8 -0
- package/dist/context/pin.context.d.cts +21 -0
- package/dist/context/pin.context.d.mts +21 -0
- package/dist/context/room.context.d.cts +8 -0
- package/dist/context/room.context.d.mts +8 -0
- package/dist/context/session.context.d.cts +8 -0
- package/dist/context/session.context.d.mts +8 -0
- package/dist/context/toast.context.d.cts +17 -0
- package/dist/context/toast.context.d.mts +17 -0
- package/dist/context/track-reference.context.d.cts +8 -0
- package/dist/context/track-reference.context.d.mts +8 -0
- package/dist/context/widget.context.d.cts +21 -0
- package/dist/context/widget.context.d.mts +21 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/internal/emitter.d.cts +17 -0
- package/dist/internal/emitter.d.mts +17 -0
- package/dist/internal/index.d.cts +4 -0
- package/dist/internal/index.d.mts +4 -0
- package/dist/internal/observable.d.cts +3 -0
- package/dist/internal/observable.d.mts +3 -0
- package/dist/internal/permissions.d.cts +4 -0
- package/dist/internal/permissions.d.mts +4 -0
- package/dist/internal/refs.d.cts +1 -0
- package/dist/internal/refs.d.mts +1 -0
- package/dist/krisp/index.d.cts +1 -0
- package/dist/krisp/index.d.mts +1 -0
- package/dist/krisp.cjs +2 -0
- package/dist/krisp.cjs.map +1 -0
- package/dist/krisp.js +62 -0
- package/dist/krisp.js.map +1 -0
- package/dist/livekit-vue.cjs +2 -0
- package/dist/livekit-vue.cjs.map +1 -0
- package/dist/livekit-vue.js +5095 -20519
- package/dist/livekit-vue.js.map +1 -0
- package/dist/livekit-vue.umd.js +4 -0
- package/dist/livekit-vue.umd.js.map +1 -0
- package/dist/style-CDggj9VO.js +14 -0
- package/dist/style-CDggj9VO.js.map +1 -0
- package/dist/style-CkQyDSsh.cjs +2 -0
- package/dist/style-CkQyDSsh.cjs.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/types/agent.types.d.cts +2 -0
- package/dist/types/agent.types.d.mts +2 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/livekit-room.types.d.cts +19 -0
- package/dist/types/livekit-room.types.d.mts +19 -0
- package/dist/types/participant.types.d.cts +2 -0
- package/dist/types/participant.types.d.mts +2 -0
- package/dist/useLocalParticipant-ByBAgL8i.js +50 -0
- package/dist/useLocalParticipant-ByBAgL8i.js.map +1 -0
- package/dist/useLocalParticipant-Dn5NE_KM.cjs +2 -0
- package/dist/useLocalParticipant-Dn5NE_KM.cjs.map +1 -0
- package/dist/utils/media-choices.utils.d.cts +7 -0
- package/dist/utils/media-choices.utils.d.mts +7 -0
- package/dist/{src/utils/room.utils.d.ts → utils/room.utils.d.cts} +1 -1
- package/dist/utils/room.utils.d.mts +1 -0
- package/package.json +103 -66
- package/dist/favicon.ico +0 -0
- package/dist/index.css +0 -1
- package/dist/livekit-vue.umd.cjs +0 -62
- package/dist/src/assets/index.d.ts +0 -0
- package/dist/src/components/controls/TrackToggle.vue.d.ts +0 -3
- package/dist/src/components/controls/buttons.d.ts +0 -4
- package/dist/src/components/controls/index.d.ts +0 -3
- package/dist/src/components/controls/track_toggle.d.ts +0 -12
- package/dist/src/components/icons/ParticipantPlaceholderIcon.vue.d.ts +0 -2
- package/dist/src/components/icons/TrackIcon.vue.d.ts +0 -7
- package/dist/src/components/index.d.ts +0 -3
- package/dist/src/components/participant/audio_track.d.ts +0 -7
- package/dist/src/composables/index.d.ts +0 -37
- package/dist/src/composables/private/useObservableState.d.ts +0 -8
- package/dist/src/composables/useAudioPlayback.d.ts +0 -11
- package/dist/src/composables/useClearPinButton.d.ts +0 -5
- package/dist/src/composables/useConnectionQualityIndicator.d.ts +0 -10
- package/dist/src/composables/useConnectionState.d.ts +0 -3
- package/dist/src/composables/useDataChannel.d.ts +0 -15
- package/dist/src/composables/useDisconnectButton.d.ts +0 -5
- package/dist/src/composables/useFacingMode.d.ts +0 -10
- package/dist/src/composables/useFocusToggle.d.ts +0 -11
- package/dist/src/composables/useGridLayout.d.ts +0 -10
- package/dist/src/composables/useIsEncrypted.d.ts +0 -8
- package/dist/src/composables/useIsMuted.d.ts +0 -7
- package/dist/src/composables/useIsRecording.d.ts +0 -5
- package/dist/src/composables/useIsSpeaking.d.ts +0 -5
- package/dist/src/composables/useLiveKitRoom.d.ts +0 -8
- package/dist/src/composables/useLocalParticipant.d.ts +0 -16
- package/dist/src/composables/useParticipantTile.d.ts +0 -11
- package/dist/src/composables/useParticipantTracks.d.ts +0 -4
- package/dist/src/composables/useParticipants.d.ts +0 -7
- package/dist/src/composables/usePersistentUserChoices.d.ts +0 -16
- package/dist/src/composables/usePinnedTracks.d.ts +0 -4
- package/dist/src/composables/useRemoteParticipant.d.ts +0 -7
- package/dist/src/composables/useRemoteParticipants.d.ts +0 -7
- package/dist/src/composables/useRoomInfo.d.ts +0 -13
- package/dist/src/composables/useSortedParticipants.d.ts +0 -3
- package/dist/src/composables/useSpeakingParticipants.d.ts +0 -3
- package/dist/src/composables/useStartAudio.d.ts +0 -11
- package/dist/src/composables/useStartVideo.d.ts +0 -11
- package/dist/src/composables/useToken.d.ts +0 -10
- package/dist/src/composables/useTrack.d.ts +0 -3
- package/dist/src/composables/useTrackByName.d.ts +0 -3
- package/dist/src/composables/useTrackMutedIndicator.d.ts +0 -6
- package/dist/src/composables/useTrackRefBySourceOrName.d.ts +0 -4
- package/dist/src/composables/useTrackSyncTime.d.ts +0 -6
- package/dist/src/composables/useTrackToggle.d.ts +0 -21
- package/dist/src/composables/useTrackVolume.d.ts +0 -28
- package/dist/src/composables/useTracks.d.ts +0 -10
- package/dist/src/composables/useVisualStableUpdate.d.ts +0 -8
- package/dist/src/context/index.d.ts +0 -6
- package/dist/src/context/layout.context.d.ts +0 -28
- package/dist/src/context/participant.context.d.ts +0 -9
- package/dist/src/context/pin.context.d.ts +0 -26
- package/dist/src/context/room.context.d.ts +0 -9
- package/dist/src/context/track_reference.context.d.ts +0 -6
- package/dist/src/context/widget.context.d.ts +0 -7
- package/dist/src/index.d.ts +0 -3
- package/dist/src/types/livekit_room.types.d.ts +0 -68
- package/src/assets/icons/chevron-down.svg +0 -4
- package/src/assets/icons/chevron-up.svg +0 -4
- package/src/assets/icons/frown.svg +0 -7
- package/src/assets/icons/heart.svg +0 -6
- package/src/assets/icons/mic-off.svg +0 -8
- package/src/assets/icons/mic.svg +0 -7
- package/src/assets/icons/phone-hang-up.svg +0 -9
- package/src/assets/icons/share-screen-off.svg +0 -6
- package/src/assets/icons/share-screen.svg +0 -7
- package/src/assets/icons/smile.svg +0 -7
- package/src/assets/icons/thumbs-down.svg +0 -6
- package/src/assets/icons/thumbs-up.svg +0 -6
- package/src/assets/icons/video-off.svg +0 -5
- package/src/assets/icons/video.svg +0 -5
- package/src/assets/index.ts +0 -1
- package/src/assets/placeholders/participant.svg +0 -8
- package/src/components/controls/TrackToggle.vue +0 -20
- package/src/components/controls/buttons.ts +0 -5
- package/src/components/controls/index.ts +0 -3
- package/src/components/controls/track_toggle.ts +0 -13
- package/src/components/icons/ParticipantPlaceholderIcon.vue +0 -7
- package/src/components/icons/TrackIcon.vue +0 -55
- package/src/components/index.ts +0 -3
- package/src/components/participant/AudioTrack.vue +0 -17
- package/src/components/participant/audio_track.ts +0 -8
- package/src/composables/index.ts +0 -89
- package/src/composables/private/useObservableState.ts +0 -44
- package/src/composables/useAudioPlayback.ts +0 -42
- package/src/composables/useClearPinButton.ts +0 -41
- package/src/composables/useConnectionQualityIndicator.ts +0 -39
- package/src/composables/useConnectionState.ts +0 -21
- package/src/composables/useDataChannel.ts +0 -56
- package/src/composables/useDisconnectButton.ts +0 -28
- package/src/composables/useFacingMode.ts +0 -28
- package/src/composables/useFocusToggle.ts +0 -38
- package/src/composables/useGridLayout.ts +0 -44
- package/src/composables/useIsEncrypted.ts +0 -34
- package/src/composables/useIsMuted.ts +0 -56
- package/src/composables/useIsRecording.ts +0 -30
- package/src/composables/useIsSpeaking.ts +0 -23
- package/src/composables/useLiveKitRoom.ts +0 -219
- package/src/composables/useLocalParticipant.ts +0 -64
- package/src/composables/useParticipantTile.ts +0 -68
- package/src/composables/useParticipantTracks.ts +0 -36
- package/src/composables/useParticipants.ts +0 -25
- package/src/composables/usePersistentUserChoices.ts +0 -64
- package/src/composables/usePinnedTracks.ts +0 -16
- package/src/composables/useRemoteParticipant.ts +0 -42
- package/src/composables/useRemoteParticipants.ts +0 -27
- package/src/composables/useRoomInfo.ts +0 -42
- package/src/composables/useSortedParticipants.ts +0 -21
- package/src/composables/useSpeakingParticipants.ts +0 -22
- package/src/composables/useStartAudio.ts +0 -53
- package/src/composables/useStartVideo.ts +0 -53
- package/src/composables/useToken.ts +0 -40
- package/src/composables/useTrack.ts +0 -11
- package/src/composables/useTrackByName.ts +0 -11
- package/src/composables/useTrackMutedIndicator.ts +0 -34
- package/src/composables/useTrackRefBySourceOrName.ts +0 -39
- package/src/composables/useTrackSyncTime.ts +0 -32
- package/src/composables/useTrackToggle.ts +0 -110
- package/src/composables/useTrackVolume.ts +0 -268
- package/src/composables/useTracks.ts +0 -122
- package/src/composables/useVisualStableUpdate.ts +0 -57
- package/src/context/index.ts +0 -6
- package/src/context/layout.context.ts +0 -46
- package/src/context/participant.context.ts +0 -33
- package/src/context/pin.context.ts +0 -50
- package/src/context/room.context.ts +0 -31
- package/src/context/track_reference.context.ts +0 -29
- package/src/context/widget.context.ts +0 -17
- package/src/index.css +0 -1
- package/src/index.ts +0 -5
- package/src/types/livekit_room.types.ts +0 -78
- package/src/utils/room.utils.ts +0 -9
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import type { TrackToggleProps } from '@/components/controls/track_toggle';
|
|
2
|
-
import { useMaybeRoomContext } from '@/context/room.context';
|
|
3
|
-
import { setupManualToggle, setupMediaToggle, type ToggleSource } from '@livekit/components-core';
|
|
4
|
-
import type {
|
|
5
|
-
AudioCaptureOptions,
|
|
6
|
-
LocalTrackPublication,
|
|
7
|
-
ScreenShareCaptureOptions,
|
|
8
|
-
VideoCaptureOptions,
|
|
9
|
-
} from 'livekit-client';
|
|
10
|
-
import type { Observable } from 'rxjs';
|
|
11
|
-
import { computed, onMounted, ref, watch, type ShallowRef } from 'vue';
|
|
12
|
-
import { useObservableState } from './private/useObservableState';
|
|
13
|
-
|
|
14
|
-
export type UseTrackToggleProps = Omit<TrackToggleProps, 'showIcon'>;
|
|
15
|
-
|
|
16
|
-
export type StateObserver = Observable<boolean>;
|
|
17
|
-
|
|
18
|
-
export type UseTrackToggleReturnType = {
|
|
19
|
-
toggle?:
|
|
20
|
-
| ((forceState?: boolean) => Promise<void>)
|
|
21
|
-
| ((
|
|
22
|
-
forceState?: boolean,
|
|
23
|
-
captureOptions?:
|
|
24
|
-
| VideoCaptureOptions
|
|
25
|
-
| AudioCaptureOptions
|
|
26
|
-
| ScreenShareCaptureOptions
|
|
27
|
-
| undefined,
|
|
28
|
-
) => Promise<boolean | undefined>);
|
|
29
|
-
enabled: ShallowRef<boolean>;
|
|
30
|
-
pending: ShallowRef<boolean>;
|
|
31
|
-
track: ShallowRef<LocalTrackPublication | undefined>;
|
|
32
|
-
buttonProps: {
|
|
33
|
-
'aria-pressed': boolean;
|
|
34
|
-
'data-lk-source': ToggleSource;
|
|
35
|
-
'data-lk-enabled': boolean;
|
|
36
|
-
disabled: boolean;
|
|
37
|
-
onClick: (evt: MouseEvent) => void;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export function useTrackToggle(options: UseTrackToggleProps): UseTrackToggleReturnType {
|
|
42
|
-
const room = useMaybeRoomContext();
|
|
43
|
-
|
|
44
|
-
const userInteractionRef = ref<boolean>(false);
|
|
45
|
-
|
|
46
|
-
const track = computed<LocalTrackPublication | undefined>(() =>
|
|
47
|
-
room?.value?.localParticipant?.getTrackPublication(options.source),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
const setupMediaToggleResult = computed(() =>
|
|
51
|
-
room
|
|
52
|
-
? setupMediaToggle<ToggleSource>(
|
|
53
|
-
options.source,
|
|
54
|
-
room.value,
|
|
55
|
-
options.captureOptions,
|
|
56
|
-
options.publishOptions,
|
|
57
|
-
options.onDeviceError,
|
|
58
|
-
)
|
|
59
|
-
: setupManualToggle(),
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
const pending = useObservableState({
|
|
63
|
-
observable: setupMediaToggleResult.value.pendingObserver as unknown as StateObserver,
|
|
64
|
-
startWith: false,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const enabled = useObservableState({
|
|
68
|
-
observable: setupMediaToggleResult.value.enabledObserver as unknown as StateObserver,
|
|
69
|
-
startWith: options.initialState ?? !!track.value?.isEnabled,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
function onOnClick(evt: MouseEvent) {
|
|
73
|
-
evt.preventDefault();
|
|
74
|
-
evt.stopPropagation();
|
|
75
|
-
|
|
76
|
-
userInteractionRef.value = true;
|
|
77
|
-
|
|
78
|
-
setupMediaToggleResult.value.toggle().catch(() => (userInteractionRef.value = false));
|
|
79
|
-
|
|
80
|
-
if (options.customOnClickHandler) {
|
|
81
|
-
options.customOnClickHandler(evt);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
watch(enabled, (enabled) => {
|
|
86
|
-
options?.onChange?.(enabled, userInteractionRef.value);
|
|
87
|
-
userInteractionRef.value = false;
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
onMounted(() => {
|
|
91
|
-
if (options.initialState !== undefined) {
|
|
92
|
-
console.debug('forcing initial toggle state', options.source, options.initialState);
|
|
93
|
-
setupMediaToggleResult.value.toggle(options.initialState);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
toggle: setupMediaToggleResult.value.toggle,
|
|
99
|
-
enabled,
|
|
100
|
-
pending,
|
|
101
|
-
track,
|
|
102
|
-
buttonProps: {
|
|
103
|
-
'aria-pressed': enabled.value,
|
|
104
|
-
'data-lk-source': options.source,
|
|
105
|
-
'data-lk-enabled': enabled.value,
|
|
106
|
-
disabled: pending.value ?? false,
|
|
107
|
-
onClick: onOnClick,
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isTrackReference,
|
|
3
|
-
type TrackReference,
|
|
4
|
-
type TrackReferenceOrPlaceholder,
|
|
5
|
-
} from '@livekit/components-core';
|
|
6
|
-
import {
|
|
7
|
-
createAudioAnalyser,
|
|
8
|
-
Track,
|
|
9
|
-
type AudioAnalyserOptions,
|
|
10
|
-
type LocalAudioTrack,
|
|
11
|
-
type RemoteAudioTrack,
|
|
12
|
-
} from 'livekit-client';
|
|
13
|
-
import { onBeforeMount, onWatcherCleanup, ref, watch, type ShallowRef } from 'vue';
|
|
14
|
-
|
|
15
|
-
export type MultiBandTrackVolumeOptions = {
|
|
16
|
-
bands?: number;
|
|
17
|
-
/**
|
|
18
|
-
* cut off of frequency bins on the lower end
|
|
19
|
-
* Note: this is not a frequency measure, but in relation to analyserOptions.fftSize,
|
|
20
|
-
*/
|
|
21
|
-
loPass?: number;
|
|
22
|
-
/**
|
|
23
|
-
* cut off of frequency bins on the higher end
|
|
24
|
-
* Note: this is not a frequency measure, but in relation to analyserOptions.fftSize,
|
|
25
|
-
*/
|
|
26
|
-
hiPass?: number;
|
|
27
|
-
updateInterval?: number;
|
|
28
|
-
analyserOptions?: AnalyserOptions;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type AudioWaveformOptions = {
|
|
32
|
-
barCount?: number;
|
|
33
|
-
volMultiplier?: number;
|
|
34
|
-
updateInterval?: number;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const multibandDefaults = {
|
|
38
|
-
bands: 5,
|
|
39
|
-
loPass: 100,
|
|
40
|
-
hiPass: 600,
|
|
41
|
-
updateInterval: 32,
|
|
42
|
-
analyserOptions: { fftSize: 2048 },
|
|
43
|
-
} as const satisfies MultiBandTrackVolumeOptions;
|
|
44
|
-
|
|
45
|
-
const waveformDefaults = {
|
|
46
|
-
barCount: 120,
|
|
47
|
-
volMultiplier: 5,
|
|
48
|
-
updateInterval: 20,
|
|
49
|
-
} as const satisfies AudioWaveformOptions;
|
|
50
|
-
|
|
51
|
-
function normalizeFrequencies(frequencies: Float32Array): Float32Array<ArrayBuffer> {
|
|
52
|
-
const normalizeDb = (value: number) => {
|
|
53
|
-
const minDb = -100;
|
|
54
|
-
const maxDb = -10;
|
|
55
|
-
let db = 1 - (Math.max(minDb, Math.min(maxDb, value)) * -1) / 100;
|
|
56
|
-
db = Math.sqrt(db);
|
|
57
|
-
|
|
58
|
-
return db;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Normalize all frequency values
|
|
62
|
-
return frequencies.map((value) => {
|
|
63
|
-
if (value === -Infinity) {
|
|
64
|
-
return 0;
|
|
65
|
-
}
|
|
66
|
-
return normalizeDb(value);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function getFFTSizeValue(x: number): number {
|
|
71
|
-
if (x < 32) return 32;
|
|
72
|
-
else return pow2ceil(x);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function pow2ceil(v: number): number {
|
|
76
|
-
let p = 2;
|
|
77
|
-
while ((v >>= 1)) {
|
|
78
|
-
p <<= 1;
|
|
79
|
-
}
|
|
80
|
-
return p;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function filterData(audioData: Float32Array, numSamples: number): Float32Array {
|
|
84
|
-
const blockSize = Math.floor(audioData.length / numSamples); // the number of samples in each subdivision
|
|
85
|
-
const filteredData = new Float32Array(numSamples);
|
|
86
|
-
for (let i = 0; i < numSamples; i++) {
|
|
87
|
-
const blockStart = blockSize * i; // the location of the first sample in the block
|
|
88
|
-
let sum = 0;
|
|
89
|
-
for (let j = 0; j < blockSize; j++) {
|
|
90
|
-
sum = sum + Math.abs(audioData[blockStart + j]); // find the sum of all the samples in the block
|
|
91
|
-
}
|
|
92
|
-
filteredData[i] = sum / blockSize; // divide the sum by the block size to get the average
|
|
93
|
-
}
|
|
94
|
-
return filteredData;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function useTrackVolume(
|
|
98
|
-
trackOrTrackReference?: LocalAudioTrack | RemoteAudioTrack | TrackReference,
|
|
99
|
-
options: AudioAnalyserOptions = { fftSize: 32, smoothingTimeConstant: 0 },
|
|
100
|
-
): ShallowRef<number> {
|
|
101
|
-
const track = isTrackReference(trackOrTrackReference)
|
|
102
|
-
? <LocalAudioTrack | RemoteAudioTrack | undefined>trackOrTrackReference.publication.track
|
|
103
|
-
: trackOrTrackReference;
|
|
104
|
-
|
|
105
|
-
const volume = ref<number>(0);
|
|
106
|
-
|
|
107
|
-
watch(
|
|
108
|
-
() => track,
|
|
109
|
-
(val) => {
|
|
110
|
-
if (!val || !val.mediaStream) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const { cleanup, analyser } = createAudioAnalyser(val, options);
|
|
115
|
-
|
|
116
|
-
const bufferLength = analyser.frequencyBinCount;
|
|
117
|
-
const dataArray = new Uint8Array(bufferLength);
|
|
118
|
-
|
|
119
|
-
function updateVolume() {
|
|
120
|
-
analyser.getByteFrequencyData(dataArray);
|
|
121
|
-
let sum = 0;
|
|
122
|
-
for (let i = 0; i < dataArray.length; i++) {
|
|
123
|
-
const a = dataArray[i];
|
|
124
|
-
sum += a * a;
|
|
125
|
-
}
|
|
126
|
-
volume.value = Math.sqrt(sum / dataArray.length) / 255;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const interval = setInterval(updateVolume, 1000 / 30);
|
|
130
|
-
|
|
131
|
-
onWatcherCleanup(() => {
|
|
132
|
-
cleanup();
|
|
133
|
-
clearInterval(interval);
|
|
134
|
-
});
|
|
135
|
-
},
|
|
136
|
-
{ deep: true },
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
return volume;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function useMultibandTrackVolume(
|
|
143
|
-
trackOrTrackReference?: LocalAudioTrack | RemoteAudioTrack | TrackReferenceOrPlaceholder,
|
|
144
|
-
options: MultiBandTrackVolumeOptions = {},
|
|
145
|
-
): ShallowRef<number[]> {
|
|
146
|
-
const track =
|
|
147
|
-
trackOrTrackReference instanceof Track
|
|
148
|
-
? trackOrTrackReference
|
|
149
|
-
: <LocalAudioTrack | RemoteAudioTrack | undefined>trackOrTrackReference?.publication?.track;
|
|
150
|
-
|
|
151
|
-
const opts = { ...multibandDefaults, ...options };
|
|
152
|
-
const frequencyBands = ref<number[]>(new Array(opts.bands).fill(0));
|
|
153
|
-
|
|
154
|
-
watch(
|
|
155
|
-
[track, options],
|
|
156
|
-
() => {
|
|
157
|
-
if (!track || !track?.mediaStream) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const { analyser, cleanup } = createAudioAnalyser(track, opts.analyserOptions);
|
|
161
|
-
|
|
162
|
-
const bufferLength = analyser.frequencyBinCount;
|
|
163
|
-
const dataArray = new Float32Array(bufferLength);
|
|
164
|
-
|
|
165
|
-
const updateVolume = () => {
|
|
166
|
-
analyser.getFloatFrequencyData(dataArray);
|
|
167
|
-
|
|
168
|
-
let frequencies: Float32Array = new Float32Array(dataArray.length);
|
|
169
|
-
|
|
170
|
-
for (let i = 0; i < dataArray.length; i++) {
|
|
171
|
-
frequencies[i] = dataArray[i];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
frequencies = frequencies.slice(options.loPass, options.hiPass);
|
|
175
|
-
|
|
176
|
-
const chunks: Array<number> = [];
|
|
177
|
-
const normalizedFrequencies = normalizeFrequencies(frequencies);
|
|
178
|
-
const chunkSize = Math.ceil(normalizedFrequencies.length / opts.bands);
|
|
179
|
-
|
|
180
|
-
for (let i = 0; i < opts.bands; i++) {
|
|
181
|
-
const summedVolumes = normalizedFrequencies
|
|
182
|
-
.slice(i * chunkSize, (i + 1) * chunkSize)
|
|
183
|
-
.reduce((acc, val) => (acc += val), 0);
|
|
184
|
-
|
|
185
|
-
chunks.push(summedVolumes / chunkSize);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
frequencyBands.value = chunks;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const interval = setInterval(updateVolume, opts.updateInterval);
|
|
192
|
-
|
|
193
|
-
onWatcherCleanup(() => {
|
|
194
|
-
cleanup();
|
|
195
|
-
clearInterval(interval);
|
|
196
|
-
});
|
|
197
|
-
},
|
|
198
|
-
{ deep: true },
|
|
199
|
-
);
|
|
200
|
-
|
|
201
|
-
return frequencyBands;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export function useAudioWaveform(
|
|
205
|
-
trackOrTrackReference?: LocalAudioTrack | RemoteAudioTrack | TrackReferenceOrPlaceholder,
|
|
206
|
-
options: AudioWaveformOptions = {},
|
|
207
|
-
): {
|
|
208
|
-
bars: ShallowRef<number[]>;
|
|
209
|
-
} {
|
|
210
|
-
const track =
|
|
211
|
-
trackOrTrackReference instanceof Track
|
|
212
|
-
? trackOrTrackReference
|
|
213
|
-
: <LocalAudioTrack | RemoteAudioTrack | undefined>trackOrTrackReference?.publication?.track;
|
|
214
|
-
const opts = { ...waveformDefaults, ...options };
|
|
215
|
-
|
|
216
|
-
const aggregateWave = ref<Float32Array<ArrayBuffer>>(new Float32Array());
|
|
217
|
-
const timeRef = ref<number>(performance.now());
|
|
218
|
-
const updates = ref<number>(0);
|
|
219
|
-
const bars = ref<number[]>([]);
|
|
220
|
-
|
|
221
|
-
function onUpdate(wave: Float32Array) {
|
|
222
|
-
bars.value = Array.from(
|
|
223
|
-
filterData(wave, opts.barCount).map((v) => Math.sqrt(v) * opts.volMultiplier),
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
watch([track, options], () => {
|
|
228
|
-
if (!track || !track?.mediaStream) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
const { analyser, cleanup } = createAudioAnalyser(track, {
|
|
233
|
-
fftSize: getFFTSizeValue(opts.barCount),
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
const bufferLength = getFFTSizeValue(opts.barCount);
|
|
237
|
-
const dataArray = new Float32Array(bufferLength);
|
|
238
|
-
|
|
239
|
-
const update = () => {
|
|
240
|
-
updateWaveform = requestAnimationFrame(update);
|
|
241
|
-
analyser.getFloatTimeDomainData(dataArray);
|
|
242
|
-
aggregateWave.value.map((v, i) => v + dataArray[i]);
|
|
243
|
-
updates.value += 1;
|
|
244
|
-
|
|
245
|
-
if (performance.now() - timeRef.value >= opts.updateInterval) {
|
|
246
|
-
const newData = dataArray.map((v) => v / updates.value);
|
|
247
|
-
onUpdate(newData);
|
|
248
|
-
timeRef.value = performance.now();
|
|
249
|
-
updates.value = 0;
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
let updateWaveform = requestAnimationFrame(update);
|
|
254
|
-
|
|
255
|
-
onWatcherCleanup(() => {
|
|
256
|
-
cleanup();
|
|
257
|
-
cancelAnimationFrame(updateWaveform);
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
onBeforeMount(() => {
|
|
262
|
-
onUpdate(aggregateWave.value);
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
return {
|
|
266
|
-
bars,
|
|
267
|
-
};
|
|
268
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { useEnsureRoomContext } from '@/context/room.context';
|
|
2
|
-
import {
|
|
3
|
-
isSourcesWithOptions,
|
|
4
|
-
isSourceWitOptions,
|
|
5
|
-
type SourcesArray,
|
|
6
|
-
type TrackReference,
|
|
7
|
-
type TrackReferenceOrPlaceholder,
|
|
8
|
-
type TrackReferencePlaceholder,
|
|
9
|
-
type TrackSourceWithOptions,
|
|
10
|
-
} from '@livekit/components-core';
|
|
11
|
-
import { Participant, Track, type Room, type RoomEvent } from 'livekit-client';
|
|
12
|
-
import { computed, ref } from 'vue';
|
|
13
|
-
|
|
14
|
-
export type UseTracksOptions = {
|
|
15
|
-
updateOnlyOn?: RoomEvent[];
|
|
16
|
-
onlySubscribed?: boolean;
|
|
17
|
-
room?: Room;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type UseTracksHookReturnType<T> = T extends Track.Source[]
|
|
21
|
-
? TrackReference[]
|
|
22
|
-
: T extends TrackSourceWithOptions[]
|
|
23
|
-
? TrackReferenceOrPlaceholder[]
|
|
24
|
-
: never;
|
|
25
|
-
|
|
26
|
-
function difference<T>(setA: Set<T>, setB: Set<T>): Set<T> {
|
|
27
|
-
const _difference = new Set(setA);
|
|
28
|
-
for (const elem of setB) {
|
|
29
|
-
_difference.delete(elem);
|
|
30
|
-
}
|
|
31
|
-
return _difference;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function requiredPlaceholders<T extends SourcesArray>(
|
|
35
|
-
sources: T,
|
|
36
|
-
participants: Participant[],
|
|
37
|
-
): Map<Participant['identity'], Track.Source[]> {
|
|
38
|
-
const placeholderMap = new Map<Participant['identity'], Track.Source[]>();
|
|
39
|
-
if (isSourcesWithOptions(sources)) {
|
|
40
|
-
const sourcesThatNeedPlaceholder = sources
|
|
41
|
-
.filter((sourceWithOption) => sourceWithOption.withPlaceholder)
|
|
42
|
-
.map((sourceWithOption) => sourceWithOption.source);
|
|
43
|
-
|
|
44
|
-
participants.forEach((participant) => {
|
|
45
|
-
const sourcesOfSubscribedTracks = participant
|
|
46
|
-
.getTrackPublications()
|
|
47
|
-
.map((pub) => pub.track?.source)
|
|
48
|
-
.filter((trackSource): trackSource is Track.Source => trackSource !== undefined);
|
|
49
|
-
const placeholderNeededForThisParticipant = Array.from(
|
|
50
|
-
difference(new Set(sourcesThatNeedPlaceholder), new Set(sourcesOfSubscribedTracks)),
|
|
51
|
-
);
|
|
52
|
-
// If the participant needs placeholder add it to the placeholder map.
|
|
53
|
-
if (placeholderNeededForThisParticipant.length > 0) {
|
|
54
|
-
placeholderMap.set(participant.identity, placeholderNeededForThisParticipant);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return placeholderMap;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function useTracks<T extends SourcesArray = Track.Source[]>(
|
|
62
|
-
sources: T = [
|
|
63
|
-
Track.Source.Camera,
|
|
64
|
-
Track.Source.Microphone,
|
|
65
|
-
Track.Source.ScreenShare,
|
|
66
|
-
Track.Source.ScreenShareAudio,
|
|
67
|
-
Track.Source.Unknown,
|
|
68
|
-
] as T,
|
|
69
|
-
options: UseTracksOptions = {},
|
|
70
|
-
): UseTracksHookReturnType<T> {
|
|
71
|
-
const room = useEnsureRoomContext(options.room);
|
|
72
|
-
const trackReferences = ref<TrackReference[]>([]);
|
|
73
|
-
const participants = ref<Participant[]>([]);
|
|
74
|
-
|
|
75
|
-
const computedSources = computed(() =>
|
|
76
|
-
sources.map((s) => (isSourceWitOptions(s) ? s.source : s)),
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const maybeTrackReferences = computed(() => {
|
|
80
|
-
if (isSourcesWithOptions(sources)) {
|
|
81
|
-
const requirePlaceholder = requiredPlaceholders(sources, participants.value as Participant[]);
|
|
82
|
-
|
|
83
|
-
const trackReferencesWithPlaceholders = Array.from(
|
|
84
|
-
trackReferences.value,
|
|
85
|
-
) as TrackReferenceOrPlaceholder[];
|
|
86
|
-
|
|
87
|
-
for (const participant of participants.value) {
|
|
88
|
-
if (requirePlaceholder.has(participant.identity)) {
|
|
89
|
-
const sourcesToAddPlaceholder = requirePlaceholder.get(participant.identity) ?? [];
|
|
90
|
-
|
|
91
|
-
for (const placeholderSource of sourcesToAddPlaceholder) {
|
|
92
|
-
if (
|
|
93
|
-
trackReferencesWithPlaceholders.find(
|
|
94
|
-
({ participant: p, publication }) =>
|
|
95
|
-
participant.identity === p.identity && publication?.source === placeholderSource,
|
|
96
|
-
)
|
|
97
|
-
) {
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
console.debug(
|
|
102
|
-
`Add ${placeholderSource} placeholder for participant ${participant.identity}.`,
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
const placeholder: TrackReferencePlaceholder = {
|
|
106
|
-
participant: participant as Participant,
|
|
107
|
-
source: placeholderSource as Track.Source,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
trackReferencesWithPlaceholders.push(placeholder);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return trackReferencesWithPlaceholders;
|
|
116
|
-
} else {
|
|
117
|
-
return trackReferences;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
return maybeTrackReferences.value as UseTracksHookReturnType<T>;
|
|
122
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { updatePages, type TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
-
import { computed, ref, watch, type ShallowRef } from 'vue';
|
|
3
|
-
|
|
4
|
-
export interface UseVisualStableUpdateOptions {
|
|
5
|
-
customSortFunction?: (
|
|
6
|
-
trackReferences: TrackReferenceOrPlaceholder[],
|
|
7
|
-
) => TrackReferenceOrPlaceholder[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function useVisualStableUpdate(
|
|
11
|
-
/** `TrackReference`s to display in the grid. */
|
|
12
|
-
trackReferences: TrackReferenceOrPlaceholder[],
|
|
13
|
-
maxItemsOnPage: number,
|
|
14
|
-
options: UseVisualStableUpdateOptions = {},
|
|
15
|
-
): ShallowRef<TrackReferenceOrPlaceholder[]> {
|
|
16
|
-
const lastMaxItemsOnPage = ref<number>(-1);
|
|
17
|
-
const lastTrackRefs = ref<TrackReferenceOrPlaceholder[]>([]);
|
|
18
|
-
|
|
19
|
-
const isLayoutChanged = computed<boolean>(() => {
|
|
20
|
-
return maxItemsOnPage !== lastMaxItemsOnPage.value;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const sortedTrackReferences = computed<TrackReferenceOrPlaceholder[]>(() => {
|
|
24
|
-
return options.customSortFunction
|
|
25
|
-
? options.customSortFunction(trackReferences)
|
|
26
|
-
: trackReferences;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const updatedTrackReferences = ref<TrackReferenceOrPlaceholder[]>([
|
|
30
|
-
...sortedTrackReferences.value,
|
|
31
|
-
]);
|
|
32
|
-
|
|
33
|
-
function updateTrackReferences(): void {
|
|
34
|
-
if (!isLayoutChanged.value) {
|
|
35
|
-
try {
|
|
36
|
-
updatedTrackReferences.value = updatePages(
|
|
37
|
-
lastTrackRefs.value as TrackReferenceOrPlaceholder[],
|
|
38
|
-
sortedTrackReferences.value,
|
|
39
|
-
maxItemsOnPage,
|
|
40
|
-
);
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.error('Error while running updatePages(): ', error);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (isLayoutChanged.value) {
|
|
47
|
-
lastTrackRefs.value = sortedTrackReferences.value;
|
|
48
|
-
} else {
|
|
49
|
-
lastTrackRefs.value = updatedTrackReferences.value;
|
|
50
|
-
}
|
|
51
|
-
lastMaxItemsOnPage.value = maxItemsOnPage;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
watch(() => sortedTrackReferences, updateTrackReferences);
|
|
55
|
-
|
|
56
|
-
return updatedTrackReferences as ShallowRef<TrackReferenceOrPlaceholder[]>;
|
|
57
|
-
}
|
package/src/context/index.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createInjectionState } from '@vueuse/core';
|
|
2
|
-
import { shallowRef, type ShallowRef } from 'vue';
|
|
3
|
-
import { usePinContext, type PinContext } from './pin.context';
|
|
4
|
-
import { useWidgetContext, type WidgetContextType } from './widget.context';
|
|
5
|
-
|
|
6
|
-
export type LayoutState = {
|
|
7
|
-
pin: PinContext;
|
|
8
|
-
widget: WidgetContextType;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const [useProvideLayoutContext, useLayoutContext] = createInjectionState(
|
|
12
|
-
(initialValue: LayoutState): ShallowRef<LayoutState> => {
|
|
13
|
-
const state = shallowRef(initialValue);
|
|
14
|
-
|
|
15
|
-
return state;
|
|
16
|
-
},
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
export { useLayoutContext, useProvideLayoutContext };
|
|
20
|
-
|
|
21
|
-
export function useMaybeLayoutContext(): ShallowRef<LayoutState> | undefined {
|
|
22
|
-
return useLayoutContext();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function useEnsureLayoutContext(layoutContext?: LayoutState) {
|
|
26
|
-
const lc = layoutContext ? shallowRef(layoutContext) : useLayoutContext();
|
|
27
|
-
|
|
28
|
-
if (!lc) {
|
|
29
|
-
throw Error('Tried to access LayoutContext context outside a LayoutContextProvider provider.');
|
|
30
|
-
}
|
|
31
|
-
return lc;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function useCreateLayoutContext() {
|
|
35
|
-
return {
|
|
36
|
-
pin: usePinContext(),
|
|
37
|
-
widget: useWidgetContext(),
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function useEnsureCreateLayoutContext(layoutContext?: {
|
|
42
|
-
pin: PinContext;
|
|
43
|
-
widget: WidgetContextType;
|
|
44
|
-
}) {
|
|
45
|
-
return shallowRef(layoutContext) ?? useCreateLayoutContext();
|
|
46
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createInjectionState } from '@vueuse/core';
|
|
2
|
-
import type { Participant } from 'livekit-client';
|
|
3
|
-
import { shallowRef, type ShallowRef } from 'vue';
|
|
4
|
-
|
|
5
|
-
export type ParticipantContext = {
|
|
6
|
-
participant: Participant;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const [useProvideParticipantContext, useParticipantContext] = createInjectionState(
|
|
10
|
-
(initialValue: Participant): ShallowRef<Participant> => {
|
|
11
|
-
const participant = shallowRef(initialValue);
|
|
12
|
-
|
|
13
|
-
return participant;
|
|
14
|
-
},
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
export function useMaybeParticipantContext(): ShallowRef<Participant> | undefined {
|
|
18
|
-
return useParticipantContext();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function useEnsureParticipant(participant?: Participant): ShallowRef<Participant> {
|
|
22
|
-
const r = participant ? shallowRef(participant) : useParticipantContext();
|
|
23
|
-
|
|
24
|
-
if (!r || !r.value) {
|
|
25
|
-
throw new Error(
|
|
26
|
-
'Please call `useProvideParticipantContext` on the appropriate parent component',
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return r;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { useParticipantContext, useProvideParticipantContext };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { PinState, TrackReferenceOrPlaceholder } from '@livekit/components-core';
|
|
2
|
-
import { createInjectionState } from '@vueuse/core';
|
|
3
|
-
import { shallowRef } from 'vue';
|
|
4
|
-
|
|
5
|
-
export type PinAction =
|
|
6
|
-
| {
|
|
7
|
-
msg: 'set_pin';
|
|
8
|
-
trackReference: TrackReferenceOrPlaceholder;
|
|
9
|
-
}
|
|
10
|
-
| { msg: 'clear_pin' }
|
|
11
|
-
| { msg: 'toggle_settings' };
|
|
12
|
-
|
|
13
|
-
export type PinContext = {
|
|
14
|
-
state: PinState;
|
|
15
|
-
dispatch?: (action: PinAction) => void;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function pinReducer(state: PinState, action: PinAction): PinState {
|
|
19
|
-
if (action.msg === 'set_pin') {
|
|
20
|
-
return [action.trackReference];
|
|
21
|
-
} else if (action.msg === 'clear_pin') {
|
|
22
|
-
return [];
|
|
23
|
-
} else {
|
|
24
|
-
return { ...state };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const [useProvidePinContext, usePinContext] = createInjectionState((initialValue: PinState) => {
|
|
29
|
-
const state = shallowRef(initialValue);
|
|
30
|
-
|
|
31
|
-
function dispatch(action: PinAction) {
|
|
32
|
-
state.value = pinReducer(state.value, action);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
state,
|
|
37
|
-
dispatch,
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
export { usePinContext, useProvidePinContext };
|
|
42
|
-
|
|
43
|
-
export const useEnsurePinContext = (pinContext?: PinState) => {
|
|
44
|
-
const pc = pinContext ? shallowRef(pinContext) : usePinContext();
|
|
45
|
-
|
|
46
|
-
if (!pc) {
|
|
47
|
-
throw Error('Tried to access PinContext context outside a PinContextProvider provider.');
|
|
48
|
-
}
|
|
49
|
-
return pc;
|
|
50
|
-
};
|