final streamVideo = StreamVideo(
apiKey: 'your-api-key',
user: user,
userToken: userToken,
options: const StreamVideoOptions(
allowMultipleActiveCalls: true,
),
);
Multiple Simultaneous Calls Support
The Stream Video Flutter SDK allows users to handle multiple active video calls at the same time. This guide explains how to enable and work with multiple simultaneous calls in your application.
Default Behavior: Single Active Call
By default, the SDK operates in single active call mode (allowMultipleActiveCalls = false
):
- Only one call can be active at a time
- Accepting a new call automatically ends any existing active call
- Access the current active call using
StreamVideo.activeCall
- Monitor active call changes with
StreamVideo.listenActiveCall()
Enabling Multiple Active Calls
To support multiple simultaneous calls, set allowMultipleActiveCalls
to true
when initializing the StreamVideo client:
Working with Multiple Active Calls
When multiple active calls are enabled, the API behavior changes:
Single Call Mode (Default)
- Use
StreamVideo.activeCall
to access the current active call - Use
StreamVideo.activeCalls
to get a list containing 0 or 1 call - Use
StreamVideo.listenActiveCall()
to monitor the active call
Multiple Calls Mode
- Do not use
StreamVideo.activeCall
(throws an exception) - Use
StreamVideo.activeCalls
to get a list of all active calls - Use
StreamVideo.listenActiveCalls()
to monitor currently active calls - New calls are added to the existing list without terminating others
Platform-Specific Behavior
Android Background Services
When multiple calls are enabled on Android:
- Each active call displays its own foreground service notification
- Screen sharing services operate independently for each call
When multiple active calls are enabled, you must provide the callCid
parameter when managing foreground services to specify which call’s service to control:
// Stop service for a specific call
StreamVideoFlutterBackground.stopService(
ServiceType.call,
callCid: callCid
);
Without the callCid
, the SDK cannot determine which call’s service to manage.
Related Features
When managing multiple active calls, consider using In-App Picture-in-Picture to provide a better user experience. PiP mode allows users to minimize calls to a small overlay window while continuing other activities in your app, making it easier to handle multiple simultaneous calls.