updateVideoSourceSubscriptions method
Future<void>
updateVideoSourceSubscriptions({
- required List<
RemoteVideoSource> toAdd, - List<
RemoteVideoSource> toRemove = const [],
Subscribes to the specified remote video sources and unsubscribes from the removed ones.
Call this in response to onRemoteVideoSourcesAvailable to receive video from remote attendees.
Pass an attendee's source in toRemove to stop receiving their video.
Implementation
Future<void> updateVideoSourceSubscriptions({
required List<RemoteVideoSource> toAdd,
List<RemoteVideoSource> toRemove = const [],
}) async {
try {
await _coordinator.hostApi.updateVideoSourceSubscriptions(
toAdd.map((s) => RemoteVideoSourceMsg(attendeeId: s.attendeeId)).toList(),
toRemove.map((s) => RemoteVideoSourceMsg(attendeeId: s.attendeeId)).toList(),
);
} on PlatformException catch (e) {
throw ChimeDeviceException('Failed to update video source subscriptions', e.message);
}
}