Warning
The Twilio Live API is end of life (EOL) and is no longer available to customers. See this page for details.
This project demonstrates an interactive live audio streaming app that uses Twilio Live and Twilio Video. The project is setup as a monorepo that contains the frontend reference applications for iOS.
- Deploy the backend to Twilio Serverless in just a few minutes.
- Create or join a stream as a speaker and collaborate with other users.
This section describes the steps required for all developers to get started with their respective platform.
- Node.js v14+
- NPM v7+ (upgrade from NPM 6 with
npm install --global npm
)
Copy the .env.example
file to .env
and perform the following one-time steps before deploying your application.
Update the ACCOUNT_SID and AUTH_TOKEN .env
entries with the Account SID and Auth Token found on the Twilio Console home page.
Create an API Key and Secret and update the TWILIO_API_KEY_SID and TWILIO_API_KEY_SECRET .env
entries. You can create a new API Key and Secret in the Twilio Console by navigating to Account -> API Keys
.
Update the CONVERSATIONS_SERVICE_SID .env
entry with your Default Service SID found in Conversations -> Manage -> Services
or use a new Twilio Conversations Service SID that can be created in the Twilio console.
Update PASSCODE with a 6 digit numeric passcode. The value may be anything you choose.
Once you have setup all your environment variables, run npm install
to install all dependencies from NPM.
Once the application environment has been configured and dependencies have been installed, you can deploy the app backend using the following command.
npm run deploy
Backend URL: https://twilio-live-interactive-audio-7873-dev.twil.io
If you make any changes to the application, then you can run npm run deploy
again and subsequent deploys will override your existing app.
If you encounter any deploy errors, try to run npm run remove
and then npm run deploy
again.
The app is configured to automatically end a stream after it has been running for 30 minutes. This limitation is in place to limit the charges applied to your Twilio account during early testing.
Max duration is specified when the reference backend creates a PlayerStreamer
and MediaProcessor
. To change the max duration, edit this source code before deploying the app.
- Replace
BACKEND_URL
in the app source with the public URL from the backend deployment
- Run the app
- Enter any unique name in the
Name
field - Enter the passcode from the backend deployment in the
Passcode
field - Tap
Sign in
- Tap a room in the list to join or tap
Create new room
to create a new room
This application uses Twilio Functions and Twilio Conversations in addition to Twilio Video Rooms and Twilio Live resources. Note that by deploying and using this application, your will be incurring usage for these services and will be billed for usage.