A simple video conferencing application built with LiveKit and Node.js. This demo showcases basic LiveKit functionality including:
- Video and audio conferencing
- Device selection (camera, microphone)
- Screen sharing
- Room management
- Real-time audio visualization
Before running this application, you need to have the following installed:
- Node.js (v14 or later)
- pnpm (recommended) or yarn
- LiveKit CLI for the development server
If you haven't installed the LiveKit CLI yet, you can do so with:
https://docs.livekit.io/home/cli/cli-setup/
Navigate to the project directory and install the required dependencies:
# Using pnpm
pnpm install
# Using yarn
yarn install
The application uses environment variables for configuration. A .env
file is included with default development settings:
LIVEKIT_API_KEY=devkey
LIVEKIT_API_SECRET=secret
LIVEKIT_WS_URL=ws://localhost:7880
PORT=3000
These are the default values for the LiveKit development server. You can modify them if needed.
To run the application, you need to start both the LiveKit development server and the Node.js server.
Open a terminal window and run:
livekit-server --dev
This will start the LiveKit server on port 7880 with the default development API key and secret.
For network access (to allow other devices to connect), use:
livekit-server --dev --bind 0.0.0.0
Open another terminal window, navigate to the project directory, and run:
# Using node directly
node server.js
# Or if you have nodemon installed for development
nodemon server.js
The server will start on port 3000 (or the port specified in your .env
file).
Open your web browser and navigate to:
http://localhost:3000
- Enter your username and a room name
- Click "Join Room" to enter the video conference
- Use the control buttons at the bottom to:
- Toggle microphone
- Toggle camera
- Share your screen
- Leave the room
If you encounter connection issues:
- Make sure both the LiveKit server and Node.js server are running
- Check that the WebSocket URL in the
.env
file matches your LiveKit server address - For local development, use
ws://
protocol (notwss://
) - Check browser console for detailed error messages
If you have camera or microphone permission issues:
- Make sure you've granted the necessary permissions in your browser
- Try using a different browser if permissions are not working
- Check if your camera/microphone is being used by another application
- The application uses the LiveKit Client SDK loaded via CDN
- The server uses Express.js to serve static files and handle token generation
- Media device selection is handled through the browser's Media Devices API
This project is licensed under the MIT License - see the LICENSE file for details.
- LiveKit for the WebRTC platform
- Express.js for the web server framework