voxa_rtc_engine 0.1.1 copy "voxa_rtc_engine: ^0.1.1" to clipboard
voxa_rtc_engine: ^0.1.1 copied to clipboard

Drop-in, Agora-API-compatible RTC SDK for Flutter on self-hosted infrastructure: same classes, signatures, error codes, and callback ordering as agora_rtc_engine 6.x, over a LiveKit-based media engine.

voxa_rtc_engine #

A drop-in, Agora-API-compatible RTC engine for Flutter — on infrastructure you own.

VoxaRTC replicates the public API of agora_rtc_engine (compat line 6.x, pinned to 6.6.3) on top of a self-hosted, LiveKit-based media backend. Same classes, same method signatures, same enums, same error codes, same callback ordering — so an existing Agora Flutter app migrates without rewriting business logic.

⚠️ Early development. The Tier-1/Tier-2 API surface below is implemented and behavior-verified; everything else fails gracefully. Not yet recommended for production traffic.

Migration from Agora #

1. Swap the dependency:

dependencies:
  voxa_rtc_engine: ^0.1.1   # was: agora_rtc_engine: ^6.6.3

2. Swap the import (find & replace):

// before
import 'package:agora_rtc_engine/agora_rtc_engine.dart';
// after
import 'package:voxa_rtc_engine/voxa_rtc_engine.dart';

3. Point the SDK at your VoxaRTC gateway — the only new line:

import 'package:voxa_rtc_engine/voxa.dart';

void main() {
  VoxaRtc.serverUrl = 'https://gate.example.com';
  runApp(const MyApp());
}

Everything else stays: createAgoraRtcEngine(), RtcEngine, joinChannel(), RtcEngineEventHandler, AgoraVideoView, your existing Agora-format tokens (AccessToken2), and your server-side token builders (drop-in voxa-token libraries for Node and Go keep RtcTokenBuilder.buildTokenWithUid(...) byte-compatible).

Quick example #

final engine = createAgoraRtcEngine();
await engine.initialize(const RtcEngineContext(
  appId: '<your VoxaRTC app id>',
  channelProfile: ChannelProfileType.channelProfileLiveBroadcasting,
));

engine.registerEventHandler(RtcEngineEventHandler(
  onJoinChannelSuccess: (connection, elapsed) => print('joined'),
  onUserJoined: (connection, remoteUid, elapsed) => print('peer $remoteUid'),
));

await engine.setClientRole(role: ClientRoleType.clientRoleBroadcaster);
await engine.enableVideo();
await engine.startPreview();
await engine.joinChannel(
  token: token, channelId: 'demo', uid: 0,
  options: const ChannelMediaOptions(),
);

// Rendering — unchanged from Agora:
AgoraVideoView(
  controller: VideoViewController(
    rtcEngine: engine,
    canvas: const VideoCanvas(uid: 0),
  ),
);

What's implemented #

Channel & lifecycleinitialize, release, joinChannel, leaveChannel, renewToken, connection-state machine, auto-reconnect (onRejoinChannelSuccess), token lifecycle (onTokenPrivilegeWillExpire, onRequestToken).

Media — enable/disable audio & video, local/remote mute, roles (broadcaster/audience), switchCamera, speakerphone routing, pre-join startPreview, setVideoEncoderConfiguration, dual-stream/simulcast (enableDualStreamMode, setRemoteVideoStreamType), screen share, volume indication, in-call stats (onRtcStats, onNetworkQuality).

Behavioral compatibility — callback order, error codes, and idempotency quirks (double-join, mute-before-join, uid 0 auto-assign…) are verified against recordings from the real Agora service via a golden-transcript test harness, not just written from documentation.

Not supported at this stage (calls return AgoraRtcException(-4, errNotSupported) instead of crashing): media player, spatial audio, channel media relay, raw frame observers, RTM.

Platform Status
Android ✅ tested on devices
macOS ✅ tested
iOS 🟡 expected to work (LiveKit-based), not yet CI-verified
Web ❌ not yet

Backend required #

This SDK talks to a self-hosted VoxaRTC backend: a Compat Gateway (Agora token verification → media-server credentials) in front of a LiveKit cluster. Deployment configs, the gateway, server-side token builders, and the parity harness live in the VoxaRTC repository.

License #

MIT © Zaman Sheikh (VoxaRTC). Portions of the API-surface declarations are derived from agora_rtc_engine (MIT) — see THIRD_PARTY_LICENSES. "Agora" is a trademark of Agora, Inc.; this project is an independent, API-compatible implementation and is not affiliated with or endorsed by Agora, Inc.

0
likes
0
points
47
downloads

Publisher

verified publisherzamansheikh.com

Weekly Downloads

Drop-in, Agora-API-compatible RTC SDK for Flutter on self-hosted infrastructure: same classes, signatures, error codes, and callback ordering as agora_rtc_engine 6.x, over a LiveKit-based media engine.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, flutter, http, json_annotation, livekit_client, meta

More

Packages that depend on voxa_rtc_engine