Skip to content

dima-xd/tgcalls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ntgcalls_flutter

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.

Usage

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.

Channel contract

  • 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.

About

Transport-only Flutter binding to the ntgcalls media engine for 1:1 Telegram-style P2P voice and video calls. Pair it with a signaling layer (e.g. TDLib) that performs call setup and Diffie-Hellman key exchange.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors