Skip to content

Latest commit

 

History

History

p2p_call_sample

P2P Calls code sample for Flutter for ConnectyCube platform

This README introduces ConnectyCube P2P Calls code sample for Flutter

The project contains the following features implemented:

  • User authorization
  • Group video/audio calls (up to 4 users)
  • Mute/unmute microphone
  • Switch cameras
  • Disable/enable the video stream
  • Switch speakerphone and earpiece
  • Opponents' Mic level monitoring
  • Opponents' Video bitrate monitoring
  • Screen Sharing
  • Background calls (via push notifications)

Documentation

ConnectyCube Flutter getting started - https://developers.connectycube.com/flutter

ConnectyCube P2P Calls API documentation - https://developers.connectycube.com/flutter/videocalling

Screenshots

Flutter P2P Calls code sample, login Flutter P2P Calls code sample, select users Flutter P2P Calls code sample, video chat Flutter P2P Calls code sample, video chat (macOS)

Run

Prepare environment for Flutter and clone the project.

Config

Replace vars in config file lib/src/config.dart

  • REPLACE_APP_ID
  • REPLACE_APP_AUTH_KEY
  • REPLACE_APP_AUTH_SECRET
  • REPLACE_USER_{1/2/3/4}_{LOGIN/FULL_NAME/PASSWORD}

Run on Android:

  • Right mouse button click on main.dart
  • Chose 'Run 'main.dart''

The app will automatically run on your Android device.

Run on iOS:

  • cd ios
  • pod install
  • Open Runner.xcworkspace from ios dir
  • Run project

The app will automatically run on a selected iOS device or simulator.

Run on macOS

  • Run command from the Terminal flutter run -d macos

Run on Windows

  • Run command from the Terminal flutter run -d windows

Run on Web

  • Run command from the Terminal flutter run -d chrome

Run on Linux

  • Run command from the Terminal flutter run -d linux

Receiving calls on the mobile platforms

Flutter P2P Calls code sample, incoming call in background Android Flutter P2P Calls code sample, incoming call locked Android Flutter P2P Calls code sample, incoming call in background iOS Flutter P2P Calls code sample, incoming call locked iOS

For notifying mobile platforms we use Connectycube Push notifications feature and own Connectycube Call Kit plugin for supporting Call Kit feature.

Configure Push notifications:

  1. Create your own app in the ConnectyCube admin panel (if not created yet);
  2. Create a project in the Firebase developer console (if not created yet);
  3. Add the Server API key from the Firebase developer console to the ConnectyCube admin panel for the Android platform (short guide);
  4. Add Apple certificate for the iOS platform (short guide, how to generate and set it to the admin panel). But instead of an APNS certificate, you should choose a VoIP certificate;
  5. Add google-services.json file from the Firebase developer console to the Android app by path p2p_call_sample/android/app/
  6. Configure file p2p_call_sample/lib/src/utils/configs.dart with your endpoints from the 1st. point of this guide;
  7. Create users in the ConnectyCube admin panel and add them to the configure file p2p_call_sample/lib/src/utils/configs.dart
  8. Build and run the app as usual;

Can't build yourself?

Got troubles with building Flutter code samples? Create an issue at Issues page