Transport-only Flutter binding to the ntgcalls media engine for 1:1 Telegram-style P2P voice and video calls. It runs only the media/RTC transport: you supply a signaling layer - typically TDLib - that creates/accepts the call and performs the Diffie-Hellman key exchange, then hand this plugin the servers, encryption key and protocol versions and it carries the audio/video.
Android only.
import 'package:ntgcalls_flutter/tgcalls.dart';
import 'package:ntgcalls_flutter/tgcalls_method_channel.dart';
final engine = MethodChannelTgCalls();
await engine.warmUp(); // load the engine's real supported protocol versions
// When your signaling layer reaches the "ready" state, build a config from it:
final session = await engine.start(TgCallConfig(
isOutgoing: true,
isVideo: false,
servers: servers, // from CallStateReady.servers
encryptionKey: key, // from CallStateReady.encryptionKey
config: config,
customParameters: customParameters,
maxLayer: 92,
allowP2p: true,
));
// Pump signaling both ways:
session.outgoingSignaling.listen((bytes) => sendToPeerViaTdlib(bytes));
session.pushSignaling(incomingBytes); // on each inbound signaling update
// Controls:
await session.setMuted(true);
await session.setVideoEnabled(true);
await session.stop();supportedVersions is the list you advertise to the signaling protocol so the
peer negotiates a version the bundled engine can actually run.
tgcalls/methods(MethodChannel):supportedVersions,start,push,setMuted,setVideoEnabled,switchCamera,setAudioRoute,stop.tgcalls/events(EventChannel):signaling(outgoing bytes),state,audioLevel,texture.
See example/ for a minimal app, or
nullgram for a real-world client wiring
this plugin to TDLib signaling.