Skip to content

helloharendra/Agora-Video-calling-Flutter

Repository files navigation

📹 Agora Video Calling - Flutter

Flutter Agora Platforms License

A complete, production-ready video calling solution for Flutter using Agora SDK. Supports 1:1 calls, group meetings, screen sharing, and real-time messaging.

✨ Key Features

  • 🎥 High-quality video calls (720p/1080p)
  • 🎙️ Crystal clear audio with noise suppression
  • 👥 Multi-user conferences (up to 17 participants)
  • 🖥️ Screen sharing (Android/iOS/Web)
  • 🔒 End-to-end encryption for secure calls
  • 🌐 Cross-platform (iOS, Android, Web)
  • 💬 In-call chat messaging
  • 🎚️ Device management (camera/mic/speaker control)

🎥 Demo

🚀 Quick Setup

1. Add Dependencies

dependencies:
  agora_rtc_engine: ^6.2.1
  permission_handler: ^10.2.0
  flutter_local_notifications: ^13.0.0

2. Platform Configuration

Android:

  1. Add camera/microphone permissions to AndroidManifest.xml
  2. Enable Java 8 support in build.gradle

iOS:

  1. Add NSCameraUsageDescription and NSMicrophoneUsageDescription to Info.plist
  2. Enable background modes for VoIP

Web:

  1. Add CSP rules to index.html
  2. Configure CORS for your domain

3. Initialize Agora Engine

final RtcEngine _engine = await RtcEngine.createWithContext(
  RtcEngineContext(
    APP_ID, // Your Agora App ID
    channelProfile: ChannelProfile.LiveBroadcasting,
  )
);

await _engine.enableVideo();
await _engine.setClientRole(ClientRole.Broadcaster);

💻 Basic Implementation

Join Channel

await _engine.joinChannel(
  token: TEMP_TOKEN, // Use null for testing
  channelId: 'test_channel',
  uid: 0, // 0 = auto-assign UID
  options: ChannelMediaOptions(),
);

Setup Video View

// Local view
AgoraVideoView(
  controller: VideoViewController(
    rtcEngine: _engine,
    canvas: VideoCanvas(uid: 0),
  ),
)

// Remote view
AgoraVideoView(
  controller: VideoViewController.remote(
    rtcEngine: _engine,
    canvas: VideoCanvas(uid: remoteUid),
    connection: RtcConnection(channelId: 'test_channel'),
  ),
)

🛠️ Advanced Features

Screen Sharing (Android/iOS)

await _engine.startScreenCapture(
  ScreenCaptureParameters(
    captureAudio: true,
    videoParams: ScreenVideoParameters(
      dimensions: VideoDimensions(width: 1280, height: 720),
      frameRate: 15,
    ),
  ),
);

In-Call Controls

// Toggle camera
await _engine.switchCamera();

// Mute/unmute
await _engine.muteLocalAudioStream(true);

// Speaker control
await _engine.setEnableSpeakerphone(true);

Event Handling

_engine.setEventHandler(RtcEngineEventHandler(
  joinChannelSuccess: (channel, uid, elapsed) {
    // Handle join success
  },
  userJoined: (uid, elapsed) {
    // Add remote video view
  },
  userOffline: (uid, reason) {
    // Remove remote view
  },
));

🔐 Security Best Practices

  1. Use Tokens (not App ID alone) in production
  2. Implement token generation on your backend
  3. Enable encryption with _engine.setEncryptionSecret()
  4. Use role-based permissions

📜 License

MIT License - See LICENSE for details.


💼 Hire Me & Support My Work

🤝 Available for Projects

I'm open to Flutter development, API integrations, and consulting work.

📱 Phone/WhatsApp: +91 7991327022
📧 Email: harendraprajapati72@gmail.com
🌐 Website: nayaproyog.com
💻 Portfolio: github.helloharendra.io

☕ Buy Me a Coffee

If you appreciate my work, consider supporting me:

Buy Me A Coffee

About

Video call functionality using agora

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published