import 'dart:async'; import 'package:matrix/matrix.dart'; import 'package:matrix/src/voip/models/call_membership.dart'; abstract class CallBackend { String type; CallBackend({ required this.type, }); factory CallBackend.fromJson(Map json) { final String type = json['type'] as String; if (type == 'mesh') { return MeshBackend( type: type, ); } else if (type == 'livekit') { return LiveKitBackend( livekitAlias: json['livekit_alias'] as String, livekitServiceUrl: json['livekit_service_url'] as String, type: type, ); } else { throw ArgumentError('Invalid type: $type'); } } Map toJson(); bool get e2eeEnabled; CallParticipant? get activeSpeaker; WrappedMediaStream? get localUserMediaStream; WrappedMediaStream? get localScreenshareStream; List get userMediaStreams; List get screenShareStreams; bool get isLocalVideoMuted; bool get isMicrophoneMuted; Future initLocalStream( GroupCallSession groupCall, { WrappedMediaStream? stream, }); Future updateMediaDeviceForCalls(); Future setupP2PCallsWithExistingMembers(GroupCallSession groupCall); Future setupP2PCallWithNewMember( GroupCallSession groupCall, CallParticipant rp, CallMembership mem, ); Future dispose(GroupCallSession groupCall); Future onNewParticipant( GroupCallSession groupCall, List anyJoined, ); Future onLeftParticipant( GroupCallSession groupCall, List anyLeft, ); Future requestEncrytionKey( GroupCallSession groupCall, List remoteParticipants, ); Future onCallEncryption( GroupCallSession groupCall, String userId, String deviceId, Map content, ); Future onCallEncryptionKeyRequest( GroupCallSession groupCall, String userId, String deviceId, Map content, ); Future setDeviceMuted( GroupCallSession groupCall, bool muted, MediaInputKind kind, ); Future setScreensharingEnabled( GroupCallSession groupCall, bool enabled, String desktopCapturerSourceId, ); List>? getCurrentFeeds(); @override bool operator ==(Object other); @override int get hashCode; }